act.plotting.TimeSeriesDisplay.plot

TimeSeriesDisplay.plot(field, dsname=None, subplot_index=(0,), cmap=None, set_title=None, add_nan=False, day_night_background=False, invert_y_axis=False, abs_limits=(None, None), time_rng=None, y_rng=None, use_var_for_y=None, set_shading='auto', assessment_overplot=False, overplot_marker='.', overplot_behind=False, overplot_markersize=6, assessment_overplot_category={'Incorrect': ['Bad', 'Incorrect'], 'Suspect': ['Indeterminate', 'Suspect']}, assessment_overplot_category_color={'Acceptable': ((0.0, 0.4240129715562796, 0.4240129715562796),), 'Bad': (0.9285714285714286, 0.7130901016453677, 0.7130901016453677), 'Incorrect': (0.9285714285714286, 0.7130901016453677, 0.7130901016453677), 'Not Failing': ((0.0, 0.4240129715562796, 0.4240129715562796),), 'Suspect': 'orange'}, force_line_plot=False, labels=False, cbar_label=None, cbar_h_adjust=None, y_axis_flag_meanings=False, colorbar_labels=None, cb_friendly=False, match_line_label_color=False, **kwargs)[source]

Makes a timeseries plot. If subplots have not been added yet, an axis will be created assuming that there is only going to be one plot.

If plotting a high data volume 2D dataset, it may take some time to plot. In order to speed up your plot creation, please resample your data to a lower resolution dataset.

Parameters:
  • field (str) – The name of the field to plot.

  • dsname (None or str) – If there is more than one datastream in the display object the name of the datastream needs to be specified. If set to None and there is only one datastream ACT will use the sole datastream in the object.

  • subplot_index (1 or 2D tuple, list, or array) – The index of the subplot to set the x range of.

  • cmap (matplotlib colormap) – The colormap to use.

  • set_title (str) – The title for the plot.

  • add_nan (bool) – Set to True to fill in data gaps with NaNs.

  • day_night_background (bool) – Set to True to fill in a color coded background. according to the time of day.

  • abs_limits (tuple or list) – Sets the bounds on plot limits even if data values exceed those limits. Set to (ymin,ymax). Use None if only setting minimum or maximum limit, i.e. (22., None).

  • time_rng (tuple or list) – List or tuple with (min, max) values to set the x-axis range limits.

  • y_rng (tuple or list) – List or tuple with (min, max) values to set the y-axis range

  • use_var_for_y (str) – Set this to the name of a data variable in the Dataset to use as the y-axis variable instead of the default dimension. Useful for instances where data has an index-based dimension instead of a height-based dimension. If shapes of arrays do not match it will automatically revert back to the original ydata.

  • set_shading (string) – Option to to set the matplotlib.pcolormesh shading parameter. Default to ‘auto’

  • assessment_overplot (boolean) – Option to overplot quality control colored symbols over plotted data using flag_assessment categories.

  • overplot_marker (str) – Marker to use for overplot symbol.

  • overplot_behind (bool) – Place the overplot marker behind the data point.

  • overplot_markersize (float or int) – Size of overplot marker. If overplot_behind or force_line_plot are set the marker size will be double overplot_markersize so the color is visible.

  • assessment_overplot_category (dict) – Lookup to categorize assessments into groups. This allows using multiple terms for the same quality control level of failure. Also allows adding more to the defaults.

  • assessment_overplot_category_color (dict) – Lookup to match overplot category color to assessment grouping.

  • force_line_plot (boolean) – Option to plot 2D data as 1D line plots.

  • labels (boolean or list) – Option to overwrite the legend labels. Must have same dimensions as number of lines plotted.

  • cbar_label (str) – Option to overwrite default colorbar label.

  • cbar_h_adjust (float) – Option to adjust location of colorbar horizontally. Positive values move to right negative values move to left.

  • y_axis_flag_meanings (boolean or int) – When set to True and plotting state variable with flag_values and flag_meanings attributes will replace y axis numerical values with flag_meanings value. Set to a positive number larger than 1 to indicate maximum word length to use. If text is longer that the value and has space characters will split text over multiple lines.

  • colorbar_labels (dict) – A dictionary containing values for plotting a 2D array of state variables. The dictionary uses data values as keys and a dictionary containing keys ‘text’ and ‘color’ for each data value to plot.

    Example:

    {0: {‘text’: ‘Clear sky’, ‘color’: ‘white’}, 1: {‘text’: ‘Liquid’, ‘color’: ‘green’}, 2: {‘text’: ‘Ice’, ‘color’: ‘blue’}, 3: {‘text’: ‘Mixed phase’, ‘color’: ‘purple’}}

  • cb_friendly (boolean) – Set to true if you want to use the integrated colorblind friendly colors for green/red based on the Homeyer colormap.

  • match_line_label_color (boolean) – Will set the y label to match the line color in the plot. This will only work if the time series plot is a line plot.

  • **kwargs (keyword arguments) – The keyword arguments for plt.plot() (1D timeseries) or plt.pcolormesh() (2D timeseries).

Returns:

ax (matplotlib axis handle) – The matplotlib axis handle of the plot.