diff --git a/boxmox/plotter.py b/boxmox/plotter.py index d7261f43c3e0e9bd3b7d518dc90fb7a375a0cf3e..839bafa8c998bf71931573be409ea1e1d44be668 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