This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

plotyy

Plot specified parameters on X-Y plane with Y-axes on both left and right sides

Syntax

plotyy(rfobject,parameter)
plotyy(rfobject,parameter1,....,parameterN)
plotyy(rfobject,parameter,format1,format2)
plotyy(rfobject,parameter1....parametern,format1,format2)
plotyy(rfobject,(parameter1_1,.....parameter1_n),format1,(parameter2_1.......,parameter2_n),format1,format2)
plotyy(___,x-axis parameter,x-axis format)
plotyy(___,Name,Value)
[ax,hlines1,hlines2] = plotyy(___)

Description

plotyy(rfobject,parameter) plots the specified parameter of the specified rfckt object or rfdata object on the X-Y plane using predefined formats. The formats define how RF Toolbox™ displays the data on the plot. For example, when you plot S-parameters using plotyy, 'dB' is-plotted on the left Y-axis and 'Degrees' is plotted on the right Y-axis.

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

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.

example

plotyy(rfobject,parameter1,....,parameterN) plots the parameters, 1,...,N on the X-Y plane using the predefined primary and secondary formats.

plotyy(rfobject,parameter,format1,format2) plots the specified parameter using format 1 for the left Y-axis and format 2 for the right Y-axis.

plotyy(rfobject,parameter1....parametern,format1,format2) plots the parameters, 1,...,N using format 1 for left Y-axis and format 2 for right Y-axis.

plotyy(rfobject,(parameter1_1,.....parameter1_n),format1,(parameter2_1.......,parameter2_n),format1,format2) plots RF data as follows:

  • Plot parameters 1_1,.....1_n using format 1 for the left Y-axis.

  • Plot parameters 2_1,.....2_n using format 2 for the right Y-axis.

plotyy(___,x-axis parameter,x-axis format) plots the specified parameters under specified operating conditions for the RF object.

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

[ax,hlines1,hlines2] = plotyy(___) returns the handles to the two 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')

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')

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')

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')

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.

Input Arguments

collapse all

Circuit or data object, specified as rfckt object or rfdata object.

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 circuit objects, specified as a character vector or string.

Type listparam(rfobject) to get a list of valid parameters for a circuit object, h. Type listformat(rfobject,parameter) 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.

Format of the parameter to plot on left Y-axis, specified as a character vector or string.

Format of the parameter to plot on right Y-axis, specified as a character vector or string.

x-axis parameter is the independent variable along the x axis to plot the specified parameters along y axis. Several x-axis parameter values are available for all objects. When you import rfckt.amplifier, rfckt.mixer, or rfdata.data object specifications from a .p2d or .s2d file, you can also specify any operating conditions from the file that have numeric values, such as bias.

The following table shows the most commonly available parameters and the corresponding x-axis parameter values. The default settings listed in the table are used if x-axis parameter is not specified.

parameterx-axis parameter 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

x-axis format is the format used for the specific x-axis parameter. No x-axis format specification is needed when x-axis parameter is an operating condition.

The following table shows the x-axis format values that are available for the x-axis parameter values listed in the preceding table, along with the default settings that are used if x-axis format is not specified.

x-axis parameter valuesx-axis format values
PindBm (default), mW, W, dBW
Freq

THz, GHz, MHz, KHz, Hz

By default, x-axis format is chosen to provide the best scaling for the given x-axis parameter values.

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

Example: semilogy(h,'Pout','Freq','GHz')

Name-Value Pair Arguments

Example: semilogy(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.

'condition1',value1, ..., conditionm,valuem are the optional condition/value pairs at which to plot the specified parameters. These pairs are usually operating conditions from a .p2d or .s2d file. For some parameters, you can specify a set of frequency or input power values at which to plot 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 condition/value pairs.

  • When plotting large-signal S-parameters as a function of frequency, you can specify input power levels of interest using condition/value pairs.

  • When plotting parameters as a function of an operating condition, you can specify both frequency and input power values using condition/value pairs.

Freq is the optional frequency value, in Hz, at which to plot the specified parameters.

Pin is the optional input power value, in dBm, at which to plot the specified parameters.

Output Arguments

collapse all

Handles of two axis, left and right, returned as a function handle.

lineseries object for left y-axis, left and right, returned as a function handle.

lineseries object for right y-axis, left and right, returned as a function handle.

Tips

Introduced in R2007a