environmentaltools.graphics.bivariate_pdf
- environmentaltools.graphics.bivariate_pdf(df_sim: DataFrame, df_obs: DataFrame, variables: list, bins: int = None, levels: list = None, ax=None, file_name: str = None, logx: str = False, logy: str = False, contour: bool = False)[source]
Plot bivariate PDF comparison between observed and simulated data.
Creates side-by-side contour or image plots of the bivariate probability density functions for visual model validation.
- Parameters:
df_sim (pd.DataFrame) – Simulated time series data.
df_obs (pd.DataFrame) – Observed time series data.
variables (list) – List of two variable names [var1, var2] to plot.
bins (int or list, optional) – Number of bins for histogram. If None, uses [25, 25]. Defaults to None.
levels (list, optional) – Contour levels. If None, auto-computed. Defaults to None.
ax (matplotlib.axes.Axes, optional) – Axes 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.
logx (bool) – If True, applies log transform to first variable. Defaults to False.
logy (bool) – If True, applies log transform to second variable. Defaults to False.
contour (bool) – If True, uses contour plot instead of image. Defaults to False.
- Returns:
Array of axes with the plots.
- Return type:
matplotlib.axes.Axes