map_draw_uv#
- map_draw_uv(lon_min, lon_max, lat_min, lat_max, title, lon_data, lat_data, data_u, data_v, mask_ocean, path_save, name_save, quiver_max_n=10, quiver_scale=None, data_min=None, data_max=None)[source]#
Draw a 2D vector field (U–V components) on a Mercator map with colored speed shading.
- Parameters:
lon_min (float) – Minimum and maximum longitude boundaries of the map.
lon_max (float) – Minimum and maximum longitude boundaries of the map.
lat_min (float) – Minimum and maximum latitude boundaries of the map.
lat_max (float) – Minimum and maximum latitude boundaries of the map.
title (str) – Title displayed at the top of the figure.
lon_data (np.ndarray) – 2D array of longitudes (same shape as
data_uanddata_v).lat_data (np.ndarray) – 2D array of latitudes (same shape as
data_uanddata_v).data_u (np.ndarray) – 2D array of the U-component (zonal) of the vector field.
data_v (np.ndarray) – 2D array of the V-component (meridional) of the vector field.
mask_ocean (np.ndarray) – 2D mask array (same shape as data) with
1indicating valid (e.g., ocean) grid cells.path_save (str) – Directory path where the output PNG file will be saved.
name_save (str) – Base filename (without extension) for the saved image.
quiver_max_n (int, optional) – Maximum number of quiver arrows per axis. The grid is automatically downsampled to at most
quiver_max_n × quiver_max_narrows. Default is 10.quiver_scale (float, optional) – Scaling factor for quiver arrow lengths. If
None, Matplotlib chooses automatically. Examples:50,100.data_min (float, optional) – User-specified minimum and maximum color limits. If
None, they are derived from the 5th and 95th percentiles ofdata_draw.data_max (float, optional) – User-specified minimum and maximum color limits. If
None, they are derived from the 5th and 95th percentiles ofdata_draw.
- Returns:
The plot is saved as a PNG image in
path_savewith a random 5-digit suffix.- Return type:
None