Utilities for creating figures (fluiddyn.output.figs)


class fluiddyn.output.figs.Figure(size_axe=None, name_file=None, figures=None, **kwargs)[source]

Bases: Figure

One figure.

Improvement (?) of matplotlib.figure.Figure

size_axelist, optional

Size of the axe.

name_filestr, optional

Name of the file.


Set of figures.

kwargskeyword arguments

Given when create the figure.

set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, canvas=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, constrained_layout=<UNSET>, constrained_layout_pads=<UNSET>, dpi=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, figheight=<UNSET>, figwidth=<UNSET>, frameon=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, layout_engine=<UNSET>, linewidth=<UNSET>, mouseover=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, size_inches=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, tight_layout=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, zorder=<UNSET>)

Set multiple properties at once.

Supported properties are


agg_filter: a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image alpha: scalar or None animated: bool canvas: FigureCanvas clip_box: ~matplotlib.transforms.BboxBase or None clip_on: bool clip_path: Patch or (Path, Transform) or None constrained_layout: unknown constrained_layout_pads: unknown dpi: float edgecolor: color facecolor: color figheight: float figure: ~matplotlib.figure.Figure figwidth: float frameon: bool gid: str in_layout: bool label: object layout_engine: {‘constrained’, ‘compressed’, ‘tight’, ‘none’, .LayoutEngine, None} linewidth: number mouseover: bool path_effects: list of .AbstractPathEffect picker: None or bool or float or callable rasterized: bool size_inches: (float, float) or float sketch_params: (scale: float, length: float, randomness: float) snap: bool or None tight_layout: unknown transform: ~matplotlib.transforms.Transform url: str visible: bool zorder: float

saveifhasto(name_file=None, hastosave=None, verbose=True)[source]

Save the figure if hastosave is True.

name_filestr, optional

Name of the file (the extension has to indicate the format).

hastosavebool, optional

If True, save the figure.

verbose{True, bool}, optional

Print nothing if False.

class fluiddyn.output.figs.Figures(path_save=None, hastosave=False, for_beamer=False, for_article=False, fontsize=18, fontsize_pad=9)[source]

Bases: object

Represent a set of figures.

Utilities to plot and save figures with matplotlib.


Related to the path where to save.


If True, the function Figure.saveifhasto save the figure.


If True, use beamer layout.


If True, use article layout.

fontsize{18, int}

Font size of the text in the figures.

fontsize_pad{9, int}

Font size of the pad in the figures.

new_figure(name_file=None, num=None, fig_width_mm=200, fig_height_mm=150, size_axe=None)[source]

Create a new Figure object and return it.

numint, optional


fig_width_mm{200, number}, optional

Width (in mm)

fig_height_mm{150, number}, optional

Height (in mm)

size_axelist, optional

Size of the axe.

name_filestr, optional

Name of the file.



Show slightly more cleaver than old version of plt.show.


Figure([size_axe, name_file, figures])

One figure.

Figures([path_save, hastosave, for_beamer, ...])

Represent a set of figures.