polaris.viz.plot_lat_elevation_field
- polaris.viz.plot_lat_elevation_field(da, lat, z, out_filename, config, colormap_section, contour_interval=None, vmin=None, vmax=None, title=None, colorbar_label='', x_label='Latitude ($^{\\circ}$N)', y_label='Elevation (m)', figsize=(8.0, 5.0), dpi=None)[source]
Plot a field against latitude and elevation as filled contours with contour lines over them. The vertical axis is elevation in m, positive up.
- Parameters:
da (xarray.DataArray) – The two-dimensional field to plot, with one dimension of length
len(z)and one of lengthlen(lat). It is transposed as needed; when the two are the same length its dimensions are taken to be elevation and then latitude.lat (numpy.ndarray or xarray.DataArray) – The latitude of each column of
da, in degrees north. These are the positions the field is defined at, not cell boundaries.z (numpy.ndarray or xarray.DataArray) – The elevation of each row of
da, in m and positive upout_filename (str) – The image file to write
config (polaris.config.PolarisConfigParser) – The config options the color map is read from
colormap_section (str) – The name of a section in the config options. Options must include
colormap_name,norm_typeandnorm_args, as forpolaris.viz.setup_colormap().contour_interval (float, optional) – The spacing of the contour lines drawn over the fill, in the units of
da. Without it no contour lines are drawn.vmin (float, optional) – The limits of the color map, each of which replaces the one
norm_argsgives. A diverging field is plotted symmetrically about zero withvmin=-vmax.vmax (float, optional) – The limits of the color map, each of which replaces the one
norm_argsgives. A diverging field is plotted symmetrically about zero withvmin=-vmax.title (str, optional) – A title for the figure
colorbar_label (str, optional) – The label on the color bar, usually the units of
dax_label (str, optional) – The label on the latitude axis
y_label (str, optional) – The label on the elevation axis
figsize (tuple of float, optional) – The size of the figure in inches
dpi (int, optional) – Dots per inch for the saved image
- Returns:
contour_interval (float or None) – The interval the contour lines were actually drawn at, which is a round multiple of
contour_intervalwhen that one would have drawn more thanMAX_CONTOUR_LINESof them, orNoneif no lines were asked for