casys.visualization.parameters
Plot’s parameters related classes.
Functions
|
Check provided limits values. |
|
Check provided color_map value. |
|
Check the transform and center parameters supplied to DataParams. |
|
Compute the limits according to the limits_type and limits_values parameters. |
|
Compute a discretized cmap by performing the extraction and discretization of an input colormap according to the input data. |
Compute the boundary values associated with unique ordered values. |
|
|
Compute the colorbar parameters for a given data input. |
|
Compute ticks values for a discretized colorbar from the colorbar boundaries. |
|
String representation for transformation's clip. |
|
Compute statistics bar values for the provided data. |
|
Discretize a colormap parameter according to the input data. |
|
Extract a Colormap object from the colormap input, normalizing and checking the colors. |
|
Normalize the center option value. |
Classes
|
Axe parameters for a plot. |
|
Set of parameters related to plot's data. |
|
Set of parameters relatives to the coastlines display in plot visualisation. |
|
Set of parameters for gridliner in a map. |
|
Parameters of a watermark. |
|
Set of parameters related to plot's visualization. |
|
Set of text parameters for a plot. |
|
Template containing all plot's elements properties. |
Class managing the template objects. |
|
|
Template records class. |
- class casys.visualization.parameters.AxeParams(label=None, ticks=None, ticks_minor=None, ticks_major=None, kwargs=None, properties=None, is_copy=None, values=None, position=None, enabled=None, level=PropertiesLevel.ALL)
Bases:
object
Axe parameters for a plot.
Matplotlib underlying functions depend on the type of element this parameter is given to.
- Parameters:
label (
Properties
|dict
[str
,Any
] |str
) – Label properties of the axe. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.set_xlabel.html https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.set_ylabel.html https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Cell.set_text_props https://matplotlib.org/stable/api/colorbar_api.html -> set_label(self, label, **kw)ticks (
Properties
|dict
[str
,Any
]) – Ticks properties of the axe: https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.tick_params.html Applies to both minor and major ticks.ticks_minor (
Properties
|dict
[str
,Any
]) – Ticks properties of the axe: https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.tick_params.html Applies to minor ticks.ticks_major (
Properties
|dict
[str
,Any
]) – Ticks properties of the axe: https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.tick_params.html Applies to major ticks.values (
Union
[dict
[str
,Any
],Callable
]) –Additional major ticks parameters of the axe, can be a dictionary or a function transforming a value to a label. {“ticks”: [2, 30, 50, 100], “labels”:[“one”,”two”,”three”,”four”]}
If a dictionary is provided, it has to include two keys: - labels (for x/y axes) https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.set_xticklabels.html https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.set_yticklabels.html - ticks (for x/y axes) https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.set_xticks.html https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.set_yticks.html - ticks (for colorbar axes) https://matplotlib.org/stable/api/colorbar_api.html#matplotlib.colorbar.ColorbarBase.set_ticks
kwargs (
Properties
|dict
[str
,Any
]) – Additional parameters passed to the underlying matplotlib class.enabled (
bool
) – Whether this AxeParams is enabled or not.is_copy (
bool
) – Whether this AxeParams represent a copied axis or not. user ones (internal usage)level (
PropertiesLevel
) – Property level to use.properties (
Properties
|dict
[str
,Any
])
- property axis: TargetAxisType
- drop_auto()
Drop all auto properties from this element.
- enable(level=PropertiesLevel.USER, only_missing=True)
- Parameters:
level (
PropertiesLevel
)only_missing (
bool
)
- static html_header()
- classmethod normalize_color_bar(*, color_bar)
Normalize the colorbar parameter value.
- static normalize_kwargs(values, level)
- Parameters:
values (
dict
[str
,Any
] |Properties
)level (
PropertiesLevel
)
- Return type:
- set_axis(value, level)
- Parameters:
value (
str
|TargetAxisType
)level (
str
|PropertiesLevel
)
- set_label(values, level=PropertiesLevel.USER)
- Parameters:
level (
PropertiesLevel
)
- set_position(position, level=PropertiesLevel.USER)
- Parameters:
level (
PropertiesLevel
|str
)
- set_text_size(size, elements)
- Parameters:
size (
Any
)elements (
set
[TextElementType
])
- to_level(level)
Convert all properties to the provided level.
- Parameters:
level (
PropertiesLevel
) – Properties level to convert into.
- update(params, mode=PropertiesLevel.ALL, replace=False, only_missing=False)
Update the current AxeParams with properties from the provided one.
- Parameters:
mode (
PropertiesLevel
) – Update mode.replace (
bool
) – Whether to replace existing properties or not.only_missing (
bool
) – Whether to only add missing values or not.
- class casys.visualization.parameters.DataParams(limits=None, properties=None, x_limits=None, y_limits=None, z_limits=None, time_limits=None, remove_nan=None, normalize=None, points_min_radius=None, transform=None, center=None, level=PropertiesLevel.ALL)
Bases:
object
Set of parameters related to plot’s data.
- Parameters:
x_limits (
tuple
[Any
,Any
]) – Crop the plot’s data to the provided limits [x_min, x_max]y_limits (
tuple
[Any
,Any
]) – Crop the plot’s data to the provided limits [y_min, y_max]z_limits (
tuple
[Any
,Any
]) – Crop the plot’s data to the provided limits [z_min, z_max]time_limits (
tuple
[Any
,Any
]) – [Map’s raw plots only] Crop the plot’s data to the provided limits [time_min, time_max]remove_nan (
bool
) – Whether NaN values should be removed before plotting or not.normalize (
bool
) – Whether histograms should be normalized or notpoints_min_radius (
float
) – Minimum radius allowed between two points when plotting raw data on maps. The radius is expressed in meters. Underlying function: https://unidata.github.io/MetPy/latest/api/generated/metpy.calc.reduce_point_density.htmlcenter (
str
|int
|float
|None
) –Centering options for the data. Allowed input values are:
numerical values (int/float) -> data_ctr = data - center
statistic (“mean”, “min”, …) -> data_ctr = data - np.nanmean(data)
transform (
Union
[str
,Callable
,None
]) –Transformation options for the data. Allowed input values (including center parameter ones) are:
a function returning an array shaped like data -> data_ctr = f(data)
a clip characters string containing the VALUE word (at least once), numerical values, arithmetic operations and statistic names: “3*VALUE - MEAN/2 + 10” -> data_ctr = 3*data - np.nanmean(data)/2 + 10
limits (
Properties
|dict
[str
,Any
])properties (
Properties
|dict
[str
,Any
])level (
PropertiesLevel
)
- drop_auto()
Drop all auto properties from this element.
- static html_header()
- reduce_density(data, longitude, latitude, index, proj)
Reduce data density using the points_min_radius parameter if any.
- to_level(level)
Convert all properties to the provided level.
- Parameters:
level (
PropertiesLevel
) – Properties level to convert into.
- transform_data(data)
Transform the data using the transform parameter if any.
- update(params, mode=PropertiesLevel.ALL, replace=False, only_missing=False)
Update the current DataParams with properties from the provided one.
- Parameters:
params (
DataParams
|None
) – GridParams to get values from.mode (
PropertiesLevel
) – Update mode.replace (
bool
) – Whether to replace existing properties or not.only_missing (
bool
) – Whether to only add missing values or not.
- class casys.visualization.parameters.FeatureParams(feature=None, feature_kwargs=None, enabled=None, level=PropertiesLevel.ALL, properties=None)
Bases:
object
Set of parameters relatives to the coastlines display in plot visualisation.
- Parameters:
feature (
FeatureType
|str
) – Type of the feature.feature_kwargs (
dict
[str
,Any
]) – Parameters dictionary of the feature.enabled (
bool
) – Whether the coastlines are drawn or not.level (
PropertiesLevel
)properties (
Properties
|dict
[str
,Any
])
- drop_auto()
Drop all auto properties from this element.
- enable(level=PropertiesLevel.USER, only_missing=True)
- Parameters:
level (
PropertiesLevel
)only_missing (
bool
)
- property feature
- static html_header()
- classmethod normalize_coastlines(*, coastlines)
Normalize the coastlines parameter value.
- Parameters:
coastlines (
bool
|dict
|FeatureParams
|None
) – Coastlines parameter value.- Return type:
- Returns:
Normalized coastlines parameter value.
- static normalize_feature_properties(properties)
Normalize provided properties which might be given as a single boolean or flatten feature_kwargs.
- to_level(level)
Convert all properties to the provided level.
- Parameters:
level (
PropertiesLevel
) – Properties level to convert into.
- update(params, mode=PropertiesLevel.ALL, replace=False, only_missing=False)
Update the current CoastlinesParams with properties from the provided one.
- Parameters:
params (
FeatureParams
|None
) – CoastlinesParams to get values from.mode (
PropertiesLevel
) – Update mode.replace (
bool
) – Whether to replace existing properties or not.only_missing (
bool
) – Whether to only add missing values or not.
- class casys.visualization.parameters.GridParams(line_properties=None, xlabel_style=None, ylabel_style=None, properties=None, top_labels=None, bottom_labels=None, right_labels=None, left_labels=None, kwargs=None, enabled=None, level=PropertiesLevel.ALL)
Bases:
object
Set of parameters for gridliner in a map.
- Parameters:
line_properties (
Properties
|dict
[str
,Any
]) – A dictionary passed through to collections.LineCollection for styling of the line of the gridxlabel_style (
Properties
|dict
[str
,Any
]) – A dictionary passed through toax.text
for styling of the x-axis text labelsylabel_style (
Properties
|dict
[str
,Any
]) – A dictionary passed through toax.text
for styling of the y-axis text labelstop_labels (
InitVar
) – Whether to draw labels on the top of the map (default to False)bottom_labels (
InitVar
) – Whether to draw labels on the bottom of the map (default to True)right_labels (
InitVar
) – Whether to draw labels on the right-hand side of the map (default to False)left_labels (
InitVar
) – Whether to draw labels on the left-hand side of the map (default to True)kwargs (
InitVar
) – Additional parameters passed to the underlying matplotlib grid or cartopy gridlines method.enabled (
InitVar
) – Whether this GridParams is enabled or not (internally used by schemas).properties (
Properties
|dict
[str
,Any
])level (
InitVar
)
- drop_auto()
Drop all auto properties from this element.
- enable(level=PropertiesLevel.USER, only_missing=True)
- Parameters:
level (
PropertiesLevel
)only_missing (
bool
)
-
line_properties:
Properties
|dict
[str
,Any
] = None
- classmethod normalize(*, grid)
- Parameters:
grid (
bool
|GridParams
|None
)- Return type:
-
properties:
Properties
|dict
[str
,Any
] = None
- to_level(level)
Convert all properties to the provided level.
- Parameters:
level (
PropertiesLevel
) – Properties level to convert into.
- update(params, mode=PropertiesLevel.ALL, replace=False, only_missing=False)
Update the current GridParams with properties from the provided one.
- Parameters:
params (
GridParams
|None
) – GridParams to get values from.mode (
PropertiesLevel
) – Update mode.replace (
bool
) – Whether to replace existing properties or not.only_missing (
bool
) – Whether to only add missing values or not.
-
xlabel_style:
Properties
|dict
[str
,Any
] = None
-
ylabel_style:
Properties
|dict
[str
,Any
] = None
- class casys.visualization.parameters.PlotParams(fig_width=None, fig_height=None, x_limits=None, y_limits=None, color_limits=None, color_map=None, discretize_cmap=None, color_bar=None, grid=None, show_reg=None, show_legend=None, fill_land=None, fill_ocean=None, mask_land=None, mask_ocean=None, coastlines=None, projection=None, color=None, marker_style=None, marker_size=None, line_style=None, line_width=None, bars=None, kwargs_figure=None, kwargs_plot=None, level=PropertiesLevel.ALL, properties=None)
Bases:
object
Set of parameters related to plot’s visualization.
- Parameters:
fig_width (
float
) – Figure width (default to 10).fig_height (
float
) – Figure height (default to 6).x_limits (
tuple
[Any
,Any
] |str
|LimitsType
) – Limit the plot view to the provided extent [x_min, x_max]. Default to (min, max). The “auto” option allows to compute adapted color limits: (mean-3*std, mean+3*std). Use a tuple with the format (“p”, (p_min, p_max)) or (“p”, p_value) to fix limits according to the percentiles in the data. For p_value, the percentile limits (p_min, p_max) equivalence is: ( (100-value)/2, (100+value)/2 ).y_limits (
tuple
[Any
,Any
] |str
|LimitsType
) – Limit the plot view to the provided extent [y_min, y_max]. Default to (min, max). The “auto” option allows to compute adapted color limits: (mean-3*std, mean+3*std). Use a tuple with the format (“p”, (p_min, p_max)) or (“p”, p_value) to fix limits according to the percentiles in the data. For p_value, the percentile limits (p_min, p_max) equivalence is: ( (100-value)/2, (100+value)/2 ).color_limits (
tuple
[Any
,Any
] |str
|LimitsType
) – Color bar minimum and maximum values. Default to (min, max). The “auto” option allows to compute adapted color limits: (mean-3*std, mean+3*std). Use a tuple with the format (“p”, (p_min, p_max)) or (“p”, p_value) to fix limits according to the percentiles in the data. For p_value, the percentile limits (p_min, p_max) equivalence is: ( (100-value)/2, (100+value)/2 ).color_map (
str
|Colormap
|list
|dict
) –Color mapping (default to viridis): The following types and format are available, depending on the discretize_cmap flag value.
- When discretize_cmap is False:
Custom ColorMap object from matplotlib.cm
Name (as a string) of an existing colormap in matplotlib
- When discretize_cmap is True:
Custom ListedColorMap from matplotlib.cm
Name of an existing matplotlib colormap (needs to be a ListedColorMap)
List of: - strings representing either a known color name (“red” or “b”), or
a hexadecimal value of a color (“#RRGGBBAA” or “#RRGGBB”)
tuple or list of ints in the 0-1 range, coding for an RGB/RGBA color ( (R, G, B, A) or (R, G, B) )
None, resulting in no display for the corresponding value
Dictionary specifying a correspondence value: color, respecting the color coding described above. More values than those actually present in the data can be provided in this dictionary.
discretize_cmap (
bool
) –- Color mapping option (default to False):
True: Discretize the colormap according to the data to display
False: Keep current colormap
color_bar (
AxeParams
|str
|bool
) –- Color bar specifications (default to True):
True/False: Whether to display a bottom color bar or not.
string: Label for a bottom color bar.
AxeParams: Full specification for a color bar.
grid (
GridParams
|bool
) –- Grid specification (default to True):
True/False: Whether to display a grid or not.
GridParam: Full specification of the grid.
show_reg (
bool
) – Display the regression curve (scatter).show_legend (
bool
) – True: Force the legend to be displayed on single curve graphics. False: Force the legend to be hidden on multi curve graphics. None (default): Only display legend on multi curve graphics.fill_land (
bool
) – Color continents (cartography).fill_ocean (
bool
) – Color oceans (cartography).mask_land (
bool
) – Hide continents data (cartography).mask_ocean (
bool
) – Hide oceans data (cartography).coastlines (
bool
|dict
[str
,Any
] |FeatureParams
) – Draw the coastlines with the provided parameters (cartography).projection (
Projection
|str
) – Change the map projection.color (
str
) – Color of the plot.marker_style (
str
) – Plot markers style.line_style (
str
) – Plot line style.line_width (
float
) – Plot line width.bars (
bool
) – Display graphics as bars (Default: True for histograms, False otherwise).kwargs_figure (
dict
[str
,Any
]) – Additional parameters passed to the underlying matplotlib Figure class.kwargs_plot (
dict
[str
,Any
]) – Additional parameters passed to the underlying matplotlib plotting method.level (
PropertiesLevel
) – Property level to use.properties (
Properties
|dict
[str
,Any
])
- property coastlines: FeatureParams
- drop_auto()
Drop all auto properties from this element.
- property grid: GridParams
- static html_header()
- property projection: Projection
- to_level(level)
Convert all properties to the provided level.
- Parameters:
level (
PropertiesLevel
) – Properties level to convert into.
- update(params, mode=PropertiesLevel.ALL, replace=False, only_missing=False)
Update the current PlotParams with properties from the provided one.
- Parameters:
params (
PlotParams
|None
) – PlotParams to get values from.mode (
PropertiesLevel
) – Update mode.replace (
bool
) – Whether to replace existing properties or not.only_missing (
bool
) – Whether to only add missing values or not.
- class casys.visualization.parameters.PlotTemplate(title=None, x1=None, x2=None, y1=None, y2=None, stat_bar=None, color_bar=None, hist_bar_x=None, hist_bar_y=None, hist_bar_z=None, stat_graph_x=None, stat_graph_y=None, legend=None, plot=None, grid=None, coastlines=None, data=None, ticks_spaces=<factory>, watermarks=<factory>, description=None, text=None)
Bases:
object
Template containing all plot’s elements properties.
- Parameters:
title (
AxeParams
|None
) – Properties of the title (AxeParams).legend (
AxeParams
|None
) – Properties of the legend (AxeParams).x1 (
AxeParams
|None
) – Properties of the main x-axis (AxeParams).x2 (
AxeParams
|None
) – Properties of the second x-axis (AxeParams).y1 (
AxeParams
|None
) – Properties of the main y-axis (AxeParams).y2 (
AxeParams
|None
) – Properties of the second y-axis (AxeParams).stat_bar (
AxeParams
|None
) – Properties of the statistics bar (AxeParams).color_bar (
AxeParams
|None
) – Properties of the color bar (AxeParams).hist_bar_x (
AxeParams
|None
) – Properties of the x-axis histogram (AxeParams).hist_bar_y (
AxeParams
|None
) – Properties of the y-axis histogram (AxeParams).hist_bar_z (
AxeParams
|None
) – Properties of the z-axis histogram (AxeParams).stat_graph_x (
AxeParams
|None
) – Properties of the x-axis statistics graphic (AxeParams).stat_graph_y (
AxeParams
|None
) – Properties of the y-axis statistics graphic (AxeParams).plot (
PlotParams
|None
) – Properties of the plot (PlotParams).data (
DataParams
|None
) – Properties of the data (DataParams).grid (
GridParams
|None
) – Properties of the grid (GridParams).coastlines (
FeatureParams
|None
) – Properties of the coastlines (FeatureParams).ticks_spaces (
list
[tuple
[Position
,float
]]) – Ticks spaces to apply to each position.watermarks (
list
[WatermarkParams
]) – List of watermarks.text (
InitVar
) – Textual elements properties to apply to other elements (TextParams).
-
axe_elements:
list
[ElementType
]
- axes_params()
Get a list of all enabled axes parameters.
-
coastlines:
FeatureParams
|None
= None
- compute_plot_params(*, x, y, z=None)
Return updated PlotTemplate regarding colormap and colorbar discretization.
- Parameters:
- Return type:
- Returns:
Updated PlotTemplate object.
- computed_color_bar(*, data)
Compute the color bar (required for discretized color maps).
-
data:
DataParams
|None
= None
- drop_auto()
Drop all auto properties from this template.
- get_element(element)
Get an element referenced by its type.
- Parameters:
element (
ElementType
|AxisType
) – Type of the element.- Return type:
- Returns:
Element.
-
grid:
GridParams
|None
= None
- hist_bars()
Get a list of all enabled hist_bars.
- static load(name, path=None, reload=False)
Get a registered or stored template.
Templates from the provided path will be added to the template registry.
- Parameters:
- Return type:
- Returns:
Registered template.
- classmethod normalize(template)
- Parameters:
template (
str
|PlotTemplate
|None
)- Return type:
-
plot:
PlotParams
|None
= None
- register(name)
Register a template, so it can be used by its name.
- Parameters:
name (
str
) – Name given to the template.
- resize_text(size, elements)
Resize the text of the provided elements.
- Parameters:
size (
Any
) – Text size to set.elements (
set
[TextElementType
]) – Elements to resize.
- set_element(axt, params)
Set an element referenced by its type.
- Parameters:
axt (
ElementType
) – Type of the element to set.params (
AxeParams
) – Parameters to set.
- classmethod set_template(template=None, data_params=None, plot_params=None, text_params=None, level=PropertiesLevel.ALL)
Create a new template using provided parameters.
Provided template’s
auto
level properties are ignored.- Parameters:
template (
str
|PlotTemplate
|None
) – Base template (can be a registered template name).data_params (
DataParams
|None
) – Data parametersplot_params (
PlotParams
|None
) – Plot parameterstext_params (
TextParams
|None
) – Text parameterslevel (
PropertiesLevel
) – Property level to set all properties to.
- Return type:
- Returns:
New updated template.
- stat_graphs()
Get a list of all enabled stat_graphs.
- store(name, path, overwrite=False)
Store this template to a file.
- to_level(level)
Convert all properties to the provided level.
- Parameters:
level (
PropertiesLevel
) – Properties level to convert into.
- update(params, mode=PropertiesLevel.ALL, only_missing=False)
Update template.
- Parameters:
params (
PlotTemplate
) – Template parameters.mode (
PropertiesLevel
) – Update mode.only_missing (
bool
) – Whether to only add missing values or not.
- update_coastlines(params, mode=PropertiesLevel.ALL)
Update coastlines parameters.
- Parameters:
params (
FeatureParams
) – Coastlines parameters.mode (
PropertiesLevel
) – Update mode.
- update_data(params, mode=PropertiesLevel.ALL, replace=False)
Update data parameters.
- Parameters:
params (
DataParams
) – Data parameters.mode (
PropertiesLevel
) – Update mode.replace (
bool
) – Whether to replace existing properties or not.
- update_grid(params, mode=PropertiesLevel.ALL)
Update grid parameters.
- Parameters:
params (
GridParams
) – Grid parameters.mode (
PropertiesLevel
) – Update mode.
- update_plot(params, mode=PropertiesLevel.ALL, replace=False)
Update plot, color_bar, grid and coastlines properties using provided PlotParams.
- Parameters:
params (
PlotParams
) – Plot parameters.mode (
PropertiesLevel
) – Update mode.replace (
bool
) – Whether to replace existing properties or not.
- update_text(params, mode=PropertiesLevel.ALL)
Update text properties for all elements using the provided parameters.
- Parameters:
params (
TextParams
) – Text parameters.mode (
PropertiesLevel
) – Update mode.
-
watermarks:
list
[WatermarkParams
]
- class casys.visualization.parameters.TemplateManager
Bases:
object
Class managing the template objects.
-
TEMPLATES:
ClassVar
[dict
[str
,PlotTemplate
]] = {}
- classmethod add_template(name, template)
- Parameters:
name (
str
)template (
PlotTemplate
)
- classmethod get_template(name, path=None, reload=False)
Get a registered template.
- Parameters:
- Return type:
- Returns:
Registered template.
- classmethod load_path(path=None, reload=False)
Load templates from the provided path. Loaded template will be added to currently loaded ones and made available through their name.
- classmethod store(name, path, template, overwrite=False)
Store this template into a file.
Existing templates from the provided path will be added to the current registry.
- Parameters:
name (
str
) – Name of the template.template (
PlotTemplate
) – Template to store.path (
str
) – Path of the fileoverwrite (
bool
) – Whether to overwrite any existing file or not.
-
TEMPLATES:
- class casys.visualization.parameters.TemplateRecords(templates=<factory>)
Bases:
object
Template records class.
- Parameters:
templates (
dict
[str
,PlotTemplate
])
-
templates:
dict
[str
,PlotTemplate
]
- class casys.visualization.parameters.TextParams(xlabel=<factory>, ylabel=<factory>, clabel=<factory>, slabel=<factory>, legend=<factory>, title=<factory>, level=PropertiesLevel.ALL)
Bases:
object
Set of text parameters for a plot.
Each parameter can be provided as a string (used as title for the parameter) or a dictionary passed to the underlying matplotlib function.
- Parameters:
xlabel (
Properties
|dict
[str
,Any
] |str
) – Name and properties of the x-axis label. Underlying function: https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.set_xlabel.htmlylabel (
Properties
|dict
[str
,Any
] |str
) – Name and properties of the y-axis label. Underlying function: https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.set_ylabel.htmlclabel (
Properties
|dict
[str
,Any
] |str
) – Name and properties of the color bar label.slabel (
Properties
|dict
[str
,Any
] |str
) – Name and properties of the stat bar label.legend (
Properties
|dict
[str
,Any
] |str
) – Name and properties of the legend element. Underlying function: https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#codecell4title (
Properties
|dict
[str
,Any
] |str
) – Name and properties of the title. Underlying function: https://matplotlib.org/stable/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure.suptitlelevel (
InitVar
)
- static html_header()
- update(params, level=PropertiesLevel.ALL, only_missing=False)
Update this TextParams with values from another one.
- Parameters:
params (
TextParams
|None
) – TextParams to get values from.level (
PropertiesLevel
) – Update level.only_missing (
bool
) – Whether to only add missing values or not.
- class casys.visualization.parameters.WatermarkParams(image, image_size=None, kwargs=None)
Bases:
object
Parameters of a watermark.
- Parameters:
image (
str
|ndarray
) – Path to an image file or numpy array.image_size (
tuple
[int
,int
] |int
|None
) – Tuple (width, height) in pixels, or an integer representing a percentage of the plot’s width used to resize the image. If the image is a numpy array, it cannot be resized.kwargs (
dict
[str
,Any
] |None
) – Additional parameters passed to the underlying matplotlib function: https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.figimage.html
- has_image_size()
- casys.visualization.parameters.check_color_map(*, color_map)
Check provided color_map value.
- casys.visualization.parameters.check_limits(*, limits)
Check provided limits values.
- casys.visualization.parameters.check_transform_parameters(*, transform, center=None)
Check the transform and center parameters supplied to DataParams.
- casys.visualization.parameters.compute_discretized_cmap(*, cmap, data)
Compute a discretized cmap by performing the extraction and discretization of an input colormap according to the input data.
- casys.visualization.parameters.compute_discretized_colorbar_boundaries(*, values)
Compute the boundary values associated with unique ordered values.
- casys.visualization.parameters.compute_discretized_colorbar_params(*, data, cmap=None)
Compute the colorbar parameters for a given data input.
- Parameters:
- Return type:
tuple
[BoundaryNorm
,list
[str
],ndarray
]- Returns:
- norm
Normalization object to be applied to the colorbar.
- ticks_labels
Labels of the colorbar ticks.
- ticks_values
Position of the colorbar ticks.
- casys.visualization.parameters.compute_discretized_colorbar_ticks(*, bounds)
Compute ticks values for a discretized colorbar from the colorbar boundaries.
- casys.visualization.parameters.compute_limits(*, limits, data)
Compute the limits according to the limits_type and limits_values parameters.
- casys.visualization.parameters.compute_repr_transform_clip(*, clip)
String representation for transformation’s clip.
- Parameters:
clip (
Clip
)
- casys.visualization.parameters.compute_stat_bar_values(*, data)
Compute statistics bar values for the provided data.
- Parameters:
data (
DataArray
) – Data for which to compute statistics.- Returns:
Data’s statistics.
- casys.visualization.parameters.discretize_cmap(*, cmap, data, select_first=False)
Discretize a colormap parameter according to the input data.
- Parameters:
- Return type:
- Returns:
Discretized output colormap.
- casys.visualization.parameters.extract_cmap(*, cmap)
Extract a Colormap object from the colormap input, normalizing and checking the colors.