monet.plots.spatial_bias_scatter
- monet.plots.spatial_bias_scatter(df, m, date, vmin=None, vmax=None, savename='', ncolors=15, fact=1.5, cmap='RdBu_r')
Create a scatter plot showing bias between model and observations on a map.
- Parameters:
df (pandas.DataFrame) – DataFrame containing ‘latitude’, ‘longitude’, ‘CMAQ’, and ‘Obs’ columns.
m (mpl_toolkits.basemap.Basemap) – Basemap instance for mapping.
date (str or datetime.datetime) – Date to filter the DataFrame. Only entries matching this date will be plotted.
vmin (float, optional) – Minimum value for colorscale. If None, automatically determined.
vmax (float, optional) – Maximum value for colorscale. If None, automatically determined.
savename (str, default “”) – If provided, save the figure to this path with date appended.
ncolors (int, default 15) – Number of discrete colors for the colorbar.
fact (float, default 1.5) – Scaling factor for point sizes.
cmap (str or matplotlib.colors.Colormap, default “RdBu_r”) – Colormap to use for bias values.
- Returns:
(figure, axes, colorbar) containing the matplotlib objects.
- Return type:
Notes
The scatter points are colored by the difference (CMAQ - Obs) and sized by the absolute magnitude of this difference, making larger biases more visible.