Partage via


Matplotlib

Databricks Runtime affiche les figures Matplotlib en ligne.

Exemple de notebook : Matplotlib

Le notebook suivant montre comment afficher des figures Matplotlib dans des notebooks Python.

Notebook Matplotlib Python

Obtenir l'ordinateur portable

Rendez les images à une résolution plus élevée

Il est possible d’afficher les images Matplotlib dans des notebooks Python au double de la résolution standard, offrant ainsi une meilleure expérience de visualisation aux utilisateurs d’écrans haute résolution. Définissez l’un des éléments suivants dans une cellule de notebook :

Option retina :

%config InlineBackend.figure_format = 'retina'

from IPython.display import set_matplotlib_formats
set_matplotlib_formats('retina')

Option png2x :

%config InlineBackend.figure_format = 'png2x'

from IPython.display import set_matplotlib_formats
set_matplotlib_formats('png2x')

Pour revenir à la résolution standard, ajoutez la commande suivante à une cellule de bloc-notes :

set_matplotlib_formats('png')

%config InlineBackend.figure_format = 'png'