From 79d840a99605ecac959419c89bcfa5513b72058a Mon Sep 17 00:00:00 2001
From: "Christoph.Knote" <christoph.knote@physik.uni-muenchen.de>
Date: Tue, 12 Dec 2017 15:57:27 +0100
Subject: [PATCH] Plotting routines updated.

---
 boxmox/plotter.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/boxmox/plotter.py b/boxmox/plotter.py
index d7261f4..839bafa 100644
--- a/boxmox/plotter.py
+++ b/boxmox/plotter.py
@@ -45,7 +45,8 @@ class ExperimentPlotter:
 
         ax.legend()
 
-    def fluxes(self, spec, fig=None, ax=None, plot_legend=True,
+    def fluxes(self, spec, fig=None, ax=None, plot_legend=True, plot_netflux=True,
+               scale_factor=3600.0 * 1000.0,
                xlabel='Time in h', ylabel=r'Flux in ppbv h$^{-1}$', plabel=None):
         '''
         Plot time series of fluxes through a species.
@@ -64,10 +65,11 @@ class ExperimentPlotter:
         netflux = np.zeros(len(times))
 
         for xkey, xvalue in flx.iteritems():
-            ax.plot(times, xvalue, label=xkey)
+            ax.plot(times, xvalue * scale_factor, label=xkey)
             netflux += np.array(xvalue)
 
-        ax.plot(times, netflux, label="Net flux", lw=2, c='k')
+        if plot_netflux:
+            ax.plot(times, netflux * scale_factor, label="Net flux", lw=2, c='k')
         ax.plot(times, np.zeros(len(times)), lw=1, c='gray')
 
         ax.grid( alpha=0.5 )
@@ -80,7 +82,7 @@ class ExperimentPlotter:
                      horizontalalignment='center', verticalalignment='center')
 
         if plot_legend:
-            ax.legend(loc='top', fontsize="xx-small")
+            ax.legend(loc='upper center', fontsize="xx-small")
 
         return fig
 
-- 
GitLab