Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les fondamentaux
Voir le programme détaillé
Module « matplotlib.figure »

Classe « LayoutEngine »

Informations générales

Héritage

builtins.object
    LayoutEngine

Définition

class LayoutEngine(builtins.object):

help(LayoutEngine)

Base class for Matplotlib layout engines.

A layout engine can be passed to a figure at instantiation or at any time
with `~.figure.Figure.set_layout_engine`.  Once attached to a figure, the
layout engine ``execute`` function is called at draw time by
`~.figure.Figure.draw`, providing a special draw-time hook.

.. note::

   However, note that layout engines affect the creation of colorbars, so
   `~.figure.Figure.set_layout_engine` should be called before any
   colorbars are created.

Currently, there are two properties of `LayoutEngine` classes that are
consulted while manipulating the figure:

- ``engine.colorbar_gridspec`` tells `.Figure.colorbar` whether to make the
   axes using the gridspec method (see `.colorbar.make_axes_gridspec`) or
   not (see `.colorbar.make_axes`);
- ``engine.adjust_compatible`` stops `.Figure.subplots_adjust` from being
    run if it is not compatible with the layout engine.

To implement a custom `LayoutEngine`:

1. override ``_adjust_compatible`` and ``_colorbar_gridspec``
2. override `LayoutEngine.set` to update *self._params*
3. override `LayoutEngine.execute` with your implementation

Constructeur(s)

Signature du constructeur Description
__init__(self, **kwargs)

Liste des propriétés

Nom de la propriétéDescription
adjust_compatible
colorbar_gridspec

Liste des opérateurs

Opérateurs hérités de la classe object

__eq__, __ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
execute(self, fig)
get(self)
set(self, **kwargs)

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __getstate__, __hash__, __init_subclass__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Vous êtes un professionnel et vous avez besoin d'une formation ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé