Alphabetical list Categories
caxis Plot colorbar axis
Call signature:

caxis(title=None, ticks=None, labels=None, lim=None, flip=False)

Help text:

caxis plots a colorbar axis alongside the most recent cbar or hcbar.
All arguments are optional.
  title specifies a title for the axis.
  ticks specifies the locations of the ticks in terms of the data
    represented in the imsc for which the colorbar was drawn.
  labels specifies labels to be written by those ticks. If None,
    labels are derived from ticks. If [], no labels are written.
  lim specifies the ends of the axis, again in terms of the data
    represented in the imsc.
  flip specifies that the axis is rendered to the left or above the
    bar rather than to the right or below.


caxis interprets settings from ticklen, textdist, and axshift differently from xaxis and yaxis: positive values are away from the colorbar. Note that minorticks currently doesn't understand about this convention, so minorticks may produce unexpected results when used with caxis.

Example:

import pyqplot as qp

import numpy as np

qp.figure('caxis', 3, 3)

xx = np.tile(np.arange(11), (11,1))

yy = np.transpose(xx)

zz = np.cos(xx) * np.sin(yy)

qp.imsc(zz, [0, 0, 1, 1], c0=-1, c1=1)

qp.cbar()

qp.caxis('', np.arange(-1,1.1,1), ['negv', '0', 'posv'])

qp.caxis('', np.arange(-1,1.1,.2), [], flip=True)

qp.hcbar()

qp.caxis('', [-1, 0, 1])

qp.caxis('', [-.5, .5], [], flip=True)

QPlot Documentation — (C) Daniel Wagenaar, 2019