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 theanalyzefunction before usingplotyy.

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

Determining Parameter Formatstable lists primary and secondary formats for the all RFCKT or RF data object parameters. You can also uselistformatto 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:

  • PlotcircuitPara1_1usingformat1in the left Y-axis.

  • PlotcircuitPara2_1usingformat2in the right Y-axis.

example

plotyy(___,xAxisPara,xAxisFmt,opCon,opVal)plots the circuit parameterscircuitParaon a X-Y plane with the variablesxAxisPara, their corresponding formatxAxisFmt, operating conditionsopCon, and operating valuesopValfor the RFCKT or RF data objecth.

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;

PlotS11andS21parameters of the amplifier on twoy-axis.

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

图包含2轴对象。坐标轴对象1续ains 2 objects of type line. These objects represent dB(S_{11}), dB(S_{21}). Axes object 2 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 areMagnitude(decibels)andAngle(degrees). respectively. So, theplotyyuses this primary-secondary format pair to create the plot.

Plot theS11andNF(noise figure) parameters of the amplifier on twoy-axis.

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

图包含2轴对象。坐标轴对象1续ains 2 objects of type line. These objects represent dB(S_{11}), NF [dB]. Axes object 2 contains an object of type line. This object represents Deg(S_{11}).

The primary and secondary formats forS11areMagnitude (decibels)andAngle (degrees), respectively.

  • Magnitude (decibels)is a valid format for bothS11andNF

  • Angle (Degrees)is a valid format forS11.

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

Plot theNF,S21andGroupDelayparameters ofampon twoy-axis.

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

图包含2轴对象。坐标轴对象1续ains 2 objects of type line. These objects represent NF [dB], dB(S_{21}). Axes object 2 contains an object of type line. This object represents GroupDelay [ns].

The primary and secondary formats forS21areMagnitude (decibels)andAngle (Degrees), respectively. BothNFandGroupDelayhave only a primary format.

  • Magnitude (decibels)is the primary format forNF.

  • nsis the primary format forGroupDelay.

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

  • Magnitude (decibels)for the lefty-axis. This format is valid for bothNFandS21.

  • nsfor the righty-axis. This format is valid forGroupDelay.

These formats meet the criteria.

Plot theNFactorandKparameters ofampon twoy-axis.

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

Figure contains an axes object. The axes object contains 2 objects of type line. These objects represent NFactor, K.

BothNFactorandKhave only a primary format,None, soplotyycalls theplotcommand to create a plot with a singley-axis whose format isNone.

创建一个放大器从指定的对象P2D file.

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

Plot the Pout, S11, and S22 of the amplifier with frequency is plotted inGHz将和偏见1.5v.

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

图包含2轴对象。坐标轴对象1续ains an object of type line. This object represents P_{out} [dBm](P_{in}=18[dBm];Bias=1.5). Axes object 2 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 asrfcktobject orrfdataobject. For complete list of RFCKT and RF data objects, seeRF Circuit ObjectsandRF Data Objects.

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

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

Typelistparam(h)to get a list of valid parameters for a circuit object,h. Typelistformat(h,circuitPara)to see the legitimate formats for a specifiedparameter. 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 therfckt.amplifieron the left and right Y-axis.

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

circuitParaValue xAxisParaValue
Pout,Phase,LS11,LS12,LS21,LS22 Pin(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,MuPrime Freq
AM/AM,AM/PM AM

DerivexAxisParafor the RFCKT or RF data objecthusing thelistparam(h)command.

xAxisParaformat, specified as a character vector or string scalar. You do not need to specifyxAxisFmtwhenxAxisParais an operating condition.

This table shows thexAxisParaand their correspondingxAxisFmtvalues. The function uses the default values listed in the table if you do not specifyxAxisFmt.

xAxisParaValue xAxisFmtValue
Pin dBm(default),mW,W,dBW
Freq

THz,GHz,MHz,KHz,Hz

By default,xAxisFmtis chosen to provide the best scaling for the givenxAxisParavalues.

AM Magnitude (decibels)(default),Magnitude (linear)

DerivexAxisFmtfor the RFCKT or RF data objecthusing thelistformat(h,'xAxisPara')command.

Example:plotyy(h,'Pout','Pin','mW')plots data on a X-Y plane for circuit object,h, withxAxisParaset to'Pin'andxAxisFmtset 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 usingopConandopValarguments.

  • When plotting large-signal S-parameters as a function of frequency, you can specify input power levels of interest usingopConandopValarguments.

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

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

Value of the operating conditions in theopConargument, 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, withopConset to'bias'andvalueset to1.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 ofName,Valuepair arguments.Nameis the argument name andValueis the corresponding value.Namemust appear inside single quotes (''). You can specify several name and value pair arguments in any order asName1, 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.

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

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

Tips

Version History

Introduced in R2007a