sensortoolkit.plotting._timeseries.deployment_timeline
- deployment_timeline(deployment_df, cmap_name='Dark2', cmap_norm_range=(0.0, 0.75), fontsize=10, date_interval=1, fig_size=(11, 7), write_to_file=True, figure_path=None, tight_layout=False)[source]
A horizontal bar chart indicating the timeline during which sensors were deployed.
Sensors are depicted as stacked, colored horizontal bars spanning the beginning and end date of the deployment period.
More details about line 70-82 code on barh rounding at MatPlotLib documentation on Fancybox https://matplotlib.org/3.1.1/gallery/ shapes_and_collections/fancybox_demo.html
Other discrete colormaps: tab10_r, Dark2, Set2_r, tab20b
- Parameters
deployment_df (pandas DataFrame) – Dataframe containing the starting and ending timestamp for the deployment of each air sensor in the testing group.
cmap_name (str, optional) – The name of the Matplotlib colormap that will be used when drawing plot elements. Defaults to
'Dark2'
. A full list of colormaps is can be found in the Matplotlib documentationcmap_norm_range (Two-element tuple, optional) – A two-element tuple containing the normalized range of the colormap values that will be displayed in the figure. The full range of the selected colormap can be selected by passing (0, 1). Hues will be selected at equally spaced intervals within the normalized colormap range specified. Defaults to (.0, .75).
fontsize (int or float, optional) – The font size for text in figure elements. Defaults to 10.
date_interval (int, optional) – The interval (in months) at which dates along the x-axis of the figure will be indicated. Defaults to 1 (i.e., one month per tick).
fig_size (Two-element tuple, optional) – The dimensions (width, height) in inches of the Matplotlib figure to be drawn. Defaults to (11, 7).
write_to_file (bool, optional) – If true, the figure will be saved as a png image to the
[project_path]/figures
subdirectory. Defaults to True.figure_path (str) – The full directory path to the folder where figures are saved. This should be located at
[project_path]/figures
.tight_layout (bool, optional) – If True, Matplotlib’s
tight_layout()
method will be applied to reduce the padding around the subplot. Defaults to False.
- Returns
None.