series = usgs.load_usgs_flows('02217770') """ Let's create a figure and add a subplot. """ fig = cpl.figure() fsp = fig.add_subplot(111) """ Let's call the :func:`plot_fdc` function to plot the corresponding flow duration curve. By default, the curve is plotted on the current subplot. We can also select a particular subplot with the :keyword:`subplot` parameter. We will use the additional parameters ``lw`` to specify the linewidth of the curve, ``ls`` for the linestyle, ``c`` for the color, and ``zorder`` for the priority order. """ cpl.plot_fdc(series, subplot=fsp, lw=2, ls='-', c='k', zorder=10) """ Let's add the FDCs for each water year. By default, the multiple curves are drawn using a linewidth of 0.8 and a grey color. """ cpl.plot_fdc(series, subplot=fsp, starting_month=4) """ We can now finalize the plot by adding some labels and legends. """ fsp.set_ylabel("Flows (cfs)", fontweight='bold') fig.suptitle("Flow duration curve for the North Oconee River at Athens, GA", fontweight="bold", fontsize=12) fig.savefig('athens_fdc.png')
import numpy as np import scikits.hydroclimpy as hydro import scikits.hydroclimpy.enso as enso import scikits.hydroclimpy.io.usgs as usgs import scikits.hydroclimpy.plotlib as cpl ONI = enso.load_oni() series = usgs.load_usgs_flows('02217770').fill_missing_dates() series = enso.set_ensoindicator(series, ONI) fig = cpl.figure() fsp = fig.add_subplot(111) cpl.plot_fdc(series, plot_enso=True, marker='o', markersize=6, ax=fsp) cpl.plot_fdc(series, plot_enso=True, starting_month=4, ax=fsp) fsp.legend() fsp.set_ylabel("Flows (cfs)", fontweight='bold') fig.suptitle("Flow duration curve for the North Oconee River at Athens, GA", fontweight="bold", fontsize=12)
import numpy as np import scikits.hydroclimpy as hydro import scikits.hydroclimpy.enso as enso import scikits.hydroclimpy.io.usgs as usgs import scikits.hydroclimpy.plotlib as cpl series = usgs.load_usgs_flows('02217770') fig = cpl.figure() fsp = fig.add_subplot(111) cpl.plot_fdc(series, ax=fsp, lw=2, ls='-', c='k', zorder=10) cpl.plot_fdc(series, ax=fsp, starting_month=4) fsp.set_ylabel("Flows (cfs)", fontweight='bold') fig.suptitle("Flow duration curve for the North Oconee River at Athens, GA", fontweight="bold", fontsize=12)
""" Let's create a figure and add a subplot. """ fig = cpl.figure() fsp = fig.add_subplot(111) """ Let's call the :func:`plot_fdc` function to plot the corresponding flow duration curve. By default, the curve is plotted on the current subplot. We can also select a particular subplot with the :keyword:`subplot` parameter. We will use the additional parameters ``lw`` to specify the linewidth of the curve, ``ls`` for the linestyle, ``c`` for the color, and ``zorder`` for the priority order. """ cpl.plot_fdc(series, subplot=fsp, lw=2, ls='-', c='k', zorder=10) """ Let's add the FDCs for each water year. By default, the multiple curves are drawn using a linewidth of 0.8 and a grey color. """ cpl.plot_fdc(series, subplot=fsp, starting_month=4) """ We can now finalize the plot by adding some labels and legends. """ fsp.set_ylabel("Flows (cfs)", fontweight='bold') fig.suptitle("Flow duration curve for the North Oconee River at Athens, GA", fontweight="bold", fontsize=12)