environmentaltools.graphics.cdf
- environmentaltools.graphics.cdf(data: DataFrame, var: str, ax=None, file_name: str = None, seaborn: bool = False, legend: str = False, label: str = None)[source]
Plot cumulative distribution function (CDF) of data.
Displays the empirical CDF either using custom ECDF calculation or seaborn’s distribution plot with cumulative option.
- Parameters:
data (pd.DataFrame) – Time series data.
var (str) – Name of the variable column to plot.
ax (matplotlib.axes.Axes, optional) – Axis for the plot. Creates new if None. Defaults to None.
file_name (str, optional) – File path to save the plot. If None, displays interactively. Defaults to None.
seaborn (bool) – If True, uses seaborn.distplot for CDF visualization. Defaults to False.
legend (bool) – If True, displays legend. Defaults to False.
label (str, optional) – Custom label for the plot. If None, uses variable name with units. Defaults to None.
- Returns:
The axis with the plot.
- Return type:
matplotlib.axes.Axes