tick_params

ColorBar.tick_params(what='colorbar', **kwargs)

Set the appearance of the colorbar (or histogram) ticks.

Note

This is a wrapper for m.colorbar.ax_cb.tick_params or m.colorbar.ax_cb_plot.tick_params to set the appearance of the ticks for the colorbar or the histogram.You can select what you want to edit with the additional parameter:

what: {β€˜colorbar’, β€˜histogram’}, default: β€˜colorbar’
  • β€˜colorbar’ : colorbar ticks (same as m.colorbar.ax_cb.tick_params)

  • β€˜histogram’ : histogram ticks (same as m.colorbar.ax_cb_plot.tick_params)


Change the appearance of ticks, tick labels, and gridlines.

Tick properties that are not explicitly set using the keyword arguments remain unchanged unless reset is True. For the current style settings, see .Axis.get_tick_params.

Parameters:
  • axis ({'x', 'y', 'both'}, default: 'both') – The axis to which the parameters are applied.

  • which ({'major', 'minor', 'both'}, default: 'major') – The group of ticks to which the parameters are applied.

  • reset (bool, default: False) – Whether to reset the ticks to defaults before updating them.

  • direction ({'in', 'out', 'inout'}) – Puts ticks inside the Axes, outside the Axes, or both.

  • length (float) – Tick length in points.

  • width (float) – Tick width in points.

  • color (color) – Tick color.

  • pad (float) – Distance in points between tick and label.

  • labelsize (float or str) – Tick label font size in points or as a string (e.g., β€˜large’).

  • labelcolor (color) – Tick label color.

  • labelfontfamily (str) – Tick label font.

  • colors (color) – Tick color and label color.

  • zorder (float) – Tick and label zorder.

  • bottom (bool) – Whether to draw the respective ticks.

  • top (bool) – Whether to draw the respective ticks.

  • left (bool) – Whether to draw the respective ticks.

  • right (bool) – Whether to draw the respective ticks.

  • labelbottom (bool) – Whether to draw the respective tick labels.

  • labeltop (bool) – Whether to draw the respective tick labels.

  • labelleft (bool) – Whether to draw the respective tick labels.

  • labelright (bool) – Whether to draw the respective tick labels.

  • labelrotation (float) – Tick label rotation

  • grid_color (color) – Gridline color.

  • grid_alpha (float) – Transparency of gridlines: 0 (transparent) to 1 (opaque).

  • grid_linewidth (float) – Width of gridlines in points.

  • grid_linestyle (str) – Any valid .Line2D line style spec.

Examples

ax.tick_params(direction='out', length=6, width=2, colors='r',
               grid_color='r', grid_alpha=0.5)

This will make all major ticks be red, pointing out of the box, and with dimensions 6 points by 2 points. Tick labels will also be red. Gridlines will be red and translucent.