From 32e2e61f04344e8c71e3cb1ba56dcedb69ec3ef1 Mon Sep 17 00:00:00 2001 From: 83bf50fc8bf8249d7a09086058f8c99d Date: Sat, 11 Jul 2020 20:55:43 +0000 Subject: [PATCH] Alternative pour la modification de l'option backend --- .../tuto_emacs_windows/tuto_emacs_windows.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/documents/tuto_emacs_windows/tuto_emacs_windows.md b/documents/tuto_emacs_windows/tuto_emacs_windows.md index 8b816be..447a1f3 100644 --- a/documents/tuto_emacs_windows/tuto_emacs_windows.md +++ b/documents/tuto_emacs_windows/tuto_emacs_windows.md @@ -59,7 +59,8 @@ python -m pip install -U matplotlib - Désactiver les plots interactifs dans matplotlib -Pour ce faire, il faut d'abord savoir où se trouve le fichier de configuration de matplotlib sous Windows. +Pour ce faire, il faut d'abord savoir où se trouve le fichier de configuration +de `matplotlib` sous Windows. Exécuter le code suivant sous Python @@ -90,6 +91,18 @@ Si vous devez passer d'un logiciel à l'autre, je suggère d'avoir deux fichiers `matplotlibrc`, un avec la ligne `backend: TkAgg` et un autre avec la ligne `backend: Agg`. +Une alternative est de conserver l'option `backend: TkAgg` dans le fichier +`matplotlibrc` et de définir l'option `backend` avant le chargement de `pyplot` : + +``` +import matplotlib +matplotlib.use('Agg') +from matplotlib import pyplot as plt +``` + +Il est bien sûr possible d'ajouter les deux lignes dans la définition du +raccourci `>PP` dans le fichier `init.el`. + --- --- -- 2.18.1