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=20
ax =3D 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 =3D value
linewidth or lw =3D 2
set(gca(), 'xlim', [0,10]) # set the x axis limits
a =3D 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 =3D 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=20
size the tick marks; setting those on the bottom X-axis to=20
a specific size, while disabling those on the top X-axis.=20=20
The matplotlabprc file has a clearly labelled line that=20
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 =3D 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 -=20
xaxis.xtick.major.size =3D 2
as this type of notation is readily easy to grasp and use,=20
but this preconception is blocking my grasp of how to use=20
the module 'as is'.
Again, apologies for the repetitive questions, and thanks for
patience in answering them.
>>> Jouni K Sepp=E4nen <jks@...> 2006/08/21 01:24 PM >>>
[Copying to matplotlib-users since an archive of this conversation=20=20
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=20=20
lacking! :-) Also, I think that the plot-customization possibilities=20=20
of matplotlib are pretty nicely discoverable (once you know about=20=20
getp/setp), and even if the pdf manual listed everything, it would be=20=20
easier to use the introspective facilities than look things up in the=20=20
> In your example below, you go from line 
> to line
> setp(recs, 'facecolor')
> 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=20=20
elided the output since it is quite long, but I guess I didn't make=20=20
it sufficiently clear.
> The other issue is the colour:
> colour=3D['red', 'green', 'blue'])
> implies I would write:
In hindsight, it was a bad idea on my part to make a barchart of=20=20
three bars and color them precisely red, green, and blue... let's try=20=20
In :bar(arange(10), cos(arange(10)), color=3D=20
['blanchedalmond', 'darkorchid', 'gainsboro', 'honeydew', 'hotpink',=20=20
'khaki', 'lavenderblush', 'mintcream', 'peachpuff', 'lemonchiffon']);
So you can give a list of colors to make the bars different colors.=20=20
(The color names are from matplotlib.colors.cnames.) If you want to=20=20
make everything the same color, give just one color, not a list:
In :figure(); bar([0,1], [3,1], color=3D'lightcoral');
The syntax for shades of gray happens to be a string representing a=20=20
number from 0 to 1:
In :figure(); bar([0,1], [3,1], color=3D'0.9');
If you want every bar to have the color with components 125, 125, 250=20=20
on a scale of 0..255, use hex notation:
In :figure(); bar([0,1], [3,1], color=3D'#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 easi=
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 C=
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 MailScan=
and is believed to be clean.