sensortoolkit.plotting._scatter.normalized_met_scatter
- normalized_met_scatter(df_list, ref_df, avg_df, met_ref_df=None, figure_path=None, param=None, met_param=None, sensor_name=None, write_to_file=True, sensor_serials=None, ref_name=None, report_fmt=False, fig=None, ax=None, return_mpl_obj=False, **kwargs)[source]
Plot parameter values normalized by reference values against either temperature or relative humidity.
- Parameters
df_list (list) – A list containing sensor datasets (1-hour averges) with parameter measurements.
ref_df (pandas DataFrame) – Reference dataset with collocated monitor measurements for the specified parameter.
avg_df (pandas DataFrame) – A dataset containing the intersensor average for concurrently recorded sensor measurements for each parameter measured by the air sensor.
met_ref_df (pandas DataFrame, optional) – Meteorological reference data (1-hour averages) for temperature, relative humidity, and dew point measurements. Defaults to None.
figure_path (str, optional) – Path to directory where the figure will be saved. Defaults to None.
param (str, optional) – Column header name for the parameter values to be plotted. Defaults to None.
met_param (str, optional) – The meteorological parameter plotted along the x-axis of the scatter plot. Defaults to None.
sensor_name (str, optional) – The name of the air sensor (make, manufacturer). Defaults to None.
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.sensor_serials (dict, optional) – A dictionary of sensor serial identifiers for each unit in the testing deployment. Defaults to None.
ref_name (str, optional) – The name of the reference monitor collocated alongside the air sensors that recorded concurrent measurement pairs for the specified parameter. Defaults to None.
report_fmt (bool, optional) – If true, select formatting presets for displaying figures on the reporting template for sensor performance evaluations included alongside US EPA’s performance targets documents for air sensors. Defaults to False.
fig (Matplotlib.figure.Figure, optional) – Optional, the Matplotlib figure on which axes object elements are drawn. Useful is the user is iterating over the Axes elements of a Matplotlib figure in a for-loop outside this plotting function. Within the loop, calls to this function can be made to add elements for each axes object. Defaults to None.
ax (matplotlib.axes._subplots.AxesSubplot, optional) – Optional, the Matplotlib Axes object on which plotting elements will be drawn. Useful is the user is iterating over the Axes elements of a Matplotlib figure in a for-loop outside this plotting function. Within the loop, calls to this function can be made to add elements for each axes object. Defaults to None.
return_mpl_obj (bool, optional) – If true, will return a Matplotlib axes instance (useful for iteration over subplot axes if this plotting function is called within a for-loop that is iterating over the axes elements in a Matplotlib subplot object). Defaults to False.
Keyword Arguments:
- Parameters
point_size (float or int, passed to Draw_Scatter()) – The size of the scatter points. Defaults to 12
point_alpha (float, passed to Draw_Scatter()) – The transparency of the scatter plots. Defaults to 0.5.
point_colors (list) – A list of strings indicating colors for each sensor scatter - either color hex codes or valid color names recognized by Matplotlib. Defaults to None.
xlims (Two-element tuple) – Set the x-limits of the plot. Defaults to None.
ylims (Two-element tuple) – Set the y-limits of the plot. Defaults to None.
cmap_norm_range (Two-element tuple) – 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, 0.4).
cmap_name (str, passed to Draw_Scatter()) – The name of the colormap which the scatter plot will be assigned. Defaults to ‘Set1’.
fontsize (int or float, passed to Draw_Scatter()) – The fontsize of plot titles and labels. Defaults to 12.
detail_fontsize (int or float, passed to Draw_Scatter()) – Fontsize for axes tick labels and smaller plotting text elements. Defaults to 10.
subplot_adjust (Seven-element tuple) –
Adjust the dimensions for drawing subplots on the Matplotlib Figure object. Passed to
Matplotlib.subplots.subplots_adjust()
. Contains the following entries:top: Modify the upper-most bounds of the figure.
bottom: Modify the lower-most bounds of the figure.
left: Modify the left-most bounds of the figure.
right: Modify the right-most bounds of the figure.
hspace: Modify the height of padding between subplots
wspace: Modify the width of padding between subplots
legend_pos: Two-element tuple containing floats indicating the x-axis and y-axis position of the center of the plot legend.
Defaults to None.
fig_wspace (float) – Modify the width of padding between subplots. Passed to
Matplotlib.subplots.subplots_adjust()
'wspace'
argument.fig_hspace (float) – Modify the height of padding between subplots.
'hspace'
argument.fig_left (float) – Modify the left-most bounds of the figure. Passed to
Matplotlib.subplots.subplots_adjust()
'left'
argument.fig_right (float) – Modify the right-most bounds of the figure. Passed to
Matplotlib.subplots.subplots_adjust()
'right'
argument.fig_top (float) – Modify the upper-most bounds of the figure. Passed to
Matplotlib.subplots.subplots_adjust()
'top'
argument.fig_bottom (float) – Modify the lower-most bounds of the figure. Passed to
Matplotlib.subplots.subplots_adjust()
'bottom'
argument.show_errorbars (bool) – If True, display errorbars (standard error) for normalized sensor-reference measurement pairs. Defaults to False.
show_legend (bool) – If True, display the figure legend. Defaults to True.
fig_size (Two-element tuple) – The dimensions (width, height) in inches of the Matplotlib figure to be drawn. Defaults to (8, 4).
errorbar_nbins (int) – The number of bins along the x-axis that data for the dependent variable are grouped into and displayed error bars. Defaults to 10 (i.e., 10 error bars equally spaced along the x-axis will be shown indicating the standard error in the dependent variable).
errorbar_color (str) – The color of the error bars drawn on the plot. Defaults to #151515.
legend_loc (Two-element tuple) – The x and y coordinate of center of the legend (relative to the axes object coordinates).
- Returns
The Matplotlib Axes object on which plotting elements will be drawn. Useful is the user is iterating over the Axes elements of a Matplotlib figure in a for-loop outside this plotting function. Within the loop, calls to this function can be made to add elements for each axes object. Returned if
return_mpl_obj
is True.- Return type
ax (Matplotlib Axes object)