Component.plot

rfnetwork.component.Component.plot

Component.plot(*paths, frequency=None, fmt='db', axes=None, tune=False, freq_unit='ghz', ref=None, label='', label_mode='prefix', lines=None, **kwargs)

Plots s-matrix or noise figure data over frequency

Return type:

List[Line2D]

Parameters

*pathstuple | int

Port paths to plot. Each path can be an integer or a tuple of port numbers. For example, 21 is equivalent to (2, 1) and plots S21. If no arguments are given every possible path will be plotted.

frequencynp.ndarray, optional

frequencies [Hz] to plot data over. If not provided, attempts to find a default frequency vector that minimizes extrapolation of component data.

fmtstr, default: “db”

data format for y-axis data. Accepts the following values - “mag”: Magnitude - “db” : 20log of magnitude - “ang” Phase angle - “ang_unwrap”: Unwrapped phase angle - “vswr” : Voltage standing wave ratio - “real” : Real part of the complex s-matrix data - “imag” : Imaginary part of the complex s-matrix data - “realz” : Real part of the port input impedance - “imagz” : Imaginary part of the port input impedance - “nf” : Noise figure

axesmatplotlib.Axes, optional

Axes object to plot data on. If not provided, an axes is created with the default figure size.

tunebool, optional

If true, adds the plot as a tuning plot.

freq_unit{“Hz”, “kHz”, “MHz”, “GHz”}, default: “GHz”

Unit for frequency axis.

reftuple | int

Normalizes all plotted paths to this path. For example, to plot the phase difference between S21 and S31, .plot(21, ref=31, fmt="ang"). Supports a list of tuples or integers the same length as the number of paths, where each path is normalized to a different reference path.

labelstr | list, default: “”

Legend labels for plotted lines. Supports either a string to add a common label for all lines, or a list of strings for each line.

label_mode{“prefix”, “suffix”, “override”}, default: “prefix”

Controls the placement of the line labels relative to the default label of “S(b,a)”. By default, labels are a “prefix” to the default label. “override” replaces the default label.

lineslist[Line2D], optional

Line2D objects for each path. If provided, updates the existing lines instead of drawing new ones on the plot.

**kwargs

parameters passed into matplotlib.axes.plot().

Returns

lineslist[Line2D]

list of line objects that were created for each path. If lines parameter was used, returned lines are the same as the lines parameter.