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 length len(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 up

  • out_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_type and norm_args, as for polaris.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_args gives. A diverging field is plotted symmetrically about zero with vmin=-vmax.

  • vmax (float, optional) – The limits of the color map, each of which replaces the one norm_args gives. A diverging field is plotted symmetrically about zero with vmin=-vmax.

  • title (str, optional) – A title for the figure

  • colorbar_label (str, optional) – The label on the color bar, usually the units of da

  • x_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_interval when that one would have drawn more than MAX_CONTOUR_LINES of them, or None if no lines were asked for