pyyeti.cla.mk_plots¶
- pyyeti.cla.mk_plots(res, *, event=None, issrs=True, Q='auto', drms=None, inc0rb=True, fmt='pdf', onepdf=True, layout=(2, 3), figsize=(11, 8.5), showall=None, showboth=False, cases=None, direc='srs_plots', tight_layout_args=None, legend_args=None, plot='plot', show_figures=False)[source]¶
Make SRS or response history plots
- Parameters:
res (
DR_Resultsinstance) – Subclass of dict containing categories with results (seeDR_Results). For example,results['SC_atm'].ext.event (string or None; optional) – String for plot titles and file names (eg: ‘Liftoff’). If None, event is determined from res[drm].event.
issrs (bool; optional) – True if plotting SRS data; False otherwise.
Q (scalar or iterable or ‘auto’; optional) – The Q value(s) to plot. If ‘auto’, all the Q values for each category are plotted. Must be a scalar if showall is True (see below).
drms (list of data recovery categories or None; optional) – Data recovery categories to plot. If None, plot all available. See also input inc0rb.
inc0rb (bool; optional) – If True, the ‘_0rb’ versions of each data recovery category are automatically included.
fmt (string or None; optional) – If fmt == “pdf”, all plots are written to one PDF file, unless onepdf is set to False. If fmt is some other string, it is used as the format parameter in
matplotlib.figure.Figure.savefig(). If None, no figures will be saved. Typical values for fmt are (fromfig.canvas.get_supported_filetypes()):'eps': 'Encapsulated Postscript', 'jpeg': 'Joint Photographic Experts Group', 'jpg': 'Joint Photographic Experts Group', 'pdf': 'Portable Document Format', 'pgf': 'PGF code for LaTeX', 'png': 'Portable Network Graphics', 'ps': 'Postscript', 'raw': 'Raw RGBA bitmap', 'rgba': 'Raw RGBA bitmap', 'svg': 'Scalable Vector Graphics', 'svgz': 'Scalable Vector Graphics', 'tif': 'Tagged Image File Format', 'tiff': 'Tagged Image File Format'
File naming conventions: if ‘SC_atm’ is a category, then example output filenames could be:
'SC_atm_srs.pdf' 'SC_atm_eqsine.pdf' 'SC_atm_srs_0.png', 'SC_atm_srs_1.png', ... 'SC_atm_eqsine_0.png', 'SC_atm_eqsine_1.png', ...
onepdf (bool or string; optional) – If onepdf evaluates to True and fmt is ‘pdf’, all plots are written to one PDF file where the name is:
onepdf
PDF file name
string
All plots saved in: onepdf + “.pdf”
True
If issrs: all plots saved in: event + “_srs.pdf”
True
If not issrs: all plots saved in: event + “_??.pdf”, where “??” is either ‘hist’, ‘psd’, or ‘frf’ as appropriate.
If False, each figure is saved to its own file named as described above (see fmt).
layout (2-element tuple/list; optional) – Subplot layout, eg: (2, 3) for 2 rows by 3 columns. See also figsize.
figsize (2-element tuple/list; optional) – Define page size in inches. See also layout.
showall (bool or None; optional) – If True, show all SRS curves for all cases; otherwise just plot envelope. If None and showboth is True, showall is set to True.
showboth (bool; optional) – If True, shows all SRS curves and the envelope; otherwise just plot which ever showall indicates.
direc (string; optional) – Directory name to put all output plot files; will be created if it doesn’t exist.
cases (tuple/list of case names to plot or None; optional) – If None, all cases are plotted. This option is ignored if plotting SRS curves and showall is True.
tight_layout_args (dict or None; optional) – Arguments for
matplotlib.figure.Figure.tight_layout(). If None, defaults to:{ "pad": 3.0, "w_pad": 2.0, "h_pad": 2.0, "rect": (0.3 / figsize[0], 0.3 / figsize[1], 1.0 - 0.3 / figsize[0], 1.0 - 0.3 / figsize[1]), }
legend_args (dict or None; optional) – Arguments for
matplotlib.figure.Figure.legend()ormatplotlib.axes.Axes.legend(). The internally set arguments for the legend call depend on showall and issrs. If issrs is False and/or showall is True, legend_args defaults to:{ "loc": "upper right", "bbox_to_anchor": (lx, ly), "fontsize": "small", "framealpha": 0.5, }
If issrs is True and showall is False (only plotting SRS envelopes):
{ "loc": "best", "fontsize": "small", "framealpha": 0.5, "fancybox": True, }
If legend_args is a dictionary, it will update those default settings.
plot (string; optional) – The name of a function in
matplotlib.axes.Axesthat will draw each curve. Defaults to “plot”. Common options:plot
“plot”
“loglog”
“semilogx”
“semilogy”
show_figures (bool; optional) – If True, plot figures will be displayed on the screen for interactive viewing. Warning: there may be many figures.
Notes
Set the onepdf parameter to a string to specify the name of the PDF file.
Used by
DR_Results.srs_plots()andDR_Results.resp_plots()for plot generation.