psy-simple psyplot plugin
This module defines the rcParams for the psy-simple plugin.
Classes:
|
An enumeration. |
|
|
|
|
|
An enumeration. |
|
|
|
A validation class for formatoptions that expect dictionaries as values |
|
|
|
An enumeration. |
|
|
|
|
|
Validate a list of the specified dtype |
|
An enumeration. |
Functions:
|
|
|
Patch psy_simple plotters for versions smaller than 1.0 |
|
Apply multiple validation functions |
|
Validate an alpha value between 0 and 1 |
|
Validate a dictionary containing axiscolor definitions |
|
|
|
Validate a colorbar position |
|
Validate a colormap |
|
Validate a dictionary of color lists |
|
|
|
Validation function for the |
convert s to float or raise |
|
|
|
|
Validate that the given value is an iterable |
|
|
|
|
|
Validate the value for the LinePlotter.plot formatoption |
|
Does not really make a validation because markers can be quite of different types |
Validate that None is given |
|
|
|
|
Validate a string |
|
|
|
Validate a text formatoption |
|
Data:
patches to apply when loading a project |
- class psy_simple.plugin.BoundsMethod(value)
Bases:
strEnum
An enumeration.
Attributes:
- data = 'data'
- log = 'log'
- mid = 'mid'
- minmax = 'minmax'
- rounded = 'rounded'
- roundedsym = 'roundedsym'
- sym = 'sym'
- symlog = 'symlog'
- class psy_simple.plugin.BoundsType(method: psy_simple.plugin.BoundsMethod, N: int = None, percmin: float = 0, percmax: float = 100, vmin: float = None, vmax: float = None)
Bases:
object
Attributes:
- method: BoundsMethod
- class psy_simple.plugin.BoundsValidator(type, default='rounded', possible_instances=None)
Bases:
object
Methods:
instance_check
(val)- instance_check(val)
- class psy_simple.plugin.CTicksMethod(value)
Bases:
strEnum
An enumeration.
Attributes:
- bounds = 'bounds'
- data = 'data'
- log = 'log'
- mid = 'mid'
- midbounds = 'midbounds'
- minmax = 'minmax'
- rounded = 'rounded'
- roundedsym = 'roundedsym'
- sym = 'sym'
- symlog = 'symlog'
- class psy_simple.plugin.CTicksType(method: psy_simple.plugin.CTicksMethod, N: int = None, percmin: float = 0, percmax: float = 100, vmin: float = None, vmax: float = None)
Bases:
BoundsType
Attributes:
- method: CTicksMethod
- class psy_simple.plugin.DictValValidator(key, valid, validators, default, ignorecase=False)
Bases:
object
A validation class for formatoptions that expect dictionaries as values
- class psy_simple.plugin.LineWidthValidator(key, valid, ignorecase=False, *, _deprecated_since=None)
Bases:
ValidateInStrings
- class psy_simple.plugin.TicksMethod(value)
Bases:
strEnum
An enumeration.
Attributes:
- data = 'data'
- day = 'day'
- hour = 'hour'
- log = 'log'
- mid = 'mid'
- minmax = 'minmax'
- month = 'month'
- monthbegin = 'monthbegin'
- monthend = 'monthend'
- rounded = 'rounded'
- roundedsym = 'roundedsym'
- sym = 'sym'
- symlog = 'symlog'
- week = 'week'
- year = 'year'
- yearbegin = 'yearbegin'
- yearend = 'yearend'
- class psy_simple.plugin.TicksType(method: psy_simple.plugin.TicksMethod, N: int = None, percmin: float = 0, percmax: float = 100, vmin: float = None, vmax: float = None)
Bases:
BoundsType
Attributes:
- method: TicksMethod
- class psy_simple.plugin.TicksValidator(key, valid, ignorecase=False, *, _deprecated_since=None)
Bases:
ValidateInStrings
- class psy_simple.plugin.ValidateList(dtype=None, length=None, listtype=<class 'list'>)
Bases:
object
Validate a list of the specified dtype
Attributes:
data type (e.g.
float
) used for the conversion.
- psy_simple.plugin.get_versions(requirements=True)
- psy_simple.plugin.patch_prior_1_0(plotter_d, versions)
Patch psy_simple plotters for versions smaller than 1.0
Before psyplot 1.0.0, the plotters in the psy_simple package where part of the psyplot.plotter.simple module. This has to be corrected
- psy_simple.plugin.patches = {('psyplot.plotter.simple', 'BarPlotter'): <function patch_prior_1_0>, ('psyplot.plotter.simple', 'CombinedSimplePlotter'): <function patch_prior_1_0>, ('psyplot.plotter.simple', 'DensityPlotter'): <function patch_prior_1_0>, ('psyplot.plotter.simple', 'DensityRegPlotter'): <function patch_prior_1_0>, ('psyplot.plotter.simple', 'LinRegPlotter'): <function patch_prior_1_0>, ('psyplot.plotter.simple', 'LinePlotter'): <function patch_prior_1_0>, ('psyplot.plotter.simple', 'Simple2DPlotter'): <function patch_prior_1_0>, ('psyplot.plotter.simple', 'SimplePlotterBase'): <function patch_prior_1_0>, ('psyplot.plotter.simple', 'SimpleVectorPlotter'): <function patch_prior_1_0>, ('psyplot.plotter.simple', 'ViolinPlotter'): <function patch_prior_1_0>}
patches to apply when loading a project
- psy_simple.plugin.rcParams = {'colors.cmaps': {}, 'plotter.bar.alpha': 1.0, 'plotter.bar.categorical': None, 'plotter.bar.coord': None, 'plotter.bar.plot': 'bar', 'plotter.bar.widths': 'equal', 'plotter.baseplotter.background': 'rc', 'plotter.baseplotter.figtitle': '', 'plotter.baseplotter.figtitleprops': {}, 'plotter.baseplotter.figtitlesize': 12.0, 'plotter.baseplotter.figtitleweight': None, 'plotter.baseplotter.mask': None, 'plotter.baseplotter.maskbetween': None, 'plotter.baseplotter.maskgeq': None, 'plotter.baseplotter.maskgreater': None, 'plotter.baseplotter.maskleq': None, 'plotter.baseplotter.maskless': None, 'plotter.baseplotter.text': [], 'plotter.baseplotter.tight': False, 'plotter.baseplotter.title': '', 'plotter.baseplotter.titleprops': {}, 'plotter.baseplotter.titlesize': 'large', 'plotter.baseplotter.titleweight': None, 'plotter.combinedsimple.plot': 'mesh', 'plotter.combinedsimple.vbounds': [BoundsMethod.rounded, None, 0.0, 100.0, None, None], 'plotter.combinedsimple.vcbar': {'b'}, 'plotter.combinedsimple.vcbarspacing': 'uniform', 'plotter.combinedsimple.vclabel': '', 'plotter.combinedsimple.vclabelprops': {}, 'plotter.combinedsimple.vclabelsize': 'medium', 'plotter.combinedsimple.vclabelweight': None, 'plotter.combinedsimple.vcmap': 'white_blue_red', 'plotter.combinedsimple.vcticklabels': None, 'plotter.combinedsimple.vctickprops': {}, 'plotter.combinedsimple.vcticks': None, 'plotter.combinedsimple.vcticksize': 'medium', 'plotter.combinedsimple.vctickweight': None, 'plotter.combinedsimple.vplot': 'quiver', 'plotter.density.bins': 10, 'plotter.density.coord': None, 'plotter.density.density': 'hist', 'plotter.density.normed': None, 'plotter.density.precision': 0.0, 'plotter.density.xrange': ('minmax', 'minmax'), 'plotter.density.yrange': ('minmax', 'minmax'), 'plotter.fldmean.err_calc': 'std', 'plotter.fldmean.mean': 'mean', 'plotter.line.coord': None, 'plotter.line.error': 'fill', 'plotter.line.erroralpha': 0.15, 'plotter.line.linewidth': None, 'plotter.line.marker': None, 'plotter.line.markersize': None, 'plotter.line.plot': '-', 'plotter.plot2d.bounds': [BoundsMethod.rounded, None, 0.0, 100.0, None, None], 'plotter.plot2d.cbar': {'b'}, 'plotter.plot2d.cbarspacing': 'uniform', 'plotter.plot2d.clabel': '', 'plotter.plot2d.clabelprops': {}, 'plotter.plot2d.clabelsize': 'medium', 'plotter.plot2d.clabelweight': None, 'plotter.plot2d.cmap': 'white_blue_red', 'plotter.plot2d.cticklabels': None, 'plotter.plot2d.ctickprops': {}, 'plotter.plot2d.cticks': None, 'plotter.plot2d.cticksize': 'medium', 'plotter.plot2d.ctickweight': None, 'plotter.plot2d.datagrid': None, 'plotter.plot2d.extend': 'neither', 'plotter.plot2d.interp_bounds': None, 'plotter.plot2d.levels': None, 'plotter.plot2d.mask_datagrid': True, 'plotter.plot2d.miss_color': None, 'plotter.plot2d.plot': 'mesh', 'plotter.plot2d.plot.min_circle_ratio': 0.05, 'plotter.simple.axiscolor': {'bottom': None, 'left': None, 'right': None, 'top': None}, 'plotter.simple.color': None, 'plotter.simple.grid': False, 'plotter.simple.labelprops': {'x': {}, 'y': {}}, 'plotter.simple.labelsize': {'x': 'medium', 'y': 'medium'}, 'plotter.simple.labelweight': {'x': None, 'y': None}, 'plotter.simple.legend': {'loc': 1}, 'plotter.simple.legendlabels': '%(arr_name)s', 'plotter.simple.sym_lims': [None, None], 'plotter.simple.ticksize': {'major': 'medium'}, 'plotter.simple.tickweight': {'major': None}, 'plotter.simple.transpose': False, 'plotter.simple.xlabel': '', 'plotter.simple.xlim': ('rounded', 'rounded'), 'plotter.simple.xrotation': 0.0, 'plotter.simple.xticklabels': {'major': None}, 'plotter.simple.xtickprops': {'major': {}, 'minor': {}}, 'plotter.simple.xticks': {'major': None, 'minor': None}, 'plotter.simple.ylabel': '', 'plotter.simple.ylim': ('rounded', 'rounded'), 'plotter.simple.yrotation': 0.0, 'plotter.simple.yticklabels': {'major': None}, 'plotter.simple.ytickprops': {'major': {}, 'minor': {}}, 'plotter.simple.yticks': {'major': None, 'minor': None}, 'plotter.vector.arrowsize': None, 'plotter.vector.arrowstyle': '-|>', 'plotter.vector.color': 'k', 'plotter.vector.density': 1.0, 'plotter.vector.linewidth': None, 'plotter.vector.plot': 'quiver', 'plotter.violin.plot': True, 'project.plotters': {'barplot': {'default_slice': None, 'module': 'psy_simple.plotters', 'plotter_name': 'BarPlotter', 'plugin': 'psy_simple.plugin', 'prefer_list': True, 'summary': 'Make a bar plot of one-dimensional data'}, 'combined': {'default_dims': {'x': slice(None, None, None), 'y': slice(None, None, None)}, 'default_slice': 0, 'example_call': "filename, name=[['my_variable', ['u_var', 'v_var']]], ...", 'module': 'psy_simple.plotters', 'plotter_name': 'CombinedSimplePlotter', 'plugin': 'psy_simple.plugin', 'prefer_list': True, 'summary': 'Plot a 2D scalar field with an overlying vector field'}, 'density': {'default_slice': None, 'module': 'psy_simple.plotters', 'plotter_name': 'DensityPlotter', 'plugin': 'psy_simple.plugin', 'prefer_list': False, 'summary': 'Make a density plot of point data'}, 'fldmean': {'default_slice': None, 'module': 'psy_simple.plotters', 'plotter_name': 'FldmeanPlotter', 'plugin': 'psy_simple.plugin', 'prefer_list': True, 'summary': 'Calculate and plot the mean over x- and y-dimensions'}, 'lineplot': {'default_slice': None, 'module': 'psy_simple.plotters', 'plotter_name': 'LinePlotter', 'plugin': 'psy_simple.plugin', 'prefer_list': True, 'summary': 'Make a line plot of one-dimensional data'}, 'plot2d': {'default_dims': {'x': slice(None, None, None), 'y': slice(None, None, None)}, 'default_slice': 0, 'module': 'psy_simple.plotters', 'plotter_name': 'Simple2DPlotter', 'plugin': 'psy_simple.plugin', 'prefer_list': False, 'summary': 'Make a simple plot of a 2D scalar field'}, 'simple': {'module': 'psy_simple.plotters', 'plot_func': False, 'plotter_name': 'SimplePlotterBase', 'plugin': 'psy_simple.plugin', 'summary': 'All plotters that are visualized by the psy-simple package'}, 'vector': {'default_dims': {'x': slice(None, None, None), 'y': slice(None, None, None)}, 'default_slice': 0, 'example_call': "filename, name=[['u_var', 'v_var']], ...", 'module': 'psy_simple.plotters', 'plotter_name': 'SimpleVectorPlotter', 'plugin': 'psy_simple.plugin', 'prefer_list': False, 'summary': 'Make a simple plot of a 2D vector field'}, 'violinplot': {'default_slice': None, 'module': 'psy_simple.plotters', 'plotter_name': 'ViolinPlotter', 'plugin': 'psy_simple.plugin', 'prefer_list': True, 'summary': 'Make a violin plot of your data'}}, 'texts.default_position': [1.0, 1.0], 'texts.delimiter': ', ', 'texts.labels': {'desc': '%(long_name)s [%(units)s]', 'dinfo': '%B %d, %Y', 'dtinfo': '%B %d, %Y. %H:%M', 'sdesc': '%(name)s [%(units)s]', 'tinfo': '%H:%M'}, 'ticks.which': 'major', 'widgets.colors.cmaps': ['viridis', 'Reds', 'Blues', 'Greens', 'binary', 'RdBu', 'coolwarm', 'red_white_blue', 'winter', 'jet', 'white_blue_red', 'gist_ncar', 'gist_earth', 'Paired', 'gnuplot', 'gnuplot2']}
the
RcParams
for the psy-simple plugin
- psy_simple.plugin.try_and_error(*funcs)
Apply multiple validation functions
- Parameters:
*funcs – Validation functions to test
- Return type:
function
- psy_simple.plugin.validate_alpha(val)
Validate an alpha value between 0 and 1
- psy_simple.plugin.validate_axiscolor(value)
Validate a dictionary containing axiscolor definitions
- Parameters:
value (dict) – see
psyplot.plotter.baseplotter.axiscolor
- Return type:
- Raises:
- psy_simple.plugin.validate_bool_maybe_none(value)
- psy_simple.plugin.validate_cbarpos(value)
Validate a colorbar position
- psy_simple.plugin.validate_cmap(val)
Validate a colormap
- Parameters:
val (str or
mpl.colors.Colormap
)- Return type:
str or
mpl.colors.Colormap
- Raises:
- psy_simple.plugin.validate_cmaps(cmaps)
Validate a dictionary of color lists
- Parameters:
cmaps (dict) – a mapping from a colormap name to a list of colors
- Raises:
ValueError – If one of the values in cmaps is not a color list
Notes
For all items (listname, list) in cmaps, the reversed list is automatically inserted with the
listname + '_r'
key.
- psy_simple.plugin.validate_dataarray(val)
- psy_simple.plugin.validate_err_calc(val)
Validation function for the
psy_simple.plotter.FldmeanPlotter.err_calc
formatoption
- psy_simple.plugin.validate_float(s)
convert s to float or raise
- Returns:
s converted to a float
- Return type:
- Raises:
- psy_simple.plugin.validate_fontweight(value)
- psy_simple.plugin.validate_iter(value)
Validate that the given value is an iterable
- psy_simple.plugin.validate_legend(value)
- psy_simple.plugin.validate_limits(value)
- psy_simple.plugin.validate_lineplot(value)
Validate the value for the LinePlotter.plot formatoption
- Parameters:
value (None, str or list with mixture of both) – The value to validate
- psy_simple.plugin.validate_marker(val)
Does not really make a validation because markers can be quite of different types
- psy_simple.plugin.validate_none(b)
Validate that None is given
- Parameters:
b ({None, 'none'}) – None or string (the case is ignored)
- Return type:
None
- Raises:
- psy_simple.plugin.validate_plot(val)
- psy_simple.plugin.validate_sym_lims(val)
- psy_simple.plugin.validate_text(value)
Validate a text formatoption
- Parameters:
value (see
psyplot.plotter.labelplotter.text
)- Raises:
- psy_simple.plugin.validate_ticklabels(value)