Plots a function by sweeping one variable and optionally stepping another. The function to be plotted depends on the arguments 'yVar' and 'funcType': - If funcType == 'params', the variable 'yVar' must be the name of a circuit parameter, or a list with circuit parameters. -
(fileName, title, results, sweepStart, sweepStop, sweepNum,
sweepVar = 'auto', sweepScale = '', xVar = 'auto', xScale = '',
xUnits = '', xLim = [], yLim = [], axisType = 'auto',
funcType = 'auto', yVar = 'auto', yScale = '', yUnits = '',
noiseSources = None, show = False, save = True)
| 433 | return |
| 434 | |
| 435 | def plotSweep(fileName, title, results, sweepStart, sweepStop, sweepNum, |
| 436 | sweepVar = 'auto', sweepScale = '', xVar = 'auto', xScale = '', |
| 437 | xUnits = '', xLim = [], yLim = [], axisType = 'auto', |
| 438 | funcType = 'auto', yVar = 'auto', yScale = '', yUnits = '', |
| 439 | noiseSources = None, show = False, save = True): |
| 440 | """ |
| 441 | Plots a function by sweeping one variable and optionally stepping another. |
| 442 | |
| 443 | The function to be plotted depends on the arguments 'yVar' and 'funcType': |
| 444 | |
| 445 | - If funcType == 'params', the variable 'yVar' must be the name of a circuit |
| 446 | parameter, or a list with circuit parameters. |
| 447 | - If funcType == 'auto', the default function that will be plotted depends |
| 448 | on the data type of the instruction: |
| 449 | |
| 450 | - data type == 'noise': funcType = 'onoise' |
| 451 | - data type == 'laplace', 'numer' or 'denom': funcType = 'mag' |
| 452 | - data type == 'time', 'impulse' or 'step': funcType = 'time' |
| 453 | |
| 454 | The variable plotted along the x-axis defaults to the sweep variable. However, |
| 455 | for multivariate functions obtained with data type 'params', the x variable |
| 456 | can be choosen from all circuit parameters. |
| 457 | |
| 458 | - If sweepVar == 'auto', the sweep variable will be determined from the data type: |
| 459 | |
| 460 | - data type == 'noise', 'laplace', 'numer' or 'denom': sweepVar = ini.frequency |
| 461 | for data types 'laplace', 'numer' or 'denom' the laplace variable will |
| 462 | be replaced with sympy.i*ini.frequency or with 2*sympy.pi*sympy.i*ini.frequency |
| 463 | before sweeping, when ini.frequency == False, or ini.frequency== True, respectively. |
| 464 | - dataType == 'time', 'impulse' or 'step': sweepVar = sympy.Symbol('t') |
| 465 | |
| 466 | The type of axis can be 'lin', 'log', 'semilogx', 'semilogy' or 'polar'. |
| 467 | |
| 468 | :param fileName: Name of the file for saving it to disk. |
| 469 | :type fileName: str |
| 470 | |
| 471 | :param title: Title of the figure. |
| 472 | :type title: str |
| 473 | |
| 474 | :param results: Results of the execution of an instruction, or a list with |
| 475 | SLiCAPinstruction.instruction objects. |
| 476 | :type results: list, SLiCAPinstruction.instruction |
| 477 | |
| 478 | :param sweepStart: Start value of the sweep parameter |
| 479 | :type sweepStart: float, int, str |
| 480 | |
| 481 | :param sweepStop: Stop value of the sweep parameter |
| 482 | :type sweepStop: float, int, str |
| 483 | |
| 484 | :param sweepNum: Number of points of the sweep parameter |
| 485 | :type sweepNum: int |
| 486 | |
| 487 | :param sweepVar: Name of the sweep variable |
| 488 | :type sweepVar: sympy.Symbol, str |
| 489 | |
| 490 | :param sweepScale: Scale factor of the sweep variable. Both the start and |
| 491 | the stop value will be multiplied with a factor that |
| 492 | corresponds with this scale factor. |
nothing calls this directly
no test coverage detected