Main Content

plotyy

Plot parameters of RF circuit or RF data on X-Y plane with two Y-axes

Description

example

plotyy(h,circuitPara) plots the RFCKT or RF Data object parameters on the X-Y plane with two Y-axes. You can specify multiple RFCKT or RF Data object in this syntax.

Note

For all circuit objects except for those that contain data from a data file, you must perform frequency domain analysis using the analyze function before using plotyy.

plotyy(h,circuitPara,format1,format2) plots the RFCKT or RF Data object parameters with primary and secondary formats.

Determining Parameter Formats table lists primary and secondary formats for the all RFCKT or RF data object parameters. You can also use listformat to get a list of valid parameters for circuit or data objects.

example

plotyy(h,circuitPara1_1,format1,circuitPara2_1,format2) plots RF data as follows:

  • Plot circuitPara1_1 using format1 in the left Y-axis.

  • Plot circuitPara2_1 using format2 in the right Y-axis.

example

plotyy(___,xAxisPara,xAxisFmt,opCon,opVal) plots the circuit parameters circuitPara on a X-Y plane with the variables xAxisPara, their corresponding format xAxisFmt, operating conditions opCon, and operating values opVal for the RFCKT or RF data object h.

example

plotyy(___,Name,Value) plots the RFCKT or RF data object parameters under specified name-value pair operating conditions for the RF object.

[ax,hlines1,hlines2] = plotyy(___) returns the handles of the axes and two line series objects.

Examples

collapse all

Create rfckt amplifier object.

amp = rfckt.amplifier;

Plot S11 and S21 parameters of the amplifier on two y-axis.

plotyy(amp,'S11','S21')

Figure contains 2 axes objects. Axes object 1 with xlabel Freq [GHz], ylabel Magnitude (decibels) contains 2 objects of type line. These objects represent dB(S_{11}), dB(S_{21}). Axes object 2 with ylabel Angle (degrees) contains 2 objects of type line. These objects represent Deg(S_{11}), Deg(S_{21}).

The primary and secondary formats for both S11 and S21 are Magnitude(decibels) and Angle(degrees). respectively. So, the plotyy uses this primary-secondary format pair to create the plot.

Plot the S11 and NF (noise figure) parameters of the amplifier on two y-axis.

plotyy(amp,'S11','NF')

Figure contains 2 axes objects. Axes object 1 with xlabel Freq [GHz], ylabel Magnitude (decibels) contains 2 objects of type line. These objects represent dB(S_{11}), NF [dB]. Axes object 2 with ylabel Angle (degrees) contains an object of type line. This object represents Deg(S_{11}).

The primary and secondary formats for S11 are Magnitude (decibels) and Angle (degrees), respectively.

  • Magnitude (decibels) is a valid format for both S11 and NF

  • Angle (Degrees) is a valid format for S11.

These formats both meet the preceding criteria, so the function uses this primary-secondary format pair to create the plot.

Plot the NF, S21 and GroupDelay parameters of amp on two y-axis.

plotyy(amp, 'NF', 'S21', 'GroupDelay')

Figure contains 2 axes objects. Axes object 1 with xlabel Freq [GHz], ylabel Magnitude (decibels) contains 2 objects of type line. These objects represent NF [dB], dB(S_{21}). Axes object 2 with ylabel ns contains an object of type line. This object represents GroupDelay [ns].

The primary and secondary formats for S21 are Magnitude (decibels) and Angle (Degrees), respectively. Both NF and GroupDelay have only a primary format.

  • Magnitude (decibels) is the primary format for NF.

  • ns is the primary format for GroupDelay.

There is no primary-secondary format pair that meets the preceding criteria, so plotyy tries to find a pair of primary formats that meet the criteria. plotyy creates the plot using:

  • Magnitude (decibels) for the left y-axis. This format is valid for both NF and S21.

  • ns for the right y-axis. This format is valid for GroupDelay .

These formats meet the criteria.

Plot the NFactor and K parameters of amp on two y-axis.

plotyy(amp, 'NFactor', 'K')

Figure contains an axes object. The axes object with xlabel Freq [GHz] contains 2 objects of type line. These objects represent NFactor, K.

Both NFactor and K have only a primary format, None, so plotyy calls the plot command to create a plot with a single y-axis whose format is None.

Create an amplifier object from the specified P2D file.

ckt1 = read(rfckt.amplifier,'default.p2d');

Plot the Pout, S11, and S22 of the amplifier with frequency is plotted in GHz and bias is set to 1.5 v.

plotyy(ckt1,'Pout','dBm','S11','S22','Magnitude (decibels)', 'Freq','GHz','bias',1.5,'Pin',18)

Figure contains 2 axes objects. Axes object 1 with xlabel Freq [GHz], ylabel dBm contains an object of type line. This object represents P_{out} [dBm](P_{in}=18[dBm];Bias=1.5). Axes object 2 with ylabel Magnitude (decibels) contains 2 objects of type line. These objects represent dB(S_{11})(Bias=1.5), dB(S_{22})(Bias=1.5).

Input Arguments

collapse all

Circuit or data object, specified as rfckt object or rfdata object. For complete list of RFCKT and RF data objects, see RF Circuit Objects and RF Data Objects.

Example: amp = rfckt.amplifier; plotyy(amp,'S11',S12') Plots the parameters S11 and S12 of the rfckt.amplifier on the left and right Y-axis.

Valid parameters of RFCKT or RF data objects, specified as a character vector or string.

Type listparam(h) to get a list of valid parameters for a circuit object, h. Type listformat(h,circuitPara) to see the legitimate formats for a specified parameter. The first listed format is the default for the specified parameter.

Example: amp = rfckt.amplifier; plotyy(amp,'S11',S12') Plots the parameters, S11 and S12 of the rfckt.amplifier on the left and right Y-axis.

Independent variables to plot with the circuit parameters, circuitPara, values specified in the table given. This table shows the circuitPara and their corresponding xAxisPara values. The function uses the default values listed in the table if you do not specify xAxisPara.

circuitPara ValuexAxisPara Value
Pout, Phase, LS11, LS12, LS21, LS22Pin (default), Freq
S11, S12, S21, S22, NF, IIP3, OIP3, GroupDelay, VSWRIn, VSWROut, GammaIn, GammaOut, FMIN, GammaOPT, RN, TF1, TF2, Gt, Ga, Gp, Gmag, Gmsg, GammaMS, GammaML, K, Delta, Mu, MuPrimeFreq
AM/AM, AM/PMAM

Derive xAxisPara for the RFCKT or RF data object h using the listparam(h) command.

xAxisPara format, specified as a character vector or string scalar. You do not need to specify xAxisFmt when xAxisPara is an operating condition.

This table shows the xAxisPara and their corresponding xAxisFmt values. The function uses the default values listed in the table if you do not specify xAxisFmt .

xAxisPara ValuexAxisFmt Value
PindBm (default), mW, W, dBW
Freq

THz, GHz, MHz, KHz, Hz

By default, xAxisFmt is chosen to provide the best scaling for the given xAxisPara values.

AMMagnitude (decibels) (default), Magnitude (linear)

Derive xAxisFmt for the RFCKT or RF data object h using the listformat(h,'xAxisPara') command.

Example: plotyy(h,'Pout','Pin','mW') plots data on a X-Y plane for circuit object, h, with xAxisPara set to 'Pin' and xAxisFmt set to 'mW'.

Operating conditions derived from a P2D or S2D file, specified as a string scalar or a character vector.

For some circuit parameters, you can specify a set of frequency or input power values at which the function plots the specified parameter.

For example:

  • When plotting large-signal S-parameters as a function of input power, you can specify frequency points of interest using opCon and opVal arguments.

  • When plotting large-signal S-parameters as a function of frequency, you can specify input power levels of interest using opCon and opVal arguments.

  • When plotting parameters as a function of an operating condition, you can specify both frequency and input power values using opCon and opVal arguments.

Enter the getop(h) command at the command line to get the operating conditions for the RF circuit object h.

Value of the operating conditions in the opCon argument, specified as a scalar.

Example: plotyy(h,'Pout','Pin','mW','bias',1.5) plots the data on a X-Y plane for circuit object, h, with opCon set to 'bias' and value set to 1.5.

Parameter format to plot on left Y-axis, specified as a character vector or string.

Parameter format to plot on right Y-axis, specified as a character vector or string.

Name-Value Arguments

Example: plotyy(h,'Pout','Pin','Freq',2.1e9)

Specify optional comma-separated pairs of Name,Value pair arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (''). You can specify several name and value pair arguments in any order as Name1, Value1, ..., NameN, ValueN.

Frequency value at which to plot the specified parameters, specified as a positive scalar in Hz.

Input power level at which to plot the specified parameters, specified as a positive scalar in dBm.

Output Arguments

collapse all

Axes handles, returned as a column vector of function handles.

lineseries object for left y-axis, returned as a column vector of object handles.

lineseries object for right y-axis, returned as a column vector of object handles.

Tips

Version History

Introduced in R2007a