WigglePlotter¶
- class marxs.design.tolerancing.WigglePlotter[source] [edit on github]¶
Bases:
object
Object to plot results of tolerancing simulations
This class combines the
load_and_plot
andplot_wiggle
functions with reasonable defaults for the plot appearance.Attributes Summary
Default background colors for wiggle overview plots.
Label for the right axis of the plot
Label for the left axis of the plot
Methods Summary
load_and_plot
(filename[, parlist])Load a table with wiggle results and make default plot
plot_one_line
(ax, axt, key, g, x)plot_wiggle
(tab, par, parlist, ax[, axt, ...])Plotting function for overview plot wiggeling 1 dof at the time.
Attributes Documentation
- bg_colors = {'global': '0.9', 'individual': (1.0, 0.9, 0.9)}¶
Default background colors for wiggle overview plots.
If the key of the dict matches part of the filename, the color listed in the dict is applied.
- y2label = 'right label (dotted lines)'¶
Label for the right axis of the plot
- ylabel = 'left label (solid lines)'¶
Label for the left axis of the plot
Methods Documentation
- load_and_plot(filename, parlist=['dx', 'dy', 'dz', 'rx', 'ry', 'rz'], **kwargs)[source] [edit on github]¶
Load a table with wiggle results and make default plot
This is a function to generate a quicklook image with many hardcoded defaults for figure size, colors etc. In particular, this function is written for the display of 6d plots which vary 6 degrees of freedom, one at a time.
The color for the background in the plot is set depending on the filename using the
string : color
assignments inwiggle_plot_facecolors
. No fancy regexp based match is applied, this is simply a check within
.- Parameters:
- filenamestring
Path to a file with data that can be plotted by
plot_wiggle
.- parlistlist of strings
Name of all parameters in
table
. This function only plots six of them.
- Returns:
- tab
astropy.table.Table
Table of data read from
filename
- fig
matplotlib.figure.Figure
Figure with plot.
- kwargs
All other parameters are passed to
plot_wiggle
.
- tab
- plot_one_line(ax, axt, key, g, x)[source] [edit on github]¶
- plot_wiggle(tab, par, parlist, ax, axt=None, axes_facecolor='w', **kwargs)[source] [edit on github]¶
Plotting function for overview plot wiggeling 1 dof at the time.
For parameters starting with “d” (e.g. “dx”, “dy”, “dz”), the plot axes will be labeled as a shift, for parameters tarting with “r” as rotation.
- Parameters:
- table
astropy.table.Table
Table with wiggle results
- parstring
Name of parameter to be plotted
- parlistlist of strings
Name of all parameters in
table
- ax
matplotlib.axes.Axes
Axis object to plot into.
- axt
None
ormatplotlib.axes.Axes
If this is
None
, twin axis are created to show resolving power and effective area in one plot. Alternatively, a second axes instance can be given here.- R_colstring
Column name in
tab
that hold the resolving power to be plotted. Default is set to work withmarxs.design.tolerancing.CaptureResAeff
.- Aeff_colstring
Column name in
tab
that hold the effective area to be plotted. Default is set to work withmarxs.design.tolerancing.CaptureResAeff
.- axes_facecolorany matplotlib color specification
Color for the background in the plot.
- table