From 96183af9af136da565a3e7396346a8f9d3302f31 Mon Sep 17 00:00:00 2001 From: Luca Ceresoli Date: Sun, 12 Oct 2014 12:52:21 +0200 Subject: [PATCH] scripts/graph-build-time: clarify backend selection This instruction in the middle of 'import' lines looks very strange. Also, it was not obvious to me what the 'Agg' backend is. Both things are actually correct, but it took a while to find out why. So clarify with a comment to save someone else's time. [Peter: fix s/soe/some/ typo] Signed-off-by: Luca Ceresoli Cc: Sascha Arthur Cc: "Yann E. MORIN" Cc: Thomas Petazzoni Signed-off-by: Luca Ceresoli Acked-by: "Yann E. MORIN" Signed-off-by: Peter Korsgaard --- support/scripts/graph-build-time | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/support/scripts/graph-build-time b/support/scripts/graph-build-time index 4bb90c278b..433cd41d73 100755 --- a/support/scripts/graph-build-time +++ b/support/scripts/graph-build-time @@ -52,7 +52,12 @@ import matplotlib as mpl import numpy +# Use the Agg backend (which produces a PNG output, see +# http://matplotlib.org/faq/usage_faq.html#what-is-a-backend), +# otherwise an incorrect backend is used on some host machines). +# Note: matplotlib.use() must be called *before* matplotlib.pyplot. mpl.use('Agg') + import matplotlib.pyplot as plt import matplotlib.font_manager as fm import csv -- 2.30.2