Interactive helpers
When developing QC code interactively it is often useful to generate
plots. This module is a thin wrapper around the matplotlib.pyplot
module that generates the plot that you probably want as a glimpse
of a medsrtqc.core.Profile or medsrtqc.core.Trace.
These functions are most usefully invoked in a Jupyter Notebook
or similar environment. These functions require
matplotlib <https://matplotlib.org/> to be installed.
- medsrtqc.interactive.plot(x, fig=None, ax=None, vars=None, trace_attrs=None)
A convenience method that either calls
plot_profile()orplot_trace()depending on the class ofx.>>> from medsrtqc.core import Trace, Profile >>> from medsrtqc.interactive import plot >>> trace = Trace([1, 2, 4], adjusted=[2, 3, 5], pres=[0, 1, 2]) >>> plot(trace) >>> plot(Profile({'param1': trace}))
- medsrtqc.interactive.plot_trace(x, ax=None, trace_attrs=None)
Plot a
medsrtqc.core.Traceobject.- Parameters:
x – A
medsrtqc.core.Traceobjectax – An existing set of matplotlib
Axestrace_attrs – A subset tuple of
'value','adjusted'and/or'ajusted_error'. Plotting QC flags is not implemented yet.
- medsrtqc.interactive.plot_profile(x, fig=None, ax=None, vars=None, trace_attrs=None)
Plot a
medsrtqc.core.Profileobject.- Parameters:
x – A
medsrtqc.core.Profileobjectfig – An existing matplotlib
Figuresuch as that returned bymatplotlib.pyplot.subplots().ax – An existing set of matplotlib
Axesor array of these as returned bymatplotlib.pyplot.subplots().vars – An iterable of variables to plot or
Noneto plot them all.trace_attrs – Passed to
plot_trace().