Plotting Fucntions

Fucntions to plot permittivity and permeability results and S-parameters.

permittivitycalc.permittivity_plot.make_plot(xval, yval, plot_type='d', y_axis_type='normal', legend_label=None, name=None, plot_title=None, ylabel=None, xlabel=None, xticks=None, yticks=None, figure_size=(16, 10), freq_cutoff=None, publish=False)[source]

Takes input from sparam_data and plots calculated permittivity. Can handle multiple data sets. Plots uncertainty countour if plotting single dataset with uncertainty present and plots error bars every 25 points when plotting multiple datasets.

Parameters:
  • xval (array or list) – x-axis data. Multiple data sets must be in a list.
  • yval (array or list) – y-axis data. Multiple data sets must be in a list.
  • plot_type (str) – Flag for default plot types. Can be set to ‘d’ for the real part of epsilon, ‘lf’ for the imaginary part of epsilon, ‘lt’ for dielectric loss tangent, ‘ur’ for the real part of mu, ‘ui’ for the imaginary part of mu, or ‘c’ for Custom. If ‘c’ is used, xticks and yticks must be provided.
  • y_axis_type (str, optional) – Flag for type of axis to use for the y-axis. Can be either ‘normal’ (default) or ‘log’ for a log axis. If set to log, y tick postions must be manually provided to yticks.
  • legend_label (list of str, optional) – Plot legend label. Each dataset much have it’s own label. Stings must be in a list.
  • name (str, optional) – Required when publish=True. Used in file name of saved figure.
  • plot_title (str, optional) – For use when plot_type=’c’. Title of the plot.
  • ylabel (str, optional) – For use when plot_type=’c’. Y-axis label.
  • xlabel (str, optional) – For use when plot_type=’c’. X-axis label.
  • xticks (list, optional) – Manually set x-axis tick locations. Required when plot_type=’c’.
  • yticks (list, optional) – Manually set y-axis tick locations. Required when plot_type=’c’ and when y_axis_type=’log’.
  • figure_size (tuple or int, optional) – Set the matplotlib figsize. Default: (16,10).
  • freq_cutoff (float, optional) – Data points lower than freq_cutoff will not be plotted.
  • publish (bool, optional) – If True save figure as .eps file. Default: False.
permittivitycalc.permittivity_plot.make_sparam_plot(freq, s11, s22, s21, s12, label=None, shorted=False, s11_short=None)[source]

Plot raw S-Parameter data from S_Param_Script_V5. Supports multiple datasets for comparisson. Multilple datasets much be stored in a list and muct have same frequency array and number of data points.

Parameters:
  • freq (array) – Frequency points.
  • s11,s22,s21,s12 (array or list of arrays) – Mag and Phase S-Parameter data.
  • label (list, optional) – List of labels. Default: None