SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S





1
(20)
2
(8)
3
(2)
4
(7)
5
(17)
6
(20)
7
(17)
8
(18)
9
(7)
10
(4)
11
(9)
12
(20)
13
(20)
14
(17)
15
(8)
16
(2)
17
(4)
18
(4)
19
(13)
20
(4)
21
(16)
22
(9)
23
(1)
24
(5)
25
(8)
26
(13)
27
(25)
28
(25)
29
(14)
30
(10)
31
(1)






Showing 25 results of 25

From: Vidar G. <vid...@37...> - 2005年07月28日 21:30:20
===== Original message from Alan G. Isaac | 2005年7月28日:
> More natural choices might be 
> - GAUSS - PDL - SciLab - Lush - Yorick - Algae - A+
thanks for the input.
how different are PDL, IDL and GDL?
aren't there a PyDL or pyIDL also?
or is this something different?
this resource might be useful for this, i guess?
"IDL to Numeric/numarray Mapping"
http://www.johnny-lin.com/cdat_tips/tips_array/idl2num.html
From: Vidar G. <vid...@37...> - 2005年07月28日 20:52:19
===== Original message from Matthew Brett | 2005年7月28日:
> If we want to contribute, what is the best way to do this?
> Edit the XML document and send patches?
yes, i think so. send to vidar+mpy(at)37mm.no
(i'll add a note in the document.)
also, note that contributions are highly appreciated.
From: Steve S. <el...@gm...> - 2005年07月28日 20:11:51
Hi
Is there another way to cycle through colors when repeating marker plots
except
c = 'bgrcmykw'
for i in range(...):
	plot(..., '+-' + c[i])
cheers,
steve
From: Clovis G. <cl...@pe...> - 2005年07月28日 20:07:47
Some days ago one collegue suggested that the matplotlibrc should
be hacked in order to accept a so-called "customtoolbar", in addition
to the 'classic' and 'toolbar2' options. I think that this feature
would not be complicated to implement, using the rcParams[ ... ] infrastructure.
Since I am rather new to Python and Matplotlib, I cannot evaluate all the
consequences.
Thanks,
Clovis
From: John H. <jdh...@ac...> - 2005年07月28日 19:57:22
I created a wiki page on the scipy web site for people to upload tips,
tricks, HOWTOs and recipes for matplotlib. Everyone is encouraged to
contribute; you just need to get a login for the scipy page from
http://www.scipy.org/wikis/topical_software/join_form .
One easy way to contribute is to take a file from the examples
directory and explain and annotate it and place it on the wiki. You
can also upload images to show off your work. Beyond that, everything
is fair game: from a tutorial freezing mpl with py2exe to embedding
mpl in your favorite GUI to doing animations.
To get the ball rolling, I cleaned up my last post to the mailing list
and posted it with a screenshot 
 http://www.scipy.org/wikis/topical_software/MatplotlibCookbook
Thanks to scipy.org and enthought for hosting!
JDH
From: John H. <jdh...@ac...> - 2005年07月28日 19:47:21
>>>>> "Chris" == Chris Barker <Chr...@no...> writes:
 Chris> Are you keeping a collection of all these little examples
 Chris> around? In a Wiki, perhaps?
Only in the mailing list archives... until now :-) wiki announcement to
follow!
JDH
From: Alan G I. <ai...@am...> - 2005年07月28日 19:16:12
On 2005年7月28日, Vidar Gundersen apparently wrote: 
> i've also been wondering about including 
> Maple, Axiom, Maxima equivalent commands, although these 
> are computer algebra systems, as it seems these packages 
> also have numeric capabilities. 
More natural choices might be 
- GAUSS 
- PDL 
- SciLab 
- Lush 
- Yorick 
- Algae 
- A+ 
And perhaps Mathematica, given rumors I've recently heard 
about greater ease in doing linear algebra in the recent 
version. 
Cheers, 
Alan Isaac 
From: Matthew B. <mat...@gm...> - 2005年07月28日 18:39:54
Hi,
> while learning to use Python as an alternative to MATLAB,
> i've started working on a cross reference showing
> equivalent commands in MATLAB/Octave, Python (with Numeric
> and matplotlib) and R. examples are provided for plotting
> commands.
Thank you very much for this excellent resource.
=20
> still draft quality, though, but i'm interested in input
> from other users of Python for number crunching and data
> visualization. (i've also been wondering about including
> Maple, Axiom, Maxima equivalent commands, although these
> are computer algebra systems, as it seems these packages
> also have numeric capabilities.)
If we want to contribute, what is the best way to do this? Edit the
XML document and send patches?
Thanks again,
Matthew
From: Rich S. <rsh...@ap...> - 2005年07月28日 18:22:06
On 2005年7月28日, Chris Barker wrote:
>> Within the matplotlib context, does "GUI" mean a widget set (e.g., GTK+,
>> wx)
>
> YES.
 Thanks, Chris. That's what I thought, but I've learned to not assume
anything. :-)
Rich
-- 
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
From: Chris B. <Chr...@no...> - 2005年07月28日 18:18:43
Rich Shepard wrote:
> Within the matplotlib context, does "GUI" mean a widget set (e.g., GTK+,
> wx)
YES.
 > or a system for drawing vectors and bitmaps to the display?
matplotlib doe not work at that low a level, except, I suppose, for the 
use of Agg, which is a way to draw vectors and bitmaps to memory, which 
can then be drawn to the display, through TK, GTK, wx, etc, or saved to 
disk as a PNG, whatever.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
 		
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Vidar G. <vid...@37...> - 2005年07月28日 18:14:38
while learning to use Python as an alternative to MATLAB,
i've started working on a cross reference showing
equivalent commands in MATLAB/Octave, Python (with Numeric
and matplotlib) and R. examples are provided for plotting
commands.
still draft quality, though, but i'm interested in input
from other users of Python for number crunching and data
visualization. (i've also been wondering about including
Maple, Axiom, Maxima equivalent commands, although these
are computer algebra systems, as it seems these packages
also have numeric capabilities.)
the reference is available as a PDF for printing and XML:
http://www.37mm.no/matlab-python-xref.html
-- 
Vidar Bronken Gundersen
From: Rich S. <rsh...@ap...> - 2005年07月28日 17:56:13
 I need clarification on the meaning of "GUI" within the matplotlib context.
To me, "GUI" means running the X Window System rather than working on
consoles. There are various window managers and virtual desktops within that
GUI, but it is just a graphical user interface.
 Within the matplotlib context, does "GUI" mean a widget set (e.g., GTK+,
wx), or a system for drawing vectors and bitmaps to the display?
 I've no problem with how it's being used, just as long as I know what is
meant when I read it and can translate it into my reference frame.
TIA,
Rich
-- 
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
From: Ken M. <mc...@ii...> - 2005年07月28日 16:50:51
Rich Shepard wrote:
> Thanks very much. I discovered matplotlib only yesterday so I have a 
> lot of studying to do. I suspected that the OO API would be better for my
 > needs than is the MatLab(TM)-style interface.
The matplotlib FAQ links to several resources that I found useful when 
learning about the OO API.
	http://matplotlib.sourceforge.net/faq.html#OO
My experience was that reading classdocs was the most helpful source of 
information. The matplotlib.axes.Axes class is where most of the plotting 
methods live, so it's probably a good place to start, once you've figured out 
how to create Figures:
	http://matplotlib.sourceforge.net/matplotlib.axes.html#Axes
The demos for my wxmpl module (demos/wxmpl-demos.py) may also help you out, as 
they are OO versions of several of the matplotlib examples. Look at all of 
the plot_XXX() functions at the beginning of the file. Since each of them 
takes a Figure as its only argument, they are backend-neutral.
> Of course, I'm still brand-new to python and wxPython (I keep thinking in
 > terms of C and GTK+), but I'm working hard at getting up to speed.
Ah, a glorious day! Our numbers grow! ;-)
Ken
From: Rich S. <rsh...@ap...> - 2005年07月28日 16:35:52
On 2005年7月28日, Chris Barker wrote:
> Are you keeping a collection of all these little examples around? In a
> Wiki, perhaps?
 Either a wiki or a tips-and-tricks page would be great. The advantage of
the wiki is that those of us who do different things to extend or enhance
matplotlib can post them there. The LyX wiki is a great example.
Rich
-- 
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
From: Chris B. <Chr...@no...> - 2005年07月28日 16:16:31
John Hunter wrote:
> I'm CC-ing my reply to the matplotlib-users list, so other people can
> contribute to and benefit from the discussion.
WOW! now that's support!
John,
Are you keeping a collection of all these little examples around? In a 
Wiki, perhaps?
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
 		
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Rich S. <rsh...@ap...> - 2005年07月28日 16:16:10
On 2005年7月28日, Ken McIvor wrote:
> You have a few different options available to you for embedding matplotlib 
> in wxPython:
> Each of these approachs has different benefits and drawbacks, so I encourage 
> you to evaluate each of them and select the one that best meets your needs.
Ken,
 Thanks very much. I discovered matplotlib only yesterday so I have a lot of
studying to do. I suspected that the OO API would be better for my needs than
is the MatLab(TM)-style interface. Of course, I'm still brand-new to python
and wxPython (I keep thinking in terms of C and GTK+), but I'm working hard
at getting up to speed.
I appreciate the pointers,
Rich
-- 
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
From: Ken M. <mc...@ii...> - 2005年07月28日 16:06:42
Rich Shepard wrote:
> Now, my other current hangup is trying to identify what wxPython/wxWidget
> widget to place in the UI for display of these plots. Working on this, too.
> 
> Well, my plotting library is now set. I know I can do all these things in
> PSTricks -- as far as drawing for publication is concerned -- but I need to
> use them in computations, too.
You have a few different options available to you for embedding matplotlib in 
wxPython:
1. Embed one of the wxPython backend widgets (which subclass wx.Panel) 
directly and draw plots on it using matplotlib's object-oriented API. This 
approach is demonstrated by some of the examples that come with matplotlib 
(examples/embedding_in_wx*.py).
2. Embed the PlotPanel from Matt Newville's `MPlot' package and draw plots on 
it using its plot() and oplot() methods.
	http://cars9.uchicago.edu/~newville/Python/MPlot/
3. Embed the PlotPanel from my `wxmpl' module and draw plots on it using the 
matplotlib's object-oriented API.
	http://agni.phys.iit.edu/~kmcivor/wxmpl/
Each of these approachs has different benefits and drawbacks, so I encourage 
you to evaluate each of them and select the one that best meets your needs.
Ken
From: Pujo A. <aj...@gm...> - 2005年07月28日 15:38:52
thanks john,
That's clear now.
pujo
On 7/28/05, John Hunter <jdh...@ac...> wrote:
> >>>>> "Pujo" =3D=3D Pujo Aji <aj...@gm...> writes:
>=20
> Pujo> Hello I write a program which launch pylab from windows GUI
> Pujo> (using wxpython). I found some problem here.
>=20
> ...snip...
>=20
> Pujo> What's the problem here. I use pylab.show() to show the
> Pujo> program. I use windows xp sp2
>=20
> If I am reading your post correctly, you are writing a wxpython
> application and trying to use pylab from it. Don't: it won't work and
> is not expected to work. pylab starts the mainloop of the GUI for the
> backend you have chosen, and this will conflict with the wxpython
> mainloop of your program. You need to use the matplotlib API and
> manage your own Figure windows. See
>=20
> http://matplotlib.sf.net/faq.html#OO
>=20
> and the examples/embedding_in_wx*.py in the matplotlib src
> distribution.
>=20
> Matt Newville has also posted lots of examples and helper code at
> http://cars.uchicago.edu/~newville/Python/MPlot which make it easier
> to use matplotlib in wx apps.
>=20
> JDH
>
From: Rich S. <rsh...@ap...> - 2005年07月28日 15:17:30
On 2005年7月28日, John Hunter wrote:
> I'm CC-ing my reply to the matplotlib-users list, so other people can
> contribute to and benefit from the discussion.
John,
 That's fine. I didn't want to post the pdf attachment to the list and I
knew that you would have the greatest insight.
> matplotlib's general approach is that you compute the x and y vertices of
> the curves you want to plot and then pass it off to plot. So you could
> write a helper function to generate these points given your parameters of
> interest and then plot them. Eg for a normal pdf, matplotlib.mlab provides
> such a function
>
> from matplotlib.mlab import normpdf
> import matplotlib.numerix as nx
> import pylab as p
>
> x = nx.arange(-4, 4, 0.01)
> y = normpdf(x, 0, 1) # unit normal
> p.plot(x,y, color='red', lw=2)
> p.show()
 That's a great example, thanks again. I also need to research the formula
for these curves (d'oh!) because my need is not only to draw them but to
calculate the y value for a given x value, and vice-versa.
> Of course, some curves do not have closed form expressions and are not
> amenable for such treatment. Some of the matplotlib backends have the
> capability to draw arbitrary paths with splines (cubic and quartic) but
> this functionality hasn't been exposed to the user yet. If you need this,
> let me know and I can provide an interface in an upcoming release.
 Splines are great graphically but not for generating plots from model
output.
> I had not heard of "S curves" and "Z curves", but a little bit of googling
> [1,2] suggests that the S curve is a sigmoid and the Z curve is simply
> 1-sigmoid. If this is what you are looking for, there are many simple forms
> for sigmoids: eg, the hill, boltzman, and arc tangent functions. Here is an
> example of the boltzman function
 Each specialty reassigns words to suit their own jargon: normal curve (math
and statistics), bell curve (social sciences), Gaussian curve (physics) are
all synonyms. The left and right halves (start at y=1.0, decrease
sinusoidally to y=0.0) looks like an uppercase 'Z' if you use your
imagination, while the right half looks like an uppercase 'S'. :-)
> import matplotlib.numerix as nx
> import pylab as p
>
> def boltzman(x, xmid, tau):
> """
> evaluate the boltzman function with midpoint xmin and time constant tau
> over x
> """
> return 1. / (1. + nx.exp(-x-xmid)/tau)
>
> x = nx.arange(-6, 6, .01)
> S = boltzman(x, 0, 1)
> Z = 1-boltzman(x, 0.5, 1)
> p.plot(x, S, x, Z, color='red', lw=2)
> p.show()
 Great! More research to define the curves I need and to understand what
values I need to feed into the algorithm, and I'll be there.
> See also http://mathworld.wolfram.com/SigmoidFunction.html. With a
> little arithmetic you can write a helper function that takes the
> midpoint and saturation point as arguments and computes the relevant
> parameters and points.
 I suspected it was possible, but I hadn't seen the functions in the docs;
I'll look at the NumPy docs again. (I need the eig function from to calculate
the prinicpal eigenvector from a symmetrical matrix, but there's no plotting
involved here.)
>> From the book jacket on your home page [3], I'll anticipate your next
> question that you may want to fill the area below the intersection of
> the S and Z curves, which you can do with the magic of numerix and the
> fill function
 Actually, no. I don't need to fill the plots. That upper illustration is
the fuzzy set intersect; the logical "AND" of two sets. The lower
illustration shows "AND," "OR," and "X-OR." What I will need to be plotting,
however, is the result of aggregating fuzzy sets using any of several methods
(such as min-max). But, one step at a time as we re-write the code from the
ground up in python (and wxPython).
> As these examples illustrate, matplotlib doesn't come with helper
> functions for all the kinds of curves people want to plot, but
> along with numerix and python, provides the basic tools to enable you
> to build them yourself.
 And I will be creating those Real Soon Now. And, I'll make them available
to anyone who wants them.
> Hope this helps!
 It certainly does; well beyond what I expected.
 Now, my other current hangup is trying to identify what wxPython/wxWidget
widget to place in the UI for display of these plots. Working on this, too.
 Well, my plotting library is now set. I know I can do all these things in
PSTricks -- as far as drawing for publication is concerned -- but I need to
use them in computations, too.
Again, thanks,
Rich
-- 
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
From: John H. <jdh...@ac...> - 2005年07月28日 14:45:34
>>>>> "Rich" == Rich Shepard <rsh...@ap...> writes:
Hi Rich,
I'm CC-ing my reply to the matplotlib-users list, so other people can
contribute to and benefit from the discussion.
 Rich> John, Last evening I read through the user guide and
 Rich> tutorial for matplotlib. Although I've done my scientific
 Rich> plotting using Gri (a better gnuplot) for years, and more
 Rich> recently with PSTricks, the philosophy and syntax of
 Rich> matplotlib is quite easy to grasp. Congratulations on a
 Rich> masterful job!
Thanks!
 Rich> Despite my careful reading, I saw nothing about creating
 Rich> the types of curves I need to plot. A sample is attached. I
 Rich> need to be able to draw overlapping normal curves and S- and
 Rich> Z-curves at the ends of the range of x values. Can I do this
 Rich> with matplotlib, particularly by specifying end points, the
 Rich> x value where y=1.0, and the y value of the point of
 Rich> inflection?
 Rich> Plotting triangular and trapezoidal versions are easy as
 Rich> the connecting lines are straight. Doing the normal curves
 Rich> (complete and either half) is a challenge.
matplotlib's general approach is that you compute the x and y vertices
of the curves you want to plot and then pass it off to plot. So you
could write a helper function to generate these points given your
parameters of interest and then plot them. Eg for a normal pdf,
matplotlib.mlab provides such a function
 from matplotlib.mlab import normpdf
 import matplotlib.numerix as nx
 import pylab as p
 x = nx.arange(-4, 4, 0.01)
 y = normpdf(x, 0, 1) # unit normal
 p.plot(x,y, color='red', lw=2)
 p.show()
Of course, some curves do not have closed form expressions and are not
amenable for such treatment. Some of the matplotlib backends have the
capability to draw arbitrary paths with splines (cubic and quartic)
but this functionality hasn't been exposed to the user yet. If you
need this, let me know and I can provide an interface in an upcoming
release.
I had not heard of "S curves" and "Z curves", but a little bit of
googling [1,2] suggests that the S curve is a sigmoid and the Z curve
is simply 1-sigmoid. If this is what you are looking for, there are
many simple forms for sigmoids: eg, the hill, boltzman, and arc
tangent functions. Here is an example of the boltzman function
 import matplotlib.numerix as nx
 import pylab as p
 def boltzman(x, xmid, tau):
 """
 evaluate the boltzman function with midpoint xmin and time constant tau
 over x
 """
 return 1. / (1. + nx.exp(-x-xmid)/tau)
 x = nx.arange(-6, 6, .01)
 S = boltzman(x, 0, 1)
 Z = 1-boltzman(x, 0.5, 1)
 p.plot(x, S, x, Z, color='red', lw=2)
 p.show()
See also http://mathworld.wolfram.com/SigmoidFunction.html. With a
little arithmetic you can write a helper function that takes the
midpoint and saturation point as arguments and computes the relevant
parameters and points.
From the book jacket on your home page [3], I'll anticipate your next
question that you may want to fill the area below the intersection of
the S and Z curves, which you can do with the magic of numerix and the
fill function
 import matplotlib.numerix as nx
 import pylab as p
 def boltzman(x, xmid, tau):
 """
 evaluate the boltzman function with midpoint xmin and time constant tau
 over x
 """
 return 1. / (1. + nx.exp(-x-xmid)/tau)
 def fill_below_intersection(x, S, Z):
 """
 fill the region below the intersection of S and Z
 """
 #find the intersection point
 ind = nx.nonzero( nx.absolute(S-Z)==min(nx.absolute(S-Z)))[0]
 # compute a new curve which we will fill below
 Y = nx.zeros(S.shape, typecode=nx.Float)
 Y[:ind] = S[:ind] # Y is S up to the intersection
 Y[ind:] = Z[ind:] # and Z beyond it
 p.fill(x, Y, facecolor='blue', alpha=0.5)
 x = nx.arange(-6, 6, .01)
 S = boltzman(x, 0, 1)
 Z = 1-boltzman(x, 0.5, 1)
 p.plot(x, S, x, Z, color='red', lw=2)
 fill_below_intersection(x, S, Z)
 p.show()
As these examples illustrate, matplotlib doesn't come with helper
functions for all the kinds of curves people want to plot, but
along with numerix and python, provides the basic tools to enable you
to build them yourself.
Hope this helps!
JDH
[1] http://www.nicholasgcarr.com/digital_renderings/archives/the_z_curve_and_it.shtml
[2] http://bdn.borland.com/article/0,1410,32411,00.html
[3] http://www.appl-ecosys.com/newstuff.html
From: John H. <jdh...@ac...> - 2005年07月28日 13:48:33
>>>>> "Pujo" == Pujo Aji <aj...@gm...> writes:
 Pujo> Hello I write a program which launch pylab from windows GUI
 Pujo> (using wxpython). I found some problem here.
 ...snip...
 Pujo> What's the problem here. I use pylab.show() to show the
 Pujo> program. I use windows xp sp2
If I am reading your post correctly, you are writing a wxpython
application and trying to use pylab from it. Don't: it won't work and
is not expected to work. pylab starts the mainloop of the GUI for the
backend you have chosen, and this will conflict with the wxpython
mainloop of your program. You need to use the matplotlib API and
manage your own Figure windows. See
 http://matplotlib.sf.net/faq.html#OO
and the examples/embedding_in_wx*.py in the matplotlib src
distribution.
Matt Newville has also posted lots of examples and helper code at
http://cars.uchicago.edu/~newville/Python/MPlot which make it easier
to use matplotlib in wx apps.
JDH
From: <phi...@ho...> - 2005年07月28日 13:42:41
Hi list,
I tryied to find out how i display the colorbar like in the pocolor_demo 
for example but using matplotlib OO.
 self.fig = Figure(figsize=(self.hSize,self.vSize), dpi=self.res)
 self.valueList3.setshape(len(self.valueList),len(self.valueList2))
 X,Y = meshgrid(self.valueList, self.valueList2)
 self.a.pcolor(X, Y, self.valueList3, shading='flat')
self.fig.colorbar() requires a mappable argument. However i don't know 
with which element i must feed the colorbar method.
Has anyone succeed in display the colorbar with matplotlib OO?
Thanks a lot,
Philippe Collet
From: Steve S. <el...@gm...> - 2005年07月28日 09:41:56
You are right, thanks :)
N. Volbers wrote:
> Hello Steve,
> 
> Steve Schmerler schrieb:
> 
>> Hi
>>
>> I run into problems using axhline() (mpl 0.81) when setting the 'xmin'
>> and 'xmax' keywords. The horizontal line to be drawn doesn't show up or
>> just a part of it. What's up (see attached script and .eps files)?
>>
> you misunderstood the meaning of the 'xmin' and 'xmax' keyword 
> arguments. If you look at the documtation for axhline, you will see 
> that a value of 0.0 refers to the left side of the figure (well, 
> actually the axes), and 1.0 refers to the very right. So the default 
> setting xmin=0, xmax=1 will draw a horizontal line from the very left to 
> the very right.
> With this information, your other three examples should be clear.
> 
> Best regards,
> 
> Niklas.
> 
> 
> 
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
From: Pujo A. <aj...@gm...> - 2005年07月28日 07:19:04
Hello
I write a program which launch pylab from windows GUI (using wxpython).
I found some problem here.
If I use the default backends program in matplotlibrc which is TkAgg
I have this result:
1. I click button the plot is showed
2. I close the plot
3. I click the button to show the plot the second time. it shows the
plot but I can't closed it (it hangs.)
If I use the WX as my backends program ( i have to change manually in
matplotlibrc) I have this result:
1. I click button the plot is showed
2. I close the plot
3. I click the button to show the plot the second time. it shows perfect.
4. I close my GUI this time the program doesn't totally close (I can
check from windows manager process).
What's the problem here. I use pylab.show() to show the program.
I use windows xp sp2
Sincerely Yours,
pujo
From: Mark B. <ma...@gm...> - 2005年07月28日 01:20:54
 I am starting to like the GUI Neutral Widgets.
Any chance there is a widget in the works where we can enter data (like a=
=20
number) ?
I know, that may be harder than radiobuttons and such, but boy would it be=
=20
cool.
Isn't it raining in Chicago anyway?
Thanks,
Mark

Showing 25 results of 25

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /