brightwind.analyse.plot.plot_timeseries

brightwind.analyse.plot.plot_timeseries(data, date_from='', date_to='', y_limits=(None, None))

Plot a timeseries of data.

Parameters
  • data (pd.DataFrame, pd.Series) – Data in the form of a Pandas DataFrame/Series to plot.

  • date_from (str) – Start date used for plotting, if not specified the first timestamp of data is considered. Should be in yyyy-mm-dd format

  • date_to (str) – End date used for plotting, if not specified last timestamp of data is considered. Should be in yyyy-mm-dd format

  • y_limits (tuple, None) – y-axis min and max limits. Default is (None, None).

Returns

Timeseries plot

Return type

matplotlib.figure.Figure

Example usage

import brightwind as bw
data = bw.load_csv(bw.datasets.demo_data)

# To plot few variables
bw.plot_timeseries(data[['Spd40mN', 'Spd60mS', 'T2m']])

# To set a start date
bw.plot_timeseries(data.Spd40mN, date_from='2017-09-01')

# To set an end date
bw.plot_timeseries(data.Spd40mN, date_to='2017-10-01')

# For specifying a slice
bw.plot_timeseries(data.Spd40mN, date_from='2017-09-01', date_to='2017-10-01')

# To set the y-axis minimum to 0
bw.plot_timeseries(data.Spd40mN, date_from='2017-09-01', date_to='2017-10-01', y_limits=(0, None))

# To set the y-axis maximum to 25
bw.plot_timeseries(data.Spd40mN, date_from='2017-09-01', date_to='2017-10-01', y_limits=(0, 25))