Base formatoptions for psy-simple.
This module defines several formatoptions that are the basis for many matplotlib figures, such as axes title, figure title, etc.
Classes:
|
The background color for the matplotlib axes. |
|
Base class with formatoptions for plotting on an matplotlib axes |
|
Plot a figure title |
|
Mask the data where a certain condition is True |
|
Mask data points between two numbers |
|
Mask data points greater than or equal to a number |
|
Mask data points greater than a number |
|
Mask data points smaller than or equal to a number |
|
Mask data points smaller than a number |
|
Add text anywhere on the plot |
|
Abstract base class for formatoptions that provides a replace method |
|
Automatically adjust the plots. |
|
Show the title |
|
Plotter class for labels |
|
Base class for masking formatoptions |
Functions:
|
Function that returns a Formatoption class for modifying the fontsite |
|
Function that returns a Formatoption class for modifying the fontsite |
|
Function that returns a Formatoption class for modifying the fontweight |
- class psy_simple.base.BackgroundColor(key, plotter=None, index_in_list=None, additional_children=[], additional_dependencies=[], **kwargs)
Bases:
Formatoption
The background color for the matplotlib axes.
Possible types
- ‘rc’
to use matplotlibs rc params
- None
to use a transparent color
- color
Any possible matplotlib color
Methods:
get_fmt_widget
(parent, project)Get a widget to update the formatoption in the GUI
update
(value)Method that is call to update the formatoption on the axes
Attributes:
str
.str
.- get_fmt_widget(parent, project)
Get a widget to update the formatoption in the GUI
This method should return a QWidget that is loaded by the psyplot-gui when the formatoption is selected in the
psyplot_gui.main.Mainwindow.fmt_widget
. It should call theinsert_text()
method when the update text for the formatoption should be changed.- Parameters:
parent (psyplot_gui.fmt_widget.FormatoptionWidget) – The parent widget that contains the returned QWidget
project (psyplot.project.Project) – The current subproject (see
psyplot.project.gcp()
)
- Returns:
The widget to control the formatoption
- Return type:
PyQt5.QtWidgets.QWidget
- name = 'Background color of the plot'
str
. A bit more verbose name than the formatoption key to be included in the gui. If None, the key is used in the gui
- update(value)
Method that is call to update the formatoption on the axes
- Parameters:
value – Value to update
- class psy_simple.base.BasePlotter(data=None, ax=None, auto_update=None, project=None, draw=False, make_plot=True, clear=False, enable_post=False, **kwargs)
Bases:
TitlesPlotter
Base class with formatoptions for plotting on an matplotlib axes
Attributes:
The background color for the matplotlib axes.
Mask the data where a certain condition is True
Mask data points between two numbers
Mask data points greater than or equal to a number
Mask data points greater than a number
Mask data points smaller than or equal to a number
Mask data points smaller than a number
Automatically adjust the plots.
- background
The background color for the matplotlib axes.
Possible types
- ‘rc’
to use matplotlibs rc params
- None
to use a transparent color
- color
Any possible matplotlib color
- mask
Mask the data where a certain condition is True
This formatoption can be used to mask the plotting data based on another array. This array can be the name of a variable in the base dataset, or it can be a numeric array. Note that the data needs to be on exactly the same coordinates as the data shown here
Possible types
- None
Apply no mask
- str
The name of a variable in the base dataset to use.
dimensions that are in the given mask but not in the visualized base variable will be aggregated using
numpy.any()
if the given mask misses dimensions that are in the visualized data (i.e. the data of this plotter), we broadcast the mask to match the shape of the data
dimensions that are in mask and the base variable, but not in the visualized data will be matched against each other
- str
The path to a netCDF file that shall be loaded
- xr.DataArray or np.ndarray
An array that can be broadcasted to the shape of the data
- maskbetween
Mask data points between two numbers
Possible types
- float
The floating number to mask above
See also
- maskgeq
Mask data points greater than or equal to a number
Possible types
- float
The floating number to mask above
See also
- maskgreater
Mask data points greater than a number
Possible types
- float
The floating number to mask above
See also
- maskleq
Mask data points smaller than or equal to a number
Possible types
- float
The floating number to mask below
See also
- maskless
Mask data points smaller than a number
Possible types
- float
The floating number to mask below
See also
- tight
Automatically adjust the plots.
If set to True, the plots are automatically adjusted to fit to the figure limitations via the
matplotlib.pyplot.tight_layout()
function.Possible types
- bool
True for automatic adjustment
Warning
There is no update method to undo what happend after this formatoption is set to True!
- class psy_simple.base.Figtitle(key, plotter=None, index_in_list=None, additional_children=[], additional_dependencies=[], **kwargs)
Bases:
TextBase
,Formatoption
Plot a figure title
Set the title of the figure. You can insert any meta key from the
xarray.DataArray.attrs
via a string like'%(key)s'
. Furthermore there are some special cases:Strings like
'%Y'
,'%b'
, etc. will be replaced using thedatetime.datetime.strftime()
method as long as the data has a time coordinate and this can be converted to adatetime
object.'%(x)s'
,'%(y)s'
,'%(z)s'
,'%(t)s'
will be replaced by the value of the x-, y-, z- or time coordinate (as long as this coordinate is one-dimensional in the data)any attribute of one of the above coordinates is inserted via
axis + key
(e.g. the name of the x-coordinate can be inserted via'%(xname)s'
).Labels defined in the
psyplot.rcParams
'texts.labels'
key are also replaced when enclosed by ‘{}’. The standard labels aretinfo:
%H:%M
dtinfo:
%B %d, %Y. %H:%M
dinfo:
%B %d, %Y
desc:
%(long_name)s [%(units)s]
sdesc:
%(name)s [%(units)s]
Possible types
- str
The title for the
suptitle()
function
Notes
If the plotter is part of a
psyplot.project.Project
and multiple plotters of this project are on the same figure, the replacement attributes (see above) are joined by a delimiter. If thedelimiter
attribute of thisFigtitle
instance is not None, it will be used. Otherwise the rcParams[‘texts.delimiter’] item is used.This is the title of the whole figure! For the title of this specific subplot, see the
title
formatoption.
See also
title
,figtitlesize
,figtitleweight
,figtitleprops
Methods:
clear_other_texts
([remove])Make sure that no other text is a the same position as this one
Method that is called when the plot is made the first time
update
(s)Method that is call to update the formatoption on the axes
Attributes:
The enhanced attributes of the array
str
.- clear_other_texts(remove=False)
Make sure that no other text is a the same position as this one
This method clears all text instances in the figure that are at the same position as the
_text
attribute- Parameters:
remove (bool) – If True, the Text instances are permanently deleted from the figure, otherwise there text is simply set to ‘’
- property enhanced_attrs
The enhanced attributes of the array
- initialize_plot(s)
Method that is called when the plot is made the first time
- Parameters:
value – The value to use for the initialization
- name = 'Figure title'
str
. A bit more verbose name than the formatoption key to be included in the gui. If None, the key is used in the gui
- update(s)
Method that is call to update the formatoption on the axes
- Parameters:
value – Value to update
- class psy_simple.base.Mask(key, plotter=None, index_in_list=None, additional_children=[], additional_dependencies=[], **kwargs)
Bases:
Formatoption
Mask the data where a certain condition is True
This formatoption can be used to mask the plotting data based on another array. This array can be the name of a variable in the base dataset, or it can be a numeric array. Note that the data needs to be on exactly the same coordinates as the data shown here
Possible types
- None
Apply no mask
- str
The name of a variable in the base dataset to use.
dimensions that are in the given mask but not in the visualized base variable will be aggregated using
numpy.any()
if the given mask misses dimensions that are in the visualized data (i.e. the data of this plotter), we broadcast the mask to match the shape of the data
dimensions that are in mask and the base variable, but not in the visualized data will be matched against each other
- str
The path to a netCDF file that shall be loaded
- xr.DataArray or np.ndarray
An array that can be broadcasted to the shape of the data
Methods:
diff
(value)Checks whether the given value differs from what is currently set
load_mask
(data, value)update
(value)Method that is call to update the formatoption on the axes
Attributes:
str
.str
.int
.- diff(value)
Checks whether the given value differs from what is currently set
- Parameters:
value – A possible value to set (make sure that it has been validate via the
validate
attribute before)- Returns:
True if the value differs from what is currently set
- Return type:
- load_mask(data, value)
- name = 'Apply a mask'
str
. A bit more verbose name than the formatoption key to be included in the gui. If None, the key is used in the gui
- priority = 30
int
. Priority value of the the formatoption determining when the formatoption is updated.10: at the end (for labels, etc.)
20: before the plotting (e.g. for colormaps, etc.)
30: before loading the data (e.g. for lonlatbox)
- update(value)
Method that is call to update the formatoption on the axes
- Parameters:
value – Value to update
- class psy_simple.base.MaskBetween(key, plotter=None, index_in_list=None, additional_children=[], additional_dependencies=[], **kwargs)
Bases:
ValueMaskBase
Mask data points between two numbers
Possible types
- float
The floating number to mask above
See also
maskless
,maskleq
,maskgreater
,maskgeq
Methods:
mask_func
(data, value)The masking function that is called
Attributes:
str
.- mask_func(data, value)
The masking function that is called
- class psy_simple.base.MaskGeq(key, plotter=None, index_in_list=None, additional_children=[], additional_dependencies=[], **kwargs)
Bases:
ValueMaskBase
Mask data points greater than or equal to a number
Possible types
- float
The floating number to mask above
See also
maskless
,maskleq
,maskgreater
,maskbetween
Methods:
mask_func
(data, value)The masking function that is called
Attributes:
str
.- mask_func(data, value)
The masking function that is called
- class psy_simple.base.MaskGreater(key, plotter=None, index_in_list=None, additional_children=[], additional_dependencies=[], **kwargs)
Bases:
ValueMaskBase
Mask data points greater than a number
Possible types
- float
The floating number to mask above
See also
maskless
,maskleq
,maskgeq
,maskbetween
Methods:
mask_func
(data, value)The masking function that is called
Attributes:
str
.- mask_func(data, value)
The masking function that is called
- class psy_simple.base.MaskLeq(key, plotter=None, index_in_list=None, additional_children=[], additional_dependencies=[], **kwargs)
Bases:
ValueMaskBase
Mask data points smaller than or equal to a number
Possible types
- float
The floating number to mask below
See also
maskless
,maskgreater
,maskgeq
,maskbetween
Methods:
mask_func
(data, value)The masking function that is called
Attributes:
str
.- mask_func(data, value)
The masking function that is called
- class psy_simple.base.MaskLess(key, plotter=None, index_in_list=None, additional_children=[], additional_dependencies=[], **kwargs)
Bases:
ValueMaskBase
Mask data points smaller than a number
Possible types
- float
The floating number to mask below
See also
maskleq
,maskgreater
,maskgeq
,maskbetween
Methods:
mask_func
(data, value)The masking function that is called
Attributes:
str
.- mask_func(data, value)
The masking function that is called
- class psy_simple.base.Text(*args, **kwargs)
Bases:
TextBase
,Formatoption
Add text anywhere on the plot
This formatoption draws a text on the specified position on the figure. You can insert any meta key from the
xarray.DataArray.attrs
via a string like'%(key)s'
. Furthermore there are some special cases:Strings like
'%Y'
,'%b'
, etc. will be replaced using thedatetime.datetime.strftime()
method as long as the data has a time coordinate and this can be converted to adatetime
object.'%(x)s'
,'%(y)s'
,'%(z)s'
,'%(t)s'
will be replaced by the value of the x-, y-, z- or time coordinate (as long as this coordinate is one-dimensional in the data)any attribute of one of the above coordinates is inserted via
axis + key
(e.g. the name of the x-coordinate can be inserted via'%(xname)s'
).Labels defined in the
psyplot.rcParams
'texts.labels'
key are also replaced when enclosed by ‘{}’. The standard labels aretinfo:
%H:%M
dtinfo:
%B %d, %Y. %H:%M
dinfo:
%B %d, %Y
desc:
%(long_name)s [%(units)s]
sdesc:
%(name)s [%(units)s]
Possible types
- str
If string s: this will be used as (1., 1., s, {‘ha’: ‘right’}) (i.e. a string in the upper right corner of the axes).
- tuple or list of tuples (x,y,s[,coord.-system][,options]])
Each tuple defines a text instance on the plot. 0<=x, y<=1 are the coordinates. The coord.-system can be either the data coordinates (default,
'data'
) or the axes coordinates ('axes'
) or the figure coordinates (‘fig’). The string s finally is the text. options may be a dictionary to specify format the appearence (e.g.'color'
,'fontweight'
,'fontsize'
, etc., seematplotlib.text.Text
for possible keys). To remove one single text from the plot, set (x,y,’’[, coord.-system]) for the text at position (x,y)- empty list
remove all texts from the plot
See also
title
,figtitle
Methods:
diff
(value)Checks whether the given value differs from what is currently set
Clears the
_texts_to_remove
setremove
()Method to remove the effects of this formatoption
set_value
(value[, validate, todefault])Set (and validate) the value in the plotter.
share
(fmto, **kwargs)Share the settings of this formatoption with other data objects
update
(value[, texts_to_remove])Method that is call to update the formatoption on the axes
Attributes:
str
.Dictionary containing the relevant transformations
- diff(value)
Checks whether the given value differs from what is currently set
- Parameters:
value – A possible value to set (make sure that it has been validate via the
validate
attribute before)- Returns:
True if the value differs from what is currently set
- Return type:
- finish_update()
Clears the
_texts_to_remove
set
- name = 'Arbitrary text on the plot'
str
. A bit more verbose name than the formatoption key to be included in the gui. If None, the key is used in the gui
- remove()
Method to remove the effects of this formatoption
This method is called when the axes is cleared due to a formatoption with
requires_clearing
set to True. You don’t necessarily have to implement this formatoption if your plot results are removed by the usualmatplotlib.axes.Axes.clear()
method.
- set_value(value, validate=True, todefault=False)
Set (and validate) the value in the plotter. This method is called by the plotter when it attempts to change the value of the formatoption.
Share the settings of this formatoption with other data objects
- Parameters:
fmto (Formatoption) – The
Formatoption
instance to share the attributes with**kwargs – Any other keyword argument that shall be passed to the update method of fmto
Notes
The Text formatoption sets the ‘texts_to_remove’ keyword to the
_texts_to_remove
attribute of this instance (if not already specified in**kwargs
- property transform
Dictionary containing the relevant transformations
- update(value, texts_to_remove=None)
Method that is call to update the formatoption on the axes
- Parameters:
value – Value to update
- class psy_simple.base.TextBase
Bases:
object
Abstract base class for formatoptions that provides a replace method
Attributes:
The enhanced attributes of the array
SubDict
of rcParams 'texts' keyMethods:
get_enhanced_attrs
(*args, **kwargs)get_fig_data_attrs
([delimiter])Join the data attributes with other plotters in the project
get_fmt_widget
(parent, project)Create a combobox with the attributes
replace
(s, data[, attrs])Replace the attributes of the plotter data in a string
- data_dependent = True
- delimiter = None
- property enhanced_attrs
The enhanced attributes of the array
- get_enhanced_attrs(*args, **kwargs)
- get_fig_data_attrs(delimiter=None)
Join the data attributes with other plotters in the project
This method joins the attributes of the
InteractiveBase
instances in the project that draw on the same figure as this instance does.- Parameters:
delimiter (str) – Specifies the delimiter with what the attributes are joined. If None, the
delimiter
attribute of this instance or (if the latter is also None), the rcParams[‘texts.delimiter’] item is used.- Returns:
A dictionary with all the meta attributes joined by the specified delimiter
- Return type:
- get_fmt_widget(parent, project)
Create a combobox with the attributes
- group = 'labels'
- property rc
SubDict
of rcParams ‘texts’ key
- replace(s, data, attrs=None)
Replace the attributes of the plotter data in a string
You can insert any meta key from the
xarray.DataArray.attrs
via a string like'%(key)s'
. Furthermore there are some special cases:Strings like
'%Y'
,'%b'
, etc. will be replaced using thedatetime.datetime.strftime()
method as long as the data has a time coordinate and this can be converted to adatetime
object.'%(x)s'
,'%(y)s'
,'%(z)s'
,'%(t)s'
will be replaced by the value of the x-, y-, z- or time coordinate (as long as this coordinate is one-dimensional in the data)any attribute of one of the above coordinates is inserted via
axis + key
(e.g. the name of the x-coordinate can be inserted via'%(xname)s'
).Labels defined in the
psyplot.rcParams
'texts.labels'
key are also replaced when enclosed by ‘{}’. The standard labels aretinfo:
%H:%M
dtinfo:
%B %d, %Y. %H:%M
dinfo:
%B %d, %Y
desc:
%(long_name)s [%(units)s]
sdesc:
%(name)s [%(units)s]
- Parameters:
- Returns:
s with inserted informations
- Return type:
- class psy_simple.base.Tight(key, plotter=None, index_in_list=None, additional_children=[], additional_dependencies=[], **kwargs)
Bases:
Formatoption
Automatically adjust the plots.
If set to True, the plots are automatically adjusted to fit to the figure limitations via the
matplotlib.pyplot.tight_layout()
function.Possible types
- bool
True for automatic adjustment
Warning
There is no update method to undo what happend after this formatoption is set to True!
Attributes:
str
.str
.Methods:
update
(value)Method that is call to update the formatoption on the axes
- name = 'Tight layout'
str
. A bit more verbose name than the formatoption key to be included in the gui. If None, the key is used in the gui
- update(value)
Method that is call to update the formatoption on the axes
- Parameters:
value – Value to update
- class psy_simple.base.Title(key, plotter=None, index_in_list=None, additional_children=[], additional_dependencies=[], **kwargs)
Bases:
TextBase
,Formatoption
Show the title
Set the title of the plot. You can insert any meta key from the
xarray.DataArray.attrs
via a string like'%(key)s'
. Furthermore there are some special cases:Strings like
'%Y'
,'%b'
, etc. will be replaced using thedatetime.datetime.strftime()
method as long as the data has a time coordinate and this can be converted to adatetime
object.'%(x)s'
,'%(y)s'
,'%(z)s'
,'%(t)s'
will be replaced by the value of the x-, y-, z- or time coordinate (as long as this coordinate is one-dimensional in the data)any attribute of one of the above coordinates is inserted via
axis + key
(e.g. the name of the x-coordinate can be inserted via'%(xname)s'
).Labels defined in the
psyplot.rcParams
'texts.labels'
key are also replaced when enclosed by ‘{}’. The standard labels aretinfo:
%H:%M
dtinfo:
%B %d, %Y. %H:%M
dinfo:
%B %d, %Y
desc:
%(long_name)s [%(units)s]
sdesc:
%(name)s [%(units)s]
Possible types
- str
The title for the
title()
function.
Notes
This is the title of this specific subplot! For the title of the whole figure, see the
figtitle
formatoption.See also
figtitle
,titlesize
,titleweight
,titleprops
Methods:
initialize_plot
(value)Method that is called when the plot is made the first time
update
(value)Method that is call to update the formatoption on the axes
Attributes:
str
.- initialize_plot(value)
Method that is called when the plot is made the first time
- Parameters:
value – The value to use for the initialization
- name = 'Axes title'
str
. A bit more verbose name than the formatoption key to be included in the gui. If None, the key is used in the gui
- update(value)
Method that is call to update the formatoption on the axes
- Parameters:
value – Value to update
- class psy_simple.base.TitlesPlotter(data=None, ax=None, auto_update=None, project=None, draw=False, make_plot=True, clear=False, enable_post=False, **kwargs)
Bases:
Plotter
Plotter class for labels
Attributes:
Plot a figure title
Properties of the figure title
Set the size of the figure title
Set the fontweight of the figure title
Add text anywhere on the plot
Show the title
Properties of the title
Set the size of the title
Set the fontweight of the title
- figtitle
Plot a figure title
Set the title of the figure. You can insert any meta key from the
xarray.DataArray.attrs
via a string like'%(key)s'
. Furthermore there are some special cases:Strings like
'%Y'
,'%b'
, etc. will be replaced using thedatetime.datetime.strftime()
method as long as the data has a time coordinate and this can be converted to adatetime
object.'%(x)s'
,'%(y)s'
,'%(z)s'
,'%(t)s'
will be replaced by the value of the x-, y-, z- or time coordinate (as long as this coordinate is one-dimensional in the data)any attribute of one of the above coordinates is inserted via
axis + key
(e.g. the name of the x-coordinate can be inserted via'%(xname)s'
).Labels defined in the
psyplot.rcParams
'texts.labels'
key are also replaced when enclosed by ‘{}’. The standard labels aretinfo:
%H:%M
dtinfo:
%B %d, %Y. %H:%M
dinfo:
%B %d, %Y
desc:
%(long_name)s [%(units)s]
sdesc:
%(name)s [%(units)s]
Possible types
- str
The title for the
suptitle()
function
Notes
If the plotter is part of a
psyplot.project.Project
and multiple plotters of this project are on the same figure, the replacement attributes (see above) are joined by a delimiter. If thedelimiter
attribute of thisFigtitle
instance is not None, it will be used. Otherwise the rcParams[‘texts.delimiter’] item is used.This is the title of the whole figure! For the title of this specific subplot, see the
title
formatoption.
See also
- figtitleprops
Properties of the figure title
Specify the font properties of the figure title manually.
Possible types
- dict
Items may be any valid text property
See also
- figtitlesize
Set the size of the figure title
Possible types
- float
The absolute font size in points (e.g., 12)
- string
Strings might be ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’.
See also
- figtitleweight
Set the fontweight of the figure title
Possible types
- float
a float between 0 and 1000
- string
Possible strings are one of ‘ultralight’, ‘light’, ‘normal’, ‘regular’, ‘book’, ‘medium’, ‘roman’, ‘semibold’, ‘demibold’, ‘demi’, ‘bold’, ‘heavy’, ‘extra bold’, ‘black’.
See also
- text
Add text anywhere on the plot
This formatoption draws a text on the specified position on the figure. You can insert any meta key from the
xarray.DataArray.attrs
via a string like'%(key)s'
. Furthermore there are some special cases:Strings like
'%Y'
,'%b'
, etc. will be replaced using thedatetime.datetime.strftime()
method as long as the data has a time coordinate and this can be converted to adatetime
object.'%(x)s'
,'%(y)s'
,'%(z)s'
,'%(t)s'
will be replaced by the value of the x-, y-, z- or time coordinate (as long as this coordinate is one-dimensional in the data)any attribute of one of the above coordinates is inserted via
axis + key
(e.g. the name of the x-coordinate can be inserted via'%(xname)s'
).Labels defined in the
psyplot.rcParams
'texts.labels'
key are also replaced when enclosed by ‘{}’. The standard labels aretinfo:
%H:%M
dtinfo:
%B %d, %Y. %H:%M
dinfo:
%B %d, %Y
desc:
%(long_name)s [%(units)s]
sdesc:
%(name)s [%(units)s]
Possible types
- str
If string s: this will be used as (1., 1., s, {‘ha’: ‘right’}) (i.e. a string in the upper right corner of the axes).
- tuple or list of tuples (x,y,s[,coord.-system][,options]])
Each tuple defines a text instance on the plot. 0<=x, y<=1 are the coordinates. The coord.-system can be either the data coordinates (default,
'data'
) or the axes coordinates ('axes'
) or the figure coordinates (‘fig’). The string s finally is the text. options may be a dictionary to specify format the appearence (e.g.'color'
,'fontweight'
,'fontsize'
, etc., seematplotlib.text.Text
for possible keys). To remove one single text from the plot, set (x,y,’’[, coord.-system]) for the text at position (x,y)- empty list
remove all texts from the plot
- title
Show the title
Set the title of the plot. You can insert any meta key from the
xarray.DataArray.attrs
via a string like'%(key)s'
. Furthermore there are some special cases:Strings like
'%Y'
,'%b'
, etc. will be replaced using thedatetime.datetime.strftime()
method as long as the data has a time coordinate and this can be converted to adatetime
object.'%(x)s'
,'%(y)s'
,'%(z)s'
,'%(t)s'
will be replaced by the value of the x-, y-, z- or time coordinate (as long as this coordinate is one-dimensional in the data)any attribute of one of the above coordinates is inserted via
axis + key
(e.g. the name of the x-coordinate can be inserted via'%(xname)s'
).Labels defined in the
psyplot.rcParams
'texts.labels'
key are also replaced when enclosed by ‘{}’. The standard labels aretinfo:
%H:%M
dtinfo:
%B %d, %Y. %H:%M
dinfo:
%B %d, %Y
desc:
%(long_name)s [%(units)s]
sdesc:
%(name)s [%(units)s]
Possible types
- str
The title for the
title()
function.
Notes
This is the title of this specific subplot! For the title of the whole figure, see the
figtitle
formatoption.See also
- titleprops
Properties of the title
Specify the font properties of the figure title manually.
Possible types
- dict
Items may be any valid text property
See also
- titlesize
Set the size of the title
Possible types
- float
The absolute font size in points (e.g., 12)
- string
Strings might be ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’.
See also
- class psy_simple.base.ValueMaskBase(key, plotter=None, index_in_list=None, additional_children=[], additional_dependencies=[], **kwargs)
Bases:
Formatoption
Base class for masking formatoptions
Attributes:
bool
or a callable.str
.int
.Methods:
The masking function that is called
update
(value)Method that is call to update the formatoption on the axes
- data_dependent = True
bool
or a callable. This attribute indicates whether thisFormatoption
depends on the data and should be updated if the data changes. If it is a callable, it must accept one argument: the new data. (Note: This is automatically set to True for plot formatoptions)
- abstract mask_func()
The masking function that is called
- priority = 30
int
. Priority value of the the formatoption determining when the formatoption is updated.10: at the end (for labels, etc.)
20: before the plotting (e.g. for colormaps, etc.)
30: before loading the data (e.g. for lonlatbox)
- update(value)
Method that is call to update the formatoption on the axes
- Parameters:
value – Value to update
- psy_simple.base.label_props(base, label_name=None, children=[], parents=[], dependencies=[])
Function that returns a Formatoption class for modifying the fontsite
This function returns a
Formatoption
instance that modifies the size of the given base formatoption- Parameters:
base (Formatoption) – The base formatoption instance that is used in the
psyplot.Plotter
subclass to create the label. The instance must have atexts
attribute which stores all thematplotlib.text.Text
instances.label_name (str) – The name of the label to use in the documentation. If None, it will be
key
, wherekey
is thepsyplot.plotter.Formatoption.key`
attribute of basechildren (list of str) – The childrens of the resulting formatoption class (besides the base formatoption which is included anyway)
parents (list of str) – The parents of the resulting formatoption class (besides the base the properties formatoption from base (see
label_props()
))dependencies (list of str) – The dependencies of the formatoption
children – The childrens of the resulting formatoption class (besides the base formatoption, the
base.key + 'size'
andbase.key + 'weight'
keys, which are included anyway (seelabel_size()
,label_weight()
))parents – The parents of the resulting formatoption class
- Returns:
The formatoption instance that modifies the fontsize of base
- Return type:
Formatoption
See also
- psy_simple.base.label_size(base, label_name=None, children=[], parents=[], dependencies=[])
Function that returns a Formatoption class for modifying the fontsite
This function returns a
Formatoption
instance that modifies the size of the given base formatoption- Parameters:
base (Formatoption) – The base formatoption instance that is used in the
psyplot.Plotter
subclass to create the label. The instance must have atexts
attribute which stores all thematplotlib.text.Text
instances.label_name (str) – The name of the label to use in the documentation. If None, it will be
key
, wherekey
is thepsyplot.plotter.Formatoption.key`
attribute of basechildren (list of str) – The childrens of the resulting formatoption class (besides the base formatoption which is included anyway)
parents (list of str) – The parents of the resulting formatoption class (besides the base the properties formatoption from base (see
label_props()
))dependencies (list of str) – The dependencies of the formatoption
- Returns:
The formatoption instance that modifies the fontsize of base
- Return type:
Formatoption
See also
- psy_simple.base.label_weight(base, label_name=None, children=[], parents=[], dependencies=[])
Function that returns a Formatoption class for modifying the fontweight
This function returns a
Formatoption
instance that modifies the weight of the given base formatoption- Parameters:
base (Formatoption) – The base formatoption instance that is used in the
psyplot.Plotter
subclass to create the label. The instance must have atexts
attribute which stores all thematplotlib.text.Text
instances.label_name (str) – The name of the label to use in the documentation. If None, it will be
key
, wherekey
is thepsyplot.plotter.Formatoption.key`
attribute of basechildren (list of str) – The childrens of the resulting formatoption class (besides the base formatoption which is included anyway)
parents (list of str) – The parents of the resulting formatoption class (besides the base the properties formatoption from base (see
label_props()
))dependencies (list of str) – The dependencies of the formatoption
- Returns:
The formatoption instance that modifies the fontweight of base
- Return type:
Formatoption
See also