[Matplotlib-users] Getting started with bar charts

2006-08-21 Thread Derek Hohls
The matplotlib philosophy is one of "make easy things easy" - which I
totally agree with.

I am a new user of matplotlib; and a relatively new Python programmer. 
I am trying to produce some bar charts for a colleague, in an attempt to
show how easy it is to do this with Python/matplotlib (as opposed to the
old Excel/cut-n-paste approach!).  

I think I have got the basics OK (two subplots), but I am struggling
with what *I* think  should be trivial tasks - such as setting line
widths, font sizes, bar colours etc.  The examples do not really seem to
deal with these issues, and in fact the homepage implies these are for a
"power user", which I find strange because these are some of the first
things most users want to "fiddle" with!  What I have done as a
temporary fix is alter all the settings in the matplotprc file; but this
is not ideal as these settings affect *all* charts.

It appears the manual (which I assume might be able to help me) is not
"downloadable".  The link :
http://matplotlib.sourceforge.net/users_guide_0.87.1.pdf 
results in a 2.41MB PDF file, which Acrobat Reader reports is
"damaged". (I also noticed when running
the download, that the download manager seemed to be expecting a 4.5MB
file?)

The example:
http://www.scipy.org/Cookbook/Matplotlib/BarCharts 
shows how to setup labels for a bar chart - but it would be great if
there was a line-by-line explanation of what each step means; its not
very clear!

The last point of "mystery" to me is that of "plot" vs "subplot" vs
"bar" - are these all essentially the same family of object, with some
differences in their capabilities - or vastly different beasts?

Any help with these "newbie" issues would be appreciated!

Thanks
Derek


-- 
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
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html 
 
CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html 
 
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
[EMAIL PROTECTED]


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.


-
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
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Getting started with bar charts

2006-08-21 Thread Bill Baxter
If you can't find help anywhere else, the matlab documentaiton may be helpful.Most of the matplotlib functions are taken right from there.
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/plot.htmlhttp://www.mathworks.com/access/helpdesk/help/techdoc/ref/subplot.html
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/bar.html--bbOn 8/21/06, 
Derek Hohls <[EMAIL PROTECTED]> wrote:
The matplotlib philosophy is one of "make easy things easy" - which Itotally agree with.I am a new user of matplotlib; and a relatively new Python programmer.I am trying to produce some bar charts for a colleague, in an attempt to
show how easy it is to do this with Python/matplotlib (as opposed to theold Excel/cut-n-paste approach!).I think I have got the basics OK (two subplots), but I am strugglingwith what *I* think  should be trivial tasks - such as setting line
widths, font sizes, bar colours etc.  The examples do not really seem todeal with these issues, and in fact the homepage implies these are for a"power user", which I find strange because these are some of the first
things most users want to "fiddle" with!  What I have done as atemporary fix is alter all the settings in the matplotprc file; but thisis not ideal as these settings affect *all* charts.It appears the manual (which I assume might be able to help me) is not
"downloadable".  The link :http://matplotlib.sourceforge.net/users_guide_0.87.1.pdfresults in a 2.41MB PDF file, which Acrobat Reader reports is
"damaged". (I also noticed when runningthe download, that the download manager seemed to be expecting a 4.5MBfile?)The example:
http://www.scipy.org/Cookbook/Matplotlib/BarChartsshows how to setup labels for a bar chart - but it would be great ifthere was a line-by-line explanation of what each step means; its notvery clear!
The last point of "mystery" to me is that of "plot" vs "subplot" vs"bar" - are these all essentially the same family of object, with somedifferences in their capabilities - or vastly different beasts?
Any help with these "newbie" issues would be appreciated!ThanksDerek--
-
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
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Getting started with bar charts

2006-08-21 Thread Jouni K Seppanen
"Derek Hohls" <[EMAIL PROTECTED]> writes:

> It appears the manual (which I assume might be able to help me) is not
> "downloadable".  The link :
> http://matplotlib.sourceforge.net/users_guide_0.87.1.pdf 

For some reason, downloading this file fails quite often. Perhaps it
should be distributed using the same sf.net download mechanism as the
software itself?

Try using some software that knows how to resume interrupted
downloads. E.g., run

curl -O -C - http://matplotlib.sourceforge.net/users_guide_0.87.1.pdf

as many times as needed to get the whole file.

> http://www.scipy.org/Cookbook/Matplotlib/BarCharts 
> shows how to setup labels for a bar chart - but it would be great if
> there was a line-by-line explanation of what each step means

I think the best way to understand the examples is to start up
"ipython -pylab", copy/paste the examples line by line, inspect the
resulting objects, get help on the mysterious functions (e.g. type
?gca in ipython to find out what gca does), form hypotheses on what
the various steps do, and test the hypotheses with experiments.

> setting line widths, font sizes, bar colours etc

bar returns a list of Rectangle objects:

In [19]: bar([1,2,3], [4,5,6])
Out[19]:
[,
 ,
 ]

Capture these objects and use getp and setp on them:

In [20]: recs = _

In [21]: getp(recs[0])

  ...

In [22]: setp(recs[0], 'facecolor')
facecolor: any matplotlib color - see help(colors)

In [23]: help(colors)

  ...

In [24]: setp(recs[0], 'facecolor', 'red')
Out[24]: [None]

For font sizes you need to get a handle to the relevant Text objects. 
For axis texts, look at the object returned by gca():

In [36]: setp(getp(gca(), 'yticklabels'), 'fontsize', 18)

Most of these settings are easier to do by using keyword arguments of
the initial commands:

In [38]: bar([1,2,3], [4,5,6], color=['red', 'green', 'blue'])

But the getp/setp method is great for tuning the image interactively
and learning about what can be customized.

-- 
Jouni


-
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
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] downloading users_guide, was Re: Re: Getting started with bar charts

2006-08-21 Thread George Nurser
On 21/08/06, Jouni K Seppanen <[EMAIL PROTECTED]> wrote:
> "Derek Hohls" <[EMAIL PROTECTED]> writes:
>
> > It appears the manual (which I assume might be able to help me) is not
> > "downloadable".  The link :
> > http://matplotlib.sourceforge.net/users_guide_0.87.1.pdf
>
> For some reason, downloading this file fails quite often.

I've had this problem too. On a 10.4.7 Mac, using Safari, I find that
a simple click on the link fails.

On the other hand, right clicking (or with a 1 button mouse holding
down alt and clicking) and then releasing on
'download linked file' from the drop down menu normally works.


George.

-
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
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Getting started with bar charts

2006-08-21 Thread Jouni K Seppänen
Hi Derek,

[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  
manual.

> In your example below, you go from line [21]
>   getp(recs[0])
> to line[22]
>   setp(recs[0], '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  
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:
> colour=['125','125','250']

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  
again:

 In [11]: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 [12]: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 [13]: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 [14]:figure(); bar([0,1], [3,1], color='#7d7dfa');

-- 
Jouni




-
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
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] downloading users_guide, was Re: Re: Getting started with bar charts

2006-08-21 Thread Darren Dale
On Monday 21 August 2006 06:20, George Nurser wrote:
> On 21/08/06, Jouni K Seppanen <[EMAIL PROTECTED]> wrote:
> > "Derek Hohls" <[EMAIL PROTECTED]> writes:
> > > It appears the manual (which I assume might be able to help me) is not
> > > "downloadable".  The link :
> > > http://matplotlib.sourceforge.net/users_guide_0.87.1.pdf
> >
> > For some reason, downloading this file fails quite often.
>
> I've had this problem too. On a 10.4.7 Mac, using Safari, I find that
> a simple click on the link fails.
>
> On the other hand, right clicking (or with a 1 button mouse holding
> down alt and clicking) and then releasing on
> 'download linked file' from the drop down menu normally works.

I dont have any trouble downloading, maybe there was a temporary problem with 
the sourceforge server.

Darren

-
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
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Getting started with bar charts

2006-08-21 Thread Derek Hohls
Jouni
 
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
like :
  In [9]: ax.set_xlim()?
 I get
  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.
 
You suggested:
"The list you want is precisely the output of the getp command."
But for the getp? , I get:

Type:   function
Base Class: 
String Form:
Namespace:  Interactive
File:   c:\python24\lib\site-packages\matplotlib\artist.py
Definition: getp(o, *args)
Docstring:
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
  o.get_somename()
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
eg
  linewidth or lw = 2
Example:
  plot(t,s)
  set(gca(), 'xlim', [0,10])  # set the x axis limits
or
  plot(t,s)
  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')
for example??
 
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:
http://matplotlib.sourceforge.net/matplotlib.axis.html#Tick 
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:
  lab.getp(lab.gca(), 'ylabel')
even though both appear to be dealing with a similar "thing" (a
Text object)??
 
  ***
 
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.
 
Derek


>>> Jouni K Seppänen <[EMAIL PROTECTED]> 2006/08/21 01:24 PM >>>

Hi Derek,

[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  
manual.

> In your example below, you go from line [21]
>   getp(recs[0])
> to line[22]
>   setp(recs[0], '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  
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:
> colour=['125','125','250']

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  
again:

 In [11]: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 [12]:figure(); bar([0,1], [3,1], color='lightcoral');

The syntax for shades of gray happens to be a string rep

[Matplotlib-users] Using toolbars modes considered safe ?

2006-08-21 Thread Daniel Kornhauser
I am using the Navigation toolbars mode and I wonder if  I should the 
attribute or if it can change in a future release ?

The attribute I am talking about is defined in backend_bases.py in 
NavigationToolbar2 in the __init__() method:

self.mode = ''  # a mode string for the status bar

The strings saved on the panning and zoom mode are kinda unconventional:

self.mode = 'pan/zoom mode'
or
self.mode = 'Zoom to rect mode'

Having the zoom word in both strings can be confusing, moreover they 
should start either with a lower case or upper case.

Can't they just be "zoom" or "pan" ?

Having just one word as a mode will remove confusion and make them 
easier to test when you are adding modes to the toolbar ...

 Just a suggestion.


 
  Daniel.


-
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
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] copy to graph to clipboard

2006-08-21 Thread Michael Schwager
Hi, thanks for the link to the screen capture tool.  I've been looking for
something like it (similar to MS OneNote sort of), but haven't found one.

The figure window by default has a button that allows you to save the image.

As for your increased precision, I recently discovered Python's decimal
package, http://www.python.org/dev/peps/pep-0327/

It allows you to specify arbitrary precision, and doesn't use hardware-based
floating point representation.  As far as I can tell, it manipulates digits
like you would do it on paper, keeping as many digits as you tell it.  Good
luck!

Michael

-Original Message-
From: [EMAIL PROTECTED] [mailto:matplotlib-

Incidentaly, I need to be able to find a way to increase the precision of 
Python but only while using an equation (or function?) that calculates gamma


In Python, double precision is already used,
how can a better precision be invoked for this code only?
Can it be done by in-line code or is a function needed?


-
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
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] extend for colorbar

2006-08-21 Thread James Boyle
I am using matplotlib 0.87.3

The documentation of colorbar in color.py seems to indicate that one 
should be able to create a color bar with pointed ends, the fill color 
of the ends corresponding to the over and under colors.

I have not been able to get this to work.  I have set the 
colormap.set_under and set_over values but no success.

If this does work could someone (Eric?) post an example, of how it is 
done. I feel that I am missing something simple.

Thanks for any help.

--Jim


-
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
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] extend for colorbar

2006-08-21 Thread Eric Firing
Jim,

Look at examples/image_masked.py.  I think that is the only example with 
pointed ends, and I think it was present as-is in 0.87.3.

Eric

James Boyle wrote:
> I am using matplotlib 0.87.3
> 
> The documentation of colorbar in color.py seems to indicate that one 
> should be able to create a color bar with pointed ends, the fill color 
> of the ends corresponding to the over and under colors.
> 
> I have not been able to get this to work.  I have set the 
> colormap.set_under and set_over values but no success.
> 
> If this does work could someone (Eric?) post an example, of how it is 
> done. I feel that I am missing something simple.
> 
> Thanks for any help.
> 
> --Jim
> 
> 
> -
> 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
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


-
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
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] 3d Plotting

2006-08-21 Thread rich kowalczyk
I understand that 3D plotting is not fully working yet, but I have a
question that might be answerable anyway.

I can get a nice looking 3D plot of my data using

surf = ax3d.plot_surface(x, y, z)

but I can't control the colors used in the plot.  I can do a

surf.set_array(ColorArray)

and the contents of the array (ColorArray) will be translated into
colors on the plot somehow, but the translation appears to be
arbitrary.  Does anyone know how the translation is done, so that I
can assign a certain color to a certain part of the plot?

Thanks,
Rich.

-
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
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 3d Plotting

2006-08-21 Thread Charlie Moad
The colors come from the current colormap.  You can go all out and
make your own colormap and color based on index using your map.  I
don't know how to do that off the top of my head though.

On 8/21/06, rich kowalczyk <[EMAIL PROTECTED]> wrote:
> I understand that 3D plotting is not fully working yet, but I have a
> question that might be answerable anyway.
>
> I can get a nice looking 3D plot of my data using
>
> surf = ax3d.plot_surface(x, y, z)
>
> but I can't control the colors used in the plot.  I can do a
>
> surf.set_array(ColorArray)
>
> and the contents of the array (ColorArray) will be translated into
> colors on the plot somehow, but the translation appears to be
> arbitrary.  Does anyone know how the translation is done, so that I
> can assign a certain color to a certain part of the plot?
>
> Thanks,
> Rich.
>
> -
> 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
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

-
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
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Getting started with bar charts

2006-08-21 Thread Jouni K Seppanen
"Derek Hohls" <[EMAIL PROTECTED]> writes:

>   In [9]: ax.set_xlim()?
>  I get
>   Object `ax.set_xlim()` not found.

You need to do ax.set_xlim? without the parentheses.

> You suggested:
> "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.

In [4]:recs=bar([1,2,3],[4,5,6])

In [5]:getp(recs)
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 [25]: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 [49]: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 [50]: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)
ax.plot([1,2,3])
ax.set_title('hi mom')
ax.grid(True)
ax.set_xlabel('time')
ax.set_ylabel('volts')
canvas.print_figure('test')

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
developers.

-- 
Jouni


-
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
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users