xaxis(title='', ticks=None, labels=None, y=0, lim=None, flip=False)
All arguments are optional.
title specifies title for axis.
ticks specifies positions of ticks along axis. If None, ticks are
inferred using sensibleticks. If [], no ticks are drawn.
labels specifies labels to put by ticks. If None, tick coordinates
are used. If [], no labels are drawn.
y specifies intersect with y-axis. If None, defaults to a reasonable
position below the data. (Default is 0.)
lim specifies left and right edges as a tuple or list. If None,
lim is determined from ticks. If [], no line is drawn.
flip, if True, inverts the sign of the settings from ticklen, textdist,
and axshift.
Either ticks or labels (but not both) may be a function, in which case the labels are calculated from the tick positions (or vice versa). For example:
xaxis(0, lambda x: x/100, np.arange(0,101,25), 'value (%)')
Without any arguments or with just a title as an argument, xaxis tries to determine sensible defaults based on previous calls to plot and friends. Your mileage may vary.
import pyqplot as qp
import numpy as np
qp.figure('xaxis', 3, 3)
qp.xaxis('x-axis', np.arange(6))
qp.xaxis('', np.arange(6), ['zero', 'one', 'two', 'three', 'four', 'five'], y=1)
qp.xaxis('', np.arange(6), lambda x: '%g%%' % (10*x), y=2)
qp.xaxis('', np.arange(1,5), lim=[0, 5], y=3)
qp.xaxis('', np.arange(6), [], y=4)
qp.xaxis('top orientation', np.arange(6), y=5, flip=True)
qp.shrink()