"Derek Hohls" <DHohls@...1229...> writes:
In : ax.set_xlim()?
Object `ax.set_xlim()` not found.
You need to do ax.set_xlim? without the parentheses.
"The list you want is precisely the output of the getp command."
But for the getp? , I get:
I meant the output of the actual getp command, not its help text. E.g.
alpha = 1.0
animated = False
y = 0.0
zorder = 1
gives you the list of properties settable with setp. Similarly
getp(gca()) gives you a long list of properties, including xticklines.
The matplotlabprc file has a clearly labelled line that
addresses part of this:
xtick.major.size : 2 # major tick size in points
but of course I would like to do this in code.
I guess it isn't very obvious how to do this with setp. It is the
markersize property (which has the abbreviation ms):
In :setp(getp(gca(), 'xticklines'), 'ms', 10)
Note that here getp returns a list of objects, and setp sets the
property on every object in the list.
But if you already know what something is called in the matplotlibrc
file, you can set it programmatically:
In :rc('xtick.major', size=5, pad=20)
The rc settings do not affect existing images, so you have to make a
new plot before you see the effect:
In :figure(); bar([1,2,3],[4,5,6])
I guess that, overall, I have been expecting matplotlib to
have a simple "dot" notation throughout -
xaxis.xtick.major.size = 2
The getp/setp methods are part of matplotlib's pylab interface, which
is designed to reproduce Matlab's "handle graphics". There is also an
OO interface, which looks like this (this is the agg_oo.py example
from the examples subdirectory):
fig = Figure()
canvas = FigureCanvas(fig)
ax = fig.add_subplot(111)
I seem to recall some discussion about making it more Pythonic, e.g.
allowing you to do
ax.title = 'hi mom'
ax.xlabel = 'time'
but I don't know whether it is a high priority for any of the