monet.plots.sp_scatter_bias
- monet.plots.sp_scatter_bias(df, col1=None, col2=None, ax=None, outline=False, tight=True, global_map=True, map_kwargs={}, cbar_kwargs={}, val_max=None, val_min=None, **kwargs)
Create a spatial scatter plot showing the bias (difference) between two columns in a DataFrame.
- Parameters:
df (pandas.DataFrame) – DataFrame containing latitude, longitude, and data columns to compare.
col1 (str) – Name of the first column (reference value).
col2 (str) – Name of the second column (comparison value).
ax (matplotlib.axes.Axes, optional) – Axes to plot on. If None, creates a new map using draw_map.
outline (bool, default False) – Whether to show the map outline.
tight (bool, default True) – Whether to apply tight_layout to the figure.
global_map (bool, default True) – Whether to set global map boundaries (-180 to 180 longitude, -90 to 90 latitude).
map_kwargs (dict, default {}) – Keyword arguments passed to draw_map if creating a new map.
cbar_kwargs (dict, default {}) – Keyword arguments for colorbar customization.
val_max (float, optional) – Maximum value for color scaling. If None, uses 95th percentile of absolute differences.
val_min (float, optional) – Minimum value for color scaling (not currently used).
**kwargs (dict) – Additional keyword arguments passed to DataFrame.plot.scatter.
- Returns:
The axes object containing the plot.
- Return type:
Notes
The point size is scaled by the magnitude of the difference between col2 and col1, making larger differences more visually prominent. Differences are capped at 300 units for display purposes.