Storm Depth Histograms

Setup the basic working environment


In [ ]:
import warnings

import matplotlib.pyplot as plt
import pandas
import seaborn

import pycvc

warnings.simplefilter("ignore")

palette = seaborn.color_palette('deep', n_colors=6)
seaborn.set(style='ticks', context='paper', rc={'text.usetex': False})
%matplotlib inline

Load Tidy Hydrologic Data


In [ ]:
hydro = pandas.read_csv('output/tidy/hydro_simple.csv')

Split by site name (color) and presence of outflow (row)


In [ ]:
fg = pycvc.viz.hydro_histogram(hydro, hue='site', row='has_outflow', save=False)
pycvc.viz.savefig(fg.fig, 'Hist_Site_Outflow', extra='HydroHistogram')

Split by site (row), presence of outflow (column), and season (hue)

Also use a blue-green to brown color palette.


In [ ]:
fg = pycvc.viz.hydro_histogram(hydro, row='site', col='has_outflow', hue='season',
                          hue_order=['winter', 'spring', 'summer', 'autumn'],
                          margin_titles=True, palette='BrBG_r', save=False)
pycvc.viz.savefig(fg.fig, 'Hist_Site_Outflow_Season', extra='HydroHistogram')

Split by years (hue) and outflow (columns, wrapped at 2 wide)


In [ ]:
fg = pycvc.viz.hydro_histogram(hydro, col='site', hue='year', col_wrap=2, save=False)
pycvc.viz.savefig(fg.fig, 'Hist_Site_Year', extra='HydroHistogram')

Just look at ED-1


In [ ]:
fg = pycvc.viz.hydro_histogram(hydro.query("site == 'ED-1'"), palette='Blues', save=False)
pycvc.viz.savefig(fg.fig, 'Hist_ED1only', extra='HydroHistogram')