ruins.plotting.stripes_heatmap
#
This module implements a stripes plot function that can create annual and monthly stripes plots from given climate and weather data. There is a matplotlib and a plotly version. The streamlit app uses the plotly version by default. The plotly plot is interactive and available in a German and English version, the matplotlib version is static and only available in English.
Module Contents#
Functions#
|
Prepare the given data for monthly and annual stripes to be plotted in a heatmap. |
|
|
|
|
|
Yearly stripes plot. |
- ruins.plotting.stripes_heatmap.yrplot_data(sr, ref=[1980, 2000], ag='sum', qa=0.95, cmxeq=True) Tuple[pandas.DataFrame, float, float] #
Prepare the given data for monthly and annual stripes to be plotted in a heatmap. The data is grouped and the limits for plotting are returned, based on the quantile given.
- ruins.plotting.stripes_heatmap._yrplot_matplotlib(sr, ref=[1980, 2000], ag='sum', qa=0.95, cbar_title='Temperature anomaly (K)', cmx='coolwarm', cmxeq=True, li=False)#
- ruins.plotting.stripes_heatmap._yrplot_plotly(sr, ref=[1980, 2000], ag='sum', qa=0.95, cbar_title='Temperature anomaly (K)', cmx='coolwarm', cmxeq=True, li=False, lang='en')#
- ruins.plotting.stripes_heatmap.yrplot_hm(sr, ref=[1980, 2000], ag='sum', qa=0.95, cbar_title='Temperature anomaly (K)', cmx='coolwarm', cmxeq=True, li=False, lang='en', backend='plotly')#
Yearly stripes plot. Creates a monthly resloved stripes plot for each year in the data. The data is plotted as a heatmap showing the Temperature anomaly to the passed reference period based on the adjustable quartile value.
- Parameters:
sr (pandas.DataFrame) – Input data originating from one ground station
ref (Tuple[int, int]) – Reference period to calculate the anomaly.
ag (str) – Reduction function to use. Can be used to calculate the temperature anomaly in ‘sum’, ‘min’, ‘max’ or ‘mean’
qa (float) – Quartile to use. Has to be between 0 and 1.
cbar_title (str) – Optional title for the colorbar
cmx (str) – Colorbar scale. Can be any string accepted by the plotting backend.
cmxeq (bool) – If True (default), the colorbar range is calculated for the full dataset.
lang (str) – Can be either
'en'
or ``’de’`. The language used for axis labels.backend (str) – Can be either
matplotlib
orplotly
. The plotting backend to use.