geocat.viz.util.set_axes_limits_and_ticks

geocat.viz.util.set_axes_limits_and_ticks#

geocat.viz.util.set_axes_limits_and_ticks(ax, xlim=None, ylim=None, xticks=None, yticks=None, xticklabels=None, yticklabels=None)#

Utility function to determine axis limits, tick values and labels.

The intent of this function is to help developers use only this convenience function instead of multiple matplotlib.axes.Axes functions, when applicable.

Parameters:
  • ax (matplotlib.axes.Axes, cartopy.mpl.geoaxes.GeoAxesSubplot) – Current axes to the current figure

  • xlim (tuple) – Should be given as a tuple of numeric values (left, right), where left and right are the left and right x-axis limits in data coordinates. Passing None for any of them leaves the limit unchanged. See Matplotlib documentation for further information.

  • ylim (tuple) – Should be given as a tuple of numeric values (left, right), where left and right are the left and right y-axis limits in data coordinates. Passing None for any of them leaves the limit unchanged. See Matplotlib documentation for further information.

  • xticks (list) – List of x-axis tick locations. See Matplotlib documentation for further information.

  • yticks (list) – List of y-axis tick locations. See Matplotlib documentation for further information.

  • xticklabels (list) – List of string labels for x-axis ticks. See Matplotlib documentation for further information.

  • yticklabels (list) – List of string labels for y-axis ticks. See Matplotlib documentation for further information.

Examples

All usage examples are within the GeoCAT-Examples Gallery. To see more usage cases, search the function on the website.