I have now loaded and tried to use iPython.
In some cases the xyz? command gives useful output -
in others, not.
So, if I have
ax = subplot(111)
Then ax? returns a number of get_ & set_ functions that
are available. So far, so good. But, if I try something
In : ax.set_xlim()?
Object `ax.set_xlim()` not found.
So, I cannot find out more about what setxlim() is meant to
do, or how it works? What I did do was go and look at the
class documentation on-line, and this info is available there.
"The list you want is precisely the output of the getp command."
But for the getp? , I get:
Base Class: <type 'function'>
String Form: <function getp at 0x00F67370>
Definition: getp(o, *args)
Return the value of handle property s
h is an instance of a class, eg a Line2D or an Axes or Text.
if s is 'somename', this function returns
getp can be used to query all the gettable properties with getp(o)
Many properties have aliases for shorter typing, eg 'lw' is an
alias for 'linewidth'. In the output, aliases and full property
names will be listed as
property or alias = value
linewidth or lw = 2
set(gca(), 'xlim', [0,10]) # set the x axis limits
a = gca()
a.set_xlim([0,10]) # does the same
(and gca? returns something along the same lines)
Which does *not* intuitively lead me to something like:
xticklines = getp(gca(), 'xticklines')
So - the question is how to get to find the items I need
to set - amongst others, I am still looking for something to
size the tick marks; setting those on the bottom X-axis to
a specific size, while disabling those on the top X-axis.
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 am sort of
guessing this has something to do with the Tick class:
but I cannot seem to work with Tick() ??
In addition, I cannot seem to see why some things work one way
and others - seemingly in the "same family" - do not. For example:
xticklabels = lab.getp(lab.gca(), 'xticklabels')
works just fine, and allows you set the font size, color etc for
the tick labels, whereas there is no:
even though both appear to be dealing with a similar "thing" (a
I guess that, overall, I have been expecting matplotlib to
have a simple "dot" notation throughout -
xaxis.xtick.major.size = 2
as this type of notation is readily easy to grasp and use,
but this preconception is blocking my grasp of how to use
the module 'as is'.
Again, apologies for the repetitive questions, and thanks for
patience in answering them.
Jouni K Seppänen <jks@...397...> 2006/08/21 01:24 PM >>>
[Copying to matplotlib-users since an archive of this conversation
could be helpful to others in the future.]
On 21.8.2006, at 13.34, Derek Hohls wrote:
Re the other suggestions you have made. While I appreciate the
"forming hypothesis" approach is good when venturing into the
unknown, it does seem a little strange when dealing with a known
item e.g. software.
But it *is* unknown to the extent that the documentation is
lacking! Also, I think that the plot-customization possibilities
of matplotlib are pretty nicely discoverable (once you know about
getp/setp), and even if the pdf manual listed everything, it would be
easier to use the introspective facilities than look things up in the
In your example below, you go from line 
Now, how did you know that there was 'facecolor' property that
could be set? How would one get a list of all these properties?
The list you want is precisely the output of the getp command. I
elided the output since it is quite long, but I guess I didn't make
it sufficiently clear.
The other issue is the colour:
colour=['red', 'green', 'blue'])
implies I would write:
In hindsight, it was a bad idea on my part to make a barchart of
three bars and color them precisely red, green, and blue... let's try
In :bar(arange(10), cos(arange(10)), color=
['blanchedalmond', 'darkorchid', 'gainsboro', 'honeydew', 'hotpink',
'khaki', 'lavenderblush', 'mintcream', 'peachpuff', 'lemonchiffon']);
So you can give a list of colors to make the bars different colors.
(The color names are from matplotlib.colors.cnames.) If you want to
make everything the same color, give just one color, not a list:
In :figure(); bar([0,1], [3,1], color='lightcoral');
The syntax for shades of gray happens to be a string representing a
number from 0 to 1:
In :figure(); bar([0,1], [3,1], color='0.9');
If you want every bar to have the color with components 125, 125, 250
on a scale of 0..255, use hex notation:
In :figure(); bar([0,1], [3,1], color='#7d7dfa');
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
Matplotlib-users mailing list
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
CSIR E-mail Legal Notice
CSIR Copyright, Terms and Conditions
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean.