mpas_analysis.shared.plot.timeseries_analysis_plot¶
- mpas_analysis.shared.plot.timeseries_analysis_plot(config, dsvalues, calendar, title, xlabel, ylabel, movingAveragePoints=None, lineColors=None, lineStyles=None, markers=None, lineWidths=None, legendText=None, maxPoints=None, titleFontSize=None, defaultFontSize=None, figsize=(12, 6), dpi=None, firstYearXTicks=None, yearStrideXTicks=None, maxXTicks=20, obsMean=None, obsUncertainty=None, obsLegend=None, legendLocation='lower left', maxTitleLength=90)[source]¶
Plots the list of time series data sets.
- Parameters
config (instance of ConfigParser) – the configuration, containing a [plot] section with options that control plotting
dsvalues (list of xarray DataSets) – the data set(s) to be plotted
title (str) – the title of the plot
xlabel (str) – axis labels
ylabel (str) – axis labels
calendar (str) – the calendar to use for formatting the time axis
movingAveragePoints (int, optional) – the number of time points over which to perform a moving average
lineColors (list of str, optional) – control line color, style, marker, and corresponding legend text. Default is black, solid line with no marker, and no legend.
lineStyles (list of str, optional) – control line color, style, marker, and corresponding legend text. Default is black, solid line with no marker, and no legend.
markers (list of str, optional) – control line color, style, marker, and corresponding legend text. Default is black, solid line with no marker, and no legend.
legendText (list of str, optional) – control line color, style, marker, and corresponding legend text. Default is black, solid line with no marker, and no legend.
lineWidths (list of float, optional) – control line width. Default is 1.0.
maxPoints (list of {None, int}, optional) – the approximate maximum number of time points to use in a time series. This can be helpful for reducing the number of symbols plotted if plotting with markers. Otherwise the markers become indistinguishable from each other.
titleFontSize (int, optional) – the size of the title font
defaultFontSize (int, optional) – the size of text other than the title
figsize (tuple of float, optional) – the size of the figure in inches
dpi (int, optional) – the number of dots per inch of the figure, taken from section
plot
optiondpi
in the config file by defaultfirstYearXTicks (int, optional) – The year of the first tick on the x axis. By default, the first time entry is the first tick.
yearStrideXTicks (int, optional) – The number of years between x ticks. By default, the stride is chosen automatically to have
maxXTicks
tick marks or fewer.maxXTicks (int, optional) – the maximum number of tick marks that will be allowed along the x axis. This may need to be adjusted depending on the figure size and aspect ratio.
obsMean (list of float, optional) – Mean values and uncertainties for observations to be plotted as error bars. The two lists must have the same number of elements.
obsUncertainty (list of float, optional) – Mean values and uncertainties for observations to be plotted as error bars. The two lists must have the same number of elements.
obsLegend (list of str, optional) – The label in the legend for each element in
obsMean
(andobsUncertainty
)legendLocation (str, optional) – The location of the legend (see
pyplot.legend()
for details)maxTitleLength (int, optional) – the maximum number of characters in the title and legend, beyond which they are truncated with a trailing ellipsis
- Returns
fig (
matplotlib.figure.Figure
) – The resulting figure