gemseo.post.dataset.plot_settings module#

Data for a plot.

Settings PlotSettings(*, color='', colormap='rainbow', fig_size=(6.4, 4.8), font_size=10, legend_location='best', linestyle='', marker='', xtick_rotation=0.0, title='', xlabel='', xmin=None, xmax=None, ylabel='', ymin=None, ymax=None, zlabel='', zmin=None, zmax=None, rmin=None, rmax=None, labels=None, n_items=0, grid=True)[source]#

Bases: BaseModel

The settings of a plot.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
  • color (str | Sequence[str]) --

    By default it is set to "".

  • colormap (str) --

    By default it is set to "rainbow".

  • fig_size (tuple[float, float]) --

    By default it is set to (6.4, 4.8).

  • font_size (int) --

    By default it is set to 10.

  • legend_location (str) --

    By default it is set to "best".

  • linestyle (str | Sequence[str]) --

    By default it is set to "".

  • marker (str | Sequence[str]) --

    By default it is set to "".

  • xtick_rotation (float) --

    By default it is set to 0.0.

  • title (str) --

    By default it is set to "".

  • xlabel (str) --

    By default it is set to "".

  • xmin (float | None)

  • xmax (float | None)

  • ylabel (str) --

    By default it is set to "".

  • ymin (float | None)

  • ymax (float | None)

  • zlabel (str) --

    By default it is set to "".

  • zmin (float | None)

  • zmax (float | None)

  • rmin (float | None)

  • rmax (float | None)

  • labels (Mapping[str, str])

  • n_items (int) --

    By default it is set to 0.

  • grid (bool) --

    By default it is set to True.

Return type:

None

color: str | Sequence[str] = ''#

The color.

Either a global one or one per item if n_items is non-zero.

If empty, use a default one.

colormap: str = 'rainbow'#

The color map.

fig_size: FigSizeType = (6.4, 4.8)#

The figure size.

font_size: int = 10#

The font size.

grid: bool = True#

Whether to add a grid.

labels: Mapping[str, str] [Optional]#

The labels for the variables.

legend_location: str = 'best'#

The location of the legend.

linestyle: str | Sequence[str] = ''#

The line style.

Either a global one or one per item if n_items is non-zero.

If empty, use a default one.

marker: str | Sequence[str] = ''#

The marker.

Either a global one or one per item if n_items is non-zero. If empty, use a default one.

n_items: int = 0#

The number of items.

The item definition is specific to the plot type and is used to define properties, e.g. color and line style, for each item.

For example, items can correspond to curves or series of points.

By default, a graph has no item.

rmax: float | None = None#

The maximum value on the r-axis.

If None, compute it from data.

rmin: float | None = None#

The minimum value on the r-axis.

If None, compute it from data.

title: str = ''#

The title of the plot.

xlabel: str = ''#

The label for the x-axis.

xmax: float | None = None#

The maximum value on the x-axis.".

If None, compute it from data.

xmin: float | None = None#

The minimum value on the x-axis.

If None, compute it from data.

xtick_rotation: float = 0.0#

The rotation angle in degrees for the x-ticks.

ylabel: str = ''#

The label for the y-axis.

ymax: float | None = None#

The maximum value on the y-axis.

If None, compute it from data.

ymin: float | None = None#

The minimum value on the y-axis.

If None, compute it from data.

zlabel: str = ''#

The label for the z-axis.

zmax: float | None = None#

The maximum value on the z-axis.

If None, compute it from data.

zmin: float | None = None#

The minimum value on the z-axis.

If None, compute it from data.

set_colors(color)[source]#

Set one color per item if n_items is non-zero or a unique one.

Parameters:

color (str | list[str]) -- The color(s).

Return type:

None

set_linestyles(linestyle)[source]#

Set the line style(s) if n_items is non-zero or a unique one.

Parameters:

linestyle (str | Sequence[str]) -- The line style(s).

Return type:

None

set_markers(marker)[source]#

Set the marker(s) if n_items is non-zero or a unique one.

Parameters:

marker (str | Sequence[str]) -- The marker(s).

Return type:

None