sensortoolkit.plotting._plot_formatting.sensor_subplot_formatting

sensor_subplot_formatting(number_of_sensors, param_obj, report_fmt, **kwargs)[source]

Configure subplot parameters that control the spacing of subplots, number of subplots and dimensions of the Matplotliub axes object array, color bar formatting, etc.

Parameters
  • number_of_sensors (int) – The number of sensors to display in the figure.

  • param_obj (sensortoolkit.Parameter) – The parameter correpsonding to measurement data that will be displayed in the figure.

  • report_fmt (bool) – 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.

Keyword Arguments:

Parameters
  • show_colorbar (bool) – If true, a colorbar will be displayed on figures indicating the relative humidity recorded at the same time as the sensor-reference measurement pairs. The RH is superimposed as a colormap on the sensor-reference measurement pair scatter. Defaults to True.

  • sensor_serials (dict) – A dictionary of unique serial identifiers corresponding to each sensor in the evaluation group. Defaults to None.

Raises
  • ValueError – Raise if the number of sensors does not correspond to

  • one of the preset configurations (presets for number_of_sensors <= 9)

Returns

17-element tuple containing:

  • Nr (int): The number of rows of subplots for the figure instance.

  • Nc (int): The number of columns of subplots for the figure instance.

  • fig_size (tuple): The size of the figure instance (x_width, y_width).

  • suptitle_xpos (float): The relative x-coordinate position of the figure title.

  • suptitle_ypos (float): The relative y-coordinate position of the figure title.

  • title_text_wrap (int): The number of characters to include on a single line of the title before inserting a new line.

  • detail_fontsize (int or float): Fontsize for axes tick labels and smaller plotting text elements..

  • wspace (float): The width (x-distance) between each subplot.

  • hspace (float): The height (y-distance) between each subplot.

  • left (float): The left-most (x-min) limits at which the subplots will be drawn.

  • right (float): The right-most (x-max) limits at which the subplots will be drawn.

  • top (float): The top-most (y-max) limits at which the subplots will be drawn.

  • bottom (float): The bottom-most (y-min) limits at which the subplots will be drawn.

  • filename_suffix (str): A string indicating the number of sensors for which subplots are drawn in the figure, added to filename when saving figure to png.

  • cbar_padding (float): Padding between the colorbar and the figure subplots.

  • cbar_aspect (int or float): The aspect ratio (width / height) of the colorbar for relative humidity measurements.

  • font_size (int or float): The font size for text displayed in the figure.

Return type

(tuple)