Skip to content
Snippets Groups Projects
Commit 79d840a9 authored by Christoph.Knote's avatar Christoph.Knote
Browse files

Plotting routines updated.

parent 81e21d77
Branches
Tags
No related merge requests found
...@@ -45,7 +45,8 @@ class ExperimentPlotter: ...@@ -45,7 +45,8 @@ class ExperimentPlotter:
ax.legend() 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): xlabel='Time in h', ylabel=r'Flux in ppbv h$^{-1}$', plabel=None):
''' '''
Plot time series of fluxes through a species. Plot time series of fluxes through a species.
...@@ -64,10 +65,11 @@ class ExperimentPlotter: ...@@ -64,10 +65,11 @@ class ExperimentPlotter:
netflux = np.zeros(len(times)) netflux = np.zeros(len(times))
for xkey, xvalue in flx.iteritems(): for xkey, xvalue in flx.iteritems():
ax.plot(times, xvalue, label=xkey) ax.plot(times, xvalue * scale_factor, label=xkey)
netflux += np.array(xvalue) 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.plot(times, np.zeros(len(times)), lw=1, c='gray')
ax.grid( alpha=0.5 ) ax.grid( alpha=0.5 )
...@@ -80,7 +82,7 @@ class ExperimentPlotter: ...@@ -80,7 +82,7 @@ class ExperimentPlotter:
horizontalalignment='center', verticalalignment='center') horizontalalignment='center', verticalalignment='center')
if plot_legend: if plot_legend:
ax.legend(loc='top', fontsize="xx-small") ax.legend(loc='upper center', fontsize="xx-small")
return fig return fig
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment