[Matplotlib-users] Bar graph color

2007-08-23 Thread Lee, Young-Jin
Hey guys,

 

I'm a new guy in here and amazed by the capability Matplotlib has. I
have a question for you, which might be a result of my ignorance or the
limitation of the current Matplotlib. I'm trying to make a bar chart
with hundreds of bars at different x positions with their own y values
(so called mass spectra) and would like to have different colors for
some of them, but the bar colors were never changed to what I intended.
Then, I realized because each bar is so narrow I can't see the color of
the bars but only outside lines (I see the colors by zooming it), which
I couldn't find a way to change the color. My question is, is there any
way either 1) to get rid of the outside lines or 2) to change the color
of the lines? Thanks much in advance!

 

Young Jin

 

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bar graph color

2007-08-23 Thread Eric Firing
Lee, Young-Jin wrote:
 Hey guys,
 
  
 
 I’m a new guy in here and amazed by the capability Matplotlib has. I 
 have a question for you, which might be a result of my ignorance or the 
 limitation of the current Matplotlib. I’m trying to make a bar chart 
 with hundreds of bars at different x positions with their own y values 
 (so called mass spectra) and would like to have different colors for 
 some of them, but the bar colors were never changed to what I intended. 
 Then, I realized because each bar is so narrow I can’t see the color of 
 the bars but only outside lines (I see the colors by zooming it), which 
 I couldn’t find a way to change the color. My question is, is there any 
 way either 1) to get rid of the outside lines or 2) to change the color 
 of the lines? Thanks much in advance!

For (1), use the linewidth=0 kwarg, e.g.:

barh(pos,val, align='center', linewidth=0)

Eric
 
  
 
 Young Jin
 
  
 
 
 
 
 -
 This SF.net email is sponsored by: Splunk Inc.
 Still grepping through log files to find problems?  Stop.
 Now Search log events and configuration files using AJAX and a browser.
 Download your FREE copy of Splunk now   http://get.splunk.com/
 
 
 
 
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bar graph color

2007-08-23 Thread Jouni K . Seppänen
Lee, Young-Jin [EMAIL PROTECTED] writes:

 Then, I realized because each bar is so narrow I can't see the color of
 the bars but only outside lines (I see the colors by zooming it), which
 I couldn't find a way to change the color. My question is, is there any
 way either 1) to get rid of the outside lines or 2) to change the color
 of the lines? Thanks much in advance!

To get rid of the lines, set the linewidth property of the bars to 0; 
to change their color, set the edgecolor property. For example, using
ipython -pylab:

In [31]: a=bar([1,2,3,4],[3,1,4,1],lw=0)

In [32]: setp(a[1], lw=10, ec='red')
Out[32]: [None, None]

Here I used the abbreviations lw and ec for linewidth and edgecolor. 
The first command creates a bar chart where all bars have line width 
zero, the second modifies one of the bars to have very thick red edges. 
You can experiment with the properties using the pylab commands getp 
and setp.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] stuck after a mpl_connect - how to disconnect and go on

2007-08-23 Thread Eric Emsellem
Hi

thanks a lot for this feedback!

Your example is quite nice indeed. However there is something I may not
have fully understand.
If I use the example you sketch, I of course need to call the displayer
class (right?), by doing something like:

test = displayer()

However, then I hit the same problem again: I would need to define ALL
the commands I wish to go through WITHIN the displayer class (and more
precisely into the show_next function), because any command put after
the test = displayer() would be executed anyway without waiting that I
finally hit the right mouse button.

Or is there something I didn't catch which would allow me to go around this?

(what my program is supposed to do at the end is to go through a series
of (3xdataframes), and for each dataframe in turn, use the offset
trick, then reinitialise everything and start with the next series...
This seems to imply that I need to specify the full set of commands
within the displayer class show_next function)

thanks again

Eric

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Looking for a way to save a graph

2007-08-23 Thread David Tremouilles
Hello,

 I would like to save a matplotlib figure (data, title and axes label,
plot properties, ...) to load it later on for modification.  Something
like figure.savelall(file.matplot) and later on do a
figure.loadall(file.matplot)  using an empty figure.

Did somebody already implement such a functionality?
If yes Is it available somewhere or are you eager to share it?

Thanks,

David

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Looking for a way to save a graph

2007-08-23 Thread Alex Pounds
On Thu, August 23, 2007 5:33 pm, David Tremouilles wrote:
  I would like to save a matplotlib figure (data, title and axes label,
 plot properties, ...) to load it later on for modification.  Something
 like figure.savelall(file.matplot) and later on do a
 figure.loadall(file.matplot)  using an empty figure.

I am but a humble newbie, but why not simply take your figure
object/reference and Pickle it (see
http://docs.python.org/lib/module-pickle.html)?

-- 
Alex Pounds (Creature)  .~.   http://www.alexpounds.com/
/V\  http://www.ethicsgirls.com/
   // \\
Variables won't; Constants aren't   /(   )\
   ^`~'^


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Looking for a way to save a graph

2007-08-23 Thread John Hunter
On 8/23/07, Alex Pounds [EMAIL PROTECTED] wrote:
 On Thu, August 23, 2007 5:33 pm, David Tremouilles wrote:
   I would like to save a matplotlib figure (data, title and axes label,
  plot properties, ...) to load it later on for modification.  Something
  like figure.savelall(file.matplot) and later on do a
  figure.loadall(file.matplot)  using an empty figure.

 I am but a humble newbie, but why not simply take your figure
 object/reference and Pickle it (see
 http://docs.python.org/lib/module-pickle.html)?

Reasonable request, reasonable solution, but alas neither will work.
The mpl extension code doesn't support pickling.

JDH

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Looking for a way to save a graph

2007-08-23 Thread Eric Firing
Alex Pounds wrote:
 On Thu, August 23, 2007 5:33 pm, David Tremouilles wrote:
  I would like to save a matplotlib figure (data, title and axes label,
 plot properties, ...) to load it later on for modification.  Something
 like figure.savelall(file.matplot) and later on do a
 figure.loadall(file.matplot)  using an empty figure.
 
 I am but a humble newbie, but why not simply take your figure
 object/reference and Pickle it (see
 http://docs.python.org/lib/module-pickle.html)?
 

Won't work.  Pickling only works for objects that have been designed for 
it.  Such design is not trivial for extension code, and has not been 
done for mpl.

Eric

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] stuck after a mpl_connect - how to disconnect and go on

2007-08-23 Thread Angus McMorland
Hi Eric,

On 23/08/07, Eric Emsellem [EMAIL PROTECTED] wrote:
 thanks a lot for this feedback!

 Your example is quite nice indeed. However there is something I may not
 have fully understand.
 If I use the example you sketch, I of course need to call the displayer
 class (right?), by doing something like:

 test = displayer()

 However, then I hit the same problem again: I would need to define ALL
 the commands I wish to go through WITHIN the displayer class (and more
 precisely into the show_next function), because any command put after
 the test = displayer() would be executed anyway without waiting that I
 finally hit the right mouse button.

I'm not sure why this is a problem. Yes, you need to put all your code
into the callback routines of displayer, but just think of it as
wrapping your program code inside the class. Your __main__ code then
simply becomes test = displayer()... and away you go.

Also, I realised shortly after sending my email that you can of course
do away with the offset class in this example, and put those methods
into the displayer class too, which will make things a little simpler.

 Or is there something I didn't catch which would allow me to go around this?

 (what my program is supposed to do at the end is to go through a series
 of (3xdataframes), and for each dataframe in turn, use the offset
 trick, then reinitialise everything and start with the next series...
 This seems to imply that I need to specify the full set of commands
 within the displayer class show_next function)

 thanks again

 Eric

Angus.
-- 
AJC McMorland, PhD Student
Physiology, University of Auckland

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users