simetrix.plotData

simetrix.plotData(ydata: ArrayLike, xdata: ArrayLike, ylabel: str, xlabel: str, yphystype: PhysicalType | str = PhysicalType.UNKNOWN, xphystype: PhysicalType | str = PhysicalType.UNKNOWN, yaxisoption: AxisOptions = AxisOptions.LINEAR, xaxisoption: AxisOptions = AxisOptions.LINEAR) PlotReturnData

Creates a SIMetrix graph from the given X & Y data. The curve will be added to the current graph sheet if present. If there are no graph windows open, a new graph sheet will be created.

Parameters:
  • ydata (float or complex array) – Y data providing the y-axis values. Data may be a numPy array or Python list of real or complex values. If complex data is provided, the magnitude of the data will be plotted on the graph, but the complex values will be retained within the curve’s data.

  • xdata (float array) – X data providing x-axis values. Data may be a numPy array or Python list of real values.

  • ylabel (str) – String defines the label used for the y-axis and the curve itself.

  • xlabel (str) – String defines the label used for the x-axis.

  • yunit (PhysicalType | str) – Defines the units used for the y-axis

  • xunit (PhysicalType | str) – Defines the units used for the x-axis

  • yoption (AxisOptions) – Defines linear or logarithmic y-axis

  • xoption (AxisOptions) – Defines linear or logarithmic x-axis

Examples

import simetrix as sx

ydata = [(-5.943112+0.0283819j),(-5.943057+0.0357305j),(-5.942968+0.0449816j),(-5.942828+0.0566276j),\
    (-5.942606+0.0712882j),(-5.942255+0.0897432j),(-5.941697+0.1129733j),(-5.940814+0.1422115j),\
    (-5.939415+0.179007j),(-5.937198+0.2253031j),(-5.933686+0.2835336j),(-5.928125+0.3567357j),\
    (-5.919322+0.4486815j),(-5.905401+0.5640158j),(-5.883411+0.7083817j),(-5.848743+0.8884801j),\
    (-5.794255+1.1119593j),(-5.709029+1.3869269j),(-5.576729+1.7207099j),(-5.373756+2.1172482j),\
    (-5.067953+2.5722812j),(-4.619714+3.0656445j),(-3.988967+3.5514037j),(-3.152072+3.9504157j),\
    (-2.128718+4.1556888j),(-1.006911+4.0621393j),(0.0584773+3.6182036j),(0.8907083+2.8707831j),\
    (1.3640257+1.966516j),(1.4616953+1.0978072j),(1.2792536+0.4193534j)]

freq = [10000,12589.254,15848.932,19952.623,\
    25118.864,31622.777,39810.717,50118.723,\
    63095.734,79432.823,100000,125892.54,\
    158489.32,199526.23,251188.64,316227.77,\
    398107.17,501187.23,630957.34,794328.23,\
    1000000,1258925.4,1584893.2,1995262.3,\
    2511886.4,3162277.7,3981071.7,5011872.3,\
    6309573.4,7943282.3,10000000]

plotData = sx.plotData(ydata, freq, \
    "VOUT_AC", "Freq", \
    sx.PhysicalType.VOLTS, sx.PhysicalType.HERTZ, \
    sx.AxisOptions.LOGARITHMIC, sx.AxisOptions.LOGARITHMIC)