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
(35)
2
(29)
3
(12)
4
5
(8)
6
(5)
7
(3)
8
(38)
9
(15)
10
(20)
11
(14)
12
(12)
13
(17)
14
(6)
15
(41)
16
(38)
17
(31)
18
(7)
19
(14)
20
(12)
21
(3)
22
(3)
23
(15)
24
(4)
25
26
(3)
27
(2)
28
(7)
29
(16)
30
(17)
31
(10)



Showing results of 35

1 2 > >> (Page 1 of 2)
From: Fago, M. - A. <Mat...@it...> - 2008年12月01日 22:50:55
> From: Ryan May [mailto:rm...@gm...]
> Fago, Matt - AES wrote:
> > I suppose the issue is: what is correct? Or is it a matter of
> definition?
[...]
> Yeah, scaling by a factor of two for one-sided is definitely correct now
> that I think about it. Note, however, that the scaling by the length is
> not the problem. In fact, the current psd implementation does this
> correctly when it corrects for the power in the window. The problem
> stems from matlab scaling by the sampling frequency. Stoica and Moses
> don't do this, nor does Welch 1967. I'm all for doing things in a
> Matlab-compatible way--when they're correct. One of the reasons I
> stopped using Matlab was that it tried to be too smart for me.
Yes, multiplying by 2/fs does look fairly good. Perhaps this comes about due to the Matlab implementation of the FFT?
> > Note that the Matplotlib results also seem to have significantly less
> > frequency resolution than
> > the Matlab results. Is this the case, or am I not using noffset, nfft,
> > and pad_to correctly?
>
> It's not that you're using those incorrectly, but rather that you failed
> to notice that the default window is the Hanning window, not
> rectangular. Try adding window=mlab.window_none to the call. (Sorry, I
> meant to mention that before in my reply.
Ah ... many thanks. Silly me.
 - Matt
This e-mail and any files transmitted with it may be proprietary and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender.
Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of ITT Corporation. The recipient should check this e-mail and any attachments for the presence of viruses. ITT accepts no liability for any damage caused by any virus transmitted by this e-mail.
From: Mauro C. <mau...@gm...> - 2008年12月01日 22:48:20
Dear Ryan,
Thank your very much for your kind reply. I had already a couple of
solutions to that problem, and your adds nicely to them!
I am very grateful to everyone who have been so helpful and can assure
you will also be formally acknowledged at the conclusion of this
project.
With warmest regards,
2008年12月1日 Ryan May <rm...@gm...>:
> Mauro Cavalcanti wrote:
>>
>> Dear ALL,
>>
>> Is there any example of toggling points on and off a MPL Basemap? I
>> see that there matplotlib artists have a handy "set_visible()" method,
>> but if I have a map with plotted points and use
>> "ax.set_visible(False)", the entire map is made invisible!
>
> Sorry this took so long, I lost you in my queue.
>
> You need to first save the results of the command you use to plot the points
> (every plotting command returns an object or set of objects that represent
> what was added to the plot.). You then call set_visible() on this object.
> Your problem was that calling ax.set_visible(False) made the entire Axes
> object invisible, which, as you saw, hid the plot. Here's a modified version
> of the plotcities example:
>
>
> from mpl_toolkits.basemap import Basemap as Basemap
>
> m = Basemap()
> x, y = [70,30,110,-97,75,-10], [35, 40, 45, 60, -10, -40]
> x,y = m(x,y)
> m.drawcoastlines()
> m.fillcontinents()
> pts = m.scatter(x,y,25,marker='o',edgecolors='none',zorder=10)
> pts.set_visible(False) #Uncomment to make visible
> plt.show()
>
> Hope this helps,
>
> Ryan
>
> --
> Ryan May
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
>
-- 
Dr. Mauro J. Cavalcanti
Ecoinformatics Studio
P.O. Box 46521, CEP 20551-970
Rio de Janeiro, RJ, BRASIL
E-mail: mau...@gm...
Web: http://studio.infobio.net
Linux Registered User #473524 * Ubuntu User #22717
"Life is complex. It consists of real and imaginary parts."
From: Ryan M. <rm...@gm...> - 2008年12月01日 22:31:59
Fago, Matt - AES wrote:
> I suppose the issue is: what is correct? Or is it a matter of definition?
> 
> I don't have Stoica and Moses, but Bendat and Piersol eqn 11.102:
> 
> One_Sided_PSD = 2/(n_d * N * dt) * Sum(FFT^2)
> 
> where there are n_d is the number of averages and N is the number of points in the FFT.
> That seems to be scaling by the length? I'm fairly certain that the factor of two (as shown
> above) is required for a one-sided PSD, as that comes from 'removing' the negative
> frequency range.
> 
> Note that Matlab shows such scaling (by 2/L) even when computing the power spectra directly
> from a raw (unaveraged) FFT:
> 
> http://www.mathworks.com/support/tech-notes/1700/1702.html
>
> To me, as Matplotlib is striving to be Matlab-compatible, the default behaviour should be to
> give results as close to the Matlab implementation as possible. One could always have an
> option to turn off the scaling.
Yeah, scaling by a factor of two for one-sided is definitely correct now 
that I think about it. Note, however, that the scaling by the length is 
not the problem. In fact, the current psd implementation does this 
correctly when it corrects for the power in the window. The problem 
stems from matlab scaling by the sampling frequency. Stoica and Moses 
don't do this, nor does Welch 1967. I'm all for doing things in a 
Matlab-compatible way--when they're correct. One of the reasons I 
stopped using Matlab was that it tried to be too smart for me.
> Note that the Matplotlib results also seem to have significantly less frequency resolution than
> the Matlab results. Is this the case, or am I not using noffset, nfft, and pad_to correctly?
It's not that you're using those incorrectly, but rather that you failed 
to notice that the default window is the Hanning window, not 
rectangular. Try adding window=mlab.window_none to the call. (Sorry, I 
meant to mention that before in my reply.
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Xavier G. <xav...@gm...> - 2008年12月01日 22:19:08
John Hunter wrote:
> On Mon, Dec 1, 2008 at 1:08 PM, Eric Emsellem
> <ems...@ob...> wrote:
>> Hi
>>
>> this may be a known problem (didn't find anything on this issue) but here it is:
>>
>> - when I start a session with "ipython -pylab" I often get crashes with my
>> session. When I mean "often", it means really often like once everything 1/2h or
>> so. A crash means that the command I just sent gets stuck and the only way for
>> me to get it back is to kill the PID of the ipython process...
>>
>> The problem is that it is almost impossible to reproduce a systematic behaviour
>> there so I cannot really send you a list of commands which results in a crash.
>> It just happens (often). However, after someone suggested it, I now enter
>> Ipython by a simple "ipython" and do immediately "from pylab import *". And then
>> I have NO crashes whatsoever.
>>
>> any suggestion there? Is that normal?
> 
> It is definitely not normal -- it almost never happens to me. Does it
> help if you run TkAgg instead of GTKAgg. Are you importing/using
> anything else when this is happening? What version of numpy are you
> running?
Well I never use ipython -pylab and always use tkagg.
It could be a race in the way ipython manage to do that:
http://ipython.scipy.org/moin/Cookbook/InterruptingThreads
What version of ipython are you using?
Xavier
From: Fago, M. - A. <Mat...@it...> - 2008年12月01日 22:08:00
I suppose the issue is: what is correct? Or is it a matter of definition?
I don't have Stoica and Moses, but Bendat and Piersol eqn 11.102:
 One_Sided_PSD = 2/(n_d * N * dt) * Sum(FFT^2)
where there are n_d is the number of averages and N is the number of points in the FFT.
That seems to be scaling by the length? I'm fairly certain that the factor of two (as shown
above) is required for a one-sided PSD, as that comes from 'removing' the negative
frequency range.
Note that Matlab shows such scaling (by 2/L) even when computing the power spectra directly
from a raw (unaveraged) FFT:
 http://www.mathworks.com/support/tech-notes/1700/1702.html
To me, as Matplotlib is striving to be Matlab-compatible, the default behaviour should be to
give results as close to the Matlab implementation as possible. One could always have an
option to turn off the scaling.
Note that the Matplotlib results also seem to have significantly less frequency resolution than
the Matlab results. Is this the case, or am I not using noffset, nfft, and pad_to correctly?
Thanks for your help,
Matt
________________________________________
From: Ryan May [rm...@gm...]
Sent: Monday, December 01, 2008 1:58 PM
To: Fago, Matt - AES
Cc: Matplotlib Users
Subject: Re: [Matplotlib-users] Matplotlib PSD bug?
Fago, Matt - AES wrote:
> I cannot really compute the example without the pad_to support in svn. Nevertheless, using something similar (nfft=128, noffset=64) gives similarly erroneous results.
>
> Did you add 'pad_to'? If so, thanks!
Good to know. I recently (within the last month) did a bunch of work on
psd, based in a large part on work done by one of my colleagues, Sean
Arms. I was worried some of this had broken existing code, but it
appears more likely that this was already a problem.
After much playing, and reading the Matlab docs, it looks like the
difference is that Matlab normalizes by the sampling frequency. Also,
if a one-sided psd is returned, it multiplies everything by 2. If I
apply these two scaling factors, I get results in line with those
produced by Matlab.
Now, this scaling was not performed by the old code, so this is not a
new incompatibility (bug?) with Matlab. Also, while I have not reviewed
the reference specified in the docstring (Bendat and Piersol 1986), the
book I have handy (Stoica and Moses 2005) does not mention scaling by
the sampling frequency, nor does the included Matlab code perform any
such scaling.
So what should be done here? I would be opposed to making such scaling
the default, as IMHO it tries to do too much and I would have to work
around it to get the more "raw" numbers. However, I am not opposed to
adding (yet another) option to do such scaling.
Other opinions?
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
This e-mail and any files transmitted with it may be proprietary and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender.
Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of ITT Corporation. The recipient should check this e-mail and any attachments for the presence of viruses. ITT accepts no liability for any damage caused by any virus transmitted by this e-mail.
From: John H. <jd...@gm...> - 2008年12月01日 21:53:35
On Mon, Dec 1, 2008 at 3:40 PM, Andrew Straw <str...@as...> wrote:
> I appreciate the work you're doing on this, and while I don't have any
> very strong opinions on the API questions you raise, I would request
> that you include in the docstrings information at least at the level of
> the above, listing the scaling issue, the sources you've followed and
> how and why you've chosen to follow them or deviate, and differences
> with the default behavior of other software. I recently helped a
> colleague use Matlab's PSD/pwelch functions and had to spend some time
> sending in sine waves of various frequencies and amplitudes to figure
> out what the results meant. If matplotlib gives different results by
> default, I think it should 1) justify why and 2) indicate what option(s)
> may be set to get results equivalent to other systems, including Matlab.
My preference is to strive for matlab compatability here. I am pretty
sure it was compatible with matlab in my original tests to several
significant digits, but I no longer have the test code and my memory
is fuzzy because it was over 5 years ago. But I intended this
function to be matlab compatible, and if it is not I would prefer to
see it compatible even if it means breaking some existing code. It is
possible that the original code did not scale with sampling frequency
and was compatible, but over time we've made enhancements that broke
compatibility. Its been a long time since I used and tested against
matlab.
If there is good reason to add support for an alternate scaling, we
can easily support it with kwargs. But since the signature and
origins of this function were matlab compatibility, I think it is
least confusing if the default output has similar scaling.
JDH
From: Ryan M. <rm...@gm...> - 2008年12月01日 21:44:33
Mauro Cavalcanti wrote:
> Dear ALL,
> 
> Is there any example of toggling points on and off a MPL Basemap? I
> see that there matplotlib artists have a handy "set_visible()" method,
> but if I have a map with plotted points and use
> "ax.set_visible(False)", the entire map is made invisible!
Sorry this took so long, I lost you in my queue.
You need to first save the results of the command you use to plot the 
points (every plotting command returns an object or set of objects that 
represent what was added to the plot.). You then call set_visible() on 
this object. Your problem was that calling ax.set_visible(False) made 
the entire Axes object invisible, which, as you saw, hid the plot. 
Here's a modified version of the plotcities example:
from mpl_toolkits.basemap import Basemap as Basemap
m = Basemap()
x, y = [70,30,110,-97,75,-10], [35, 40, 45, 60, -10, -40]
x,y = m(x,y)
m.drawcoastlines()
m.fillcontinents()
pts = m.scatter(x,y,25,marker='o',edgecolors='none',zorder=10)
pts.set_visible(False) #Uncomment to make visible
plt.show()
Hope this helps,
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Andrew S. <str...@as...> - 2008年12月01日 21:40:39
Ryan May wrote:
> Fago, Matt - AES wrote:
>> I cannot really compute the example without the pad_to support in svn. Nevertheless, using something similar (nfft=128, noffset=64) gives similarly erroneous results.
>>
>> Did you add 'pad_to'? If so, thanks!
> 
> Good to know. I recently (within the last month) did a bunch of work on 
> psd, based in a large part on work done by one of my colleagues, Sean 
> Arms. I was worried some of this had broken existing code, but it 
> appears more likely that this was already a problem.
> 
> After much playing, and reading the Matlab docs, it looks like the 
> difference is that Matlab normalizes by the sampling frequency. Also, 
> if a one-sided psd is returned, it multiplies everything by 2. If I 
> apply these two scaling factors, I get results in line with those 
> produced by Matlab.
> 
> Now, this scaling was not performed by the old code, so this is not a 
> new incompatibility (bug?) with Matlab. Also, while I have not reviewed 
> the reference specified in the docstring (Bendat and Piersol 1986), the 
> book I have handy (Stoica and Moses 2005) does not mention scaling by 
> the sampling frequency, nor does the included Matlab code perform any 
> such scaling.
> 
> So what should be done here? I would be opposed to making such scaling 
> the default, as IMHO it tries to do too much and I would have to work 
> around it to get the more "raw" numbers. However, I am not opposed to 
> adding (yet another) option to do such scaling.
Hi Ryan,
I appreciate the work you're doing on this, and while I don't have any
very strong opinions on the API questions you raise, I would request
that you include in the docstrings information at least at the level of
the above, listing the scaling issue, the sources you've followed and
how and why you've chosen to follow them or deviate, and differences
with the default behavior of other software. I recently helped a
colleague use Matlab's PSD/pwelch functions and had to spend some time
sending in sine waves of various frequencies and amplitudes to figure
out what the results meant. If matplotlib gives different results by
default, I think it should 1) justify why and 2) indicate what option(s)
may be set to get results equivalent to other systems, including Matlab.
Thanks again,
Andrew
From: twentypoundtrout <twe...@ya...> - 2008年12月01日 21:40:16
Alan G Isaac wrote:
> 
> Mike Hearne wrote:
> > Along similar lines, has anyone figured out a way to have a drop shadow
> effect for text on a plot?
> 
> Out of curiosity, what is the payoff
> (in communication or aesthetics)
> of such a thing?
> 
> 
I don't think that it communicates any more information, but it can often
add depth to an otherwise benign figure and can also make the presentation
softer to view. Just makes if fancy I guess.
-- 
View this message in context: http://www.nabble.com/plot-with-drop-shadow-tp20773979p20781124.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John H. <jd...@gm...> - 2008年12月01日 21:39:58
On Mon, Dec 1, 2008 at 2:43 PM, twentypoundtrout
<twe...@ya...> wrote:
> So there is no way to say plot a line. Grab that image. Apply a standard
> SVG filter (like Gaussian). And overlay the blur? I do not know the PIL
> well enough to know if this is feasible.
You can do this using an external program -- see for example
http://abitofpythonabitofastronomy.blogspot.com/2008/10/svg.html. It
would be challenging to implement something like this internally
across output formats I think, but we recently added some features to
make it easier to use an svg editor for filtering mpl objects. See
also this thread
http://www.nabble.com/SVG-clickable-images-td20236869.html#a20236869
JDH
From: Alan G I. <ai...@am...> - 2008年12月01日 21:25:37
Mike Hearne wrote:
 > Along similar lines, has anyone figured out a way to have a drop shadow effect for text on a plot?
Out of curiosity, what is the payoff
(in communication or aesthetics)
of such a thing?
Thanks,
Alan Isaac
From: Mike H. <mh...@us...> - 2008年12月01日 21:12:16
Along similar lines, has anyone figured out a way to have a drop shadow 
effect for text on a plot?
twentypoundtrout <twe...@ya...> 
12/01/08 01:43 PM
To
mat...@li...
cc
Subject
Re: [Matplotlib-users] plot with drop shadow
John Hunter-4 wrote:
> 
> On Mon, Dec 1, 2008 at 9:17 AM, Nate <ten...@ya...> wrote:
>> Is there a way to plot lines with drop shadows?
>>
> 
> Nothing built-in -- but you can fake it::
> 
> import matplotlib.pyplot as plt
> import numpy as np
> 
> t = np.arange(0.0, 2.0, 0.01)
> s = np.sin(2*np.pi*t)
> 
> fig = plt.figure()
> ax = fig.add_subplot(111)
> ax.plot(t+0.01, s-0.01, color='gray', lw=2)
> ax.plot(t, s, color='blue', lw=3)
> plt.show()
> 
> JDH
> 
> 
So there is no way to say plot a line. Grab that image. Apply a standard
SVG filter (like Gaussian). And overlay the blur? I do not know the PIL
well enough to know if this is feasible.
-- 
View this message in context: 
http://www.nabble.com/plot-with-drop-shadow-tp20773979p20780129.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's 
challenge
Build the coolest Linux based applications with Moblin SDK & win great 
prizes
Grand prize is a trip for two to an Open Source event anywhere in the 
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Ryan M. <rm...@gm...> - 2008年12月01日 20:58:56
Fago, Matt - AES wrote:
> I cannot really compute the example without the pad_to support in svn. Nevertheless, using something similar (nfft=128, noffset=64) gives similarly erroneous results.
> 
> Did you add 'pad_to'? If so, thanks!
Good to know. I recently (within the last month) did a bunch of work on 
psd, based in a large part on work done by one of my colleagues, Sean 
Arms. I was worried some of this had broken existing code, but it 
appears more likely that this was already a problem.
After much playing, and reading the Matlab docs, it looks like the 
difference is that Matlab normalizes by the sampling frequency. Also, 
if a one-sided psd is returned, it multiplies everything by 2. If I 
apply these two scaling factors, I get results in line with those 
produced by Matlab.
Now, this scaling was not performed by the old code, so this is not a 
new incompatibility (bug?) with Matlab. Also, while I have not reviewed 
the reference specified in the docstring (Bendat and Piersol 1986), the 
book I have handy (Stoica and Moses 2005) does not mention scaling by 
the sampling frequency, nor does the included Matlab code perform any 
such scaling.
So what should be done here? I would be opposed to making such scaling 
the default, as IMHO it tries to do too much and I would have to work 
around it to get the more "raw" numbers. However, I am not opposed to 
adding (yet another) option to do such scaling.
Other opinions?
Ryan
	
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: twentypoundtrout <twe...@ya...> - 2008年12月01日 20:43:13
John Hunter-4 wrote:
> 
> On Mon, Dec 1, 2008 at 9:17 AM, Nate <ten...@ya...> wrote:
>> Is there a way to plot lines with drop shadows?
>>
> 
> Nothing built-in -- but you can fake it::
> 
> import matplotlib.pyplot as plt
> import numpy as np
> 
> t = np.arange(0.0, 2.0, 0.01)
> s = np.sin(2*np.pi*t)
> 
> fig = plt.figure()
> ax = fig.add_subplot(111)
> ax.plot(t+0.01, s-0.01, color='gray', lw=2)
> ax.plot(t, s, color='blue', lw=3)
> plt.show()
> 
> JDH
> 
> 
So there is no way to say plot a line. Grab that image. Apply a standard
SVG filter (like Gaussian). And overlay the blur? I do not know the PIL
well enough to know if this is feasible.
-- 
View this message in context: http://www.nabble.com/plot-with-drop-shadow-tp20773979p20780129.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John H. <jd...@gm...> - 2008年12月01日 20:02:19
On Mon, Dec 1, 2008 at 1:08 PM, Eric Emsellem
<ems...@ob...> wrote:
> Hi
>
> this may be a known problem (didn't find anything on this issue) but here it is:
>
> - when I start a session with "ipython -pylab" I often get crashes with my
> session. When I mean "often", it means really often like once everything 1/2h or
> so. A crash means that the command I just sent gets stuck and the only way for
> me to get it back is to kill the PID of the ipython process...
>
> The problem is that it is almost impossible to reproduce a systematic behaviour
> there so I cannot really send you a list of commands which results in a crash.
> It just happens (often). However, after someone suggested it, I now enter
> Ipython by a simple "ipython" and do immediately "from pylab import *". And then
> I have NO crashes whatsoever.
>
> any suggestion there? Is that normal?
It is definitely not normal -- it almost never happens to me. Does it
help if you run TkAgg instead of GTKAgg. Are you importing/using
anything else when this is happening? What version of numpy are you
running?
From: Matt F. <mat...@gm...> - 2008年12月01日 20:01:17
On Wed, Nov 26, 2008 at 7:11 AM, Nils Wagner
<nw...@ia...> wrote:
> Hi all,
>
> I would like to visualize the ovality of a perturbed
> circular path by a polar plot.
> How can I improve the view wrt to scaling and ticks ?
Is:
from pylab import ylim, ytics
figure(2)
polar(theta,(r+noise)/r)
ylim(0, 2)
yticks(arange(0, 2, 0.25))
show()
The kind of thing you're after?
Cheers,
Matt
-- 
Matt Foster | http://hackerific.net
From: Christopher B. <Chr...@no...> - 2008年12月01日 19:54:42
Jesper Larsen wrote:
> I have a web application in which I would like to scale the plots down
> if the users horizontal screen size is less than 800.
http://www.scipy.org/Cookbook/Matplotlib/AdjustingImageSize
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Eric E. <ems...@ob...> - 2008年12月01日 19:53:17
Hi
this may be a known problem (didn't find anything on this issue) but here it is:
- when I start a session with "ipython -pylab" I often get crashes with my
session. When I mean "often", it means really often like once everything 1/2h or
so. A crash means that the command I just sent gets stuck and the only way for
me to get it back is to kill the PID of the ipython process...
The problem is that it is almost impossible to reproduce a systematic behaviour
there so I cannot really send you a list of commands which results in a crash.
It just happens (often). However, after someone suggested it, I now enter
Ipython by a simple "ipython" and do immediately "from pylab import *". And then
I have NO crashes whatsoever.
any suggestion there? Is that normal?
thanks
Eric
P.S.: OpenSuse 11.0 or 10.3 (two machines showing similar behaviour)
matplotlib version 0.98.3
verbose.level helpful
interactive is True
units is True
platform is linux2
backend GTKAgg version 2.10.6
Python 2.5.1 (r251:54863, Aug 1 2008, 00:35:20)
IPython 0.8.1 -- An enhanced Interactive Python.
From: Ryan M. <rm...@gm...> - 2008年12月01日 18:20:09
Ryan May wrote:
> Fago, Matt - AES wrote:
>> I found bug number 1859027 and have appended the below to the bug report.
>>
>> When is the next release due and how likely is this to get fixed? I 
>> might have time myself
>> to help in a week or so, but would appreciate some help if someone 
>> else has time too (who
>> has looked at the source before...)
> 
> I'm sitting down to look at this right now. Can you tell me if you have 
> this problem with 0.98.3 as well?
Nevermind, I just realized you can't really do the example without the 
new support for pad_to. I'm still looking...
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Ryan M. <rm...@gm...> - 2008年12月01日 17:58:50
Fago, Matt - AES wrote:
> I found bug number 1859027 and have appended the below to the bug report.
> 
> When is the next release due and how likely is this to get fixed? I might have time myself
> to help in a week or so, but would appreciate some help if someone else has time too (who
> has looked at the source before...)
I'm sitting down to look at this right now. Can you tell me if you have 
this problem with 0.98.3 as well?
Thanks,
Ryan
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Manuel M. <mm...@as...> - 2008年12月01日 16:26:16
Manuel Metz wrote:
> Alejandro Weinstein wrote:
>> On Mon, Dec 1, 2008 at 7:13 AM, Manuel Metz <mm...@as...> wrote:
>>> You can use the keyword "numpoints" in the legend method:
>> Thank you! It did the trick.
>>
>> Now how you conclude that from the documentation is a mystery:
>>
>> >From the docs:
>> "
>> numpoints: integer
>> The number of points in the legend line, default is 4"
> 
> Ah, that's apparently a bug in the docs, which I've fixed in the sources.
I have to correct myself. John Hunter applied a patch which fixed the docs.
>> Regards,
>> Alejandro.
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Fago, M. - A. <Mat...@it...> - 2008年12月01日 16:03:42
I found bug number 1859027 and have appended the below to the bug report.
When is the next release due and how likely is this to get fixed? I might have time myself
to help in a week or so, but would appreciate some help if someone else has time too (who
has looked at the source before...)
Thanks,
Matt
________________________________________
From: Fago, Matt - AES
Sent: Tuesday, November 25, 2008 1:04 PM
To: mat...@li...
Subject: Matplotlib PSD bug?
[I'm not sure if this is best in 'devel' or 'users']
I'm trying to compute PSDs using matplotlib.mlab.psd and came across the "PSD amplitudes" thread from last year:
 http://sourceforge.net/mailarchive/message.php?msg_id=472101A6.9080206%40isla.hawaii.edu
Using the latest version of psd on svn trunk (rev 6429) that added support for pad_to, I can now compute the Matlab pwelch
example using matplotlib. This example is given in the Signal Processing Toolbox User's Guide:
 http://www.mathworks.com/access/helpdesk/help/pdf_doc/signal/signal_tb.pdf
(look on pages 2-23 and 2-24). Note I do not have easy access to Matlab itself, so I'm just using this published example.
The Matlab code is as follows:
 randn('state',1)
 fs = 1000; % Sampling frequency
 t = (0:0.3*fs)./fs; % 301 samples
 A = [2 8]; % Sinusoid amplitudes (row vector)
 f = [150;140]; % Sinusoid frequencies (column vector)
 xn = A*sin(2*pi*f*t) + 5*randn(size(t));
 Hs = spectrum.welch('rectangular',150,50);
 psd(Hs,xn,'Fs',fs,'NFFT',512);
This produces a fairly noisy signal from -20 to -10 dB, with a strong peak of ~6 dB at 150 Hz (see the plot on page 2-24).
While my equivalent (?) python code is:
 from scipy import *
 from mlabsvn import psd # This is a local copy of svn revision 6429 of matplotlib.mlab
 from pylab import *
 fs=1000
 t=linspace(0,0.3,0.3*fs+1)
 A=[2,8]
 f=[150,140]
 xn=A[0]*sin(2*pi*f[0]*t) + A[1]*sin(2*pi*f[1]*t) + 5*randn(len(t))
 Pxx,freqs = psd(xn,Fs=fs,NFFT=150,noverlap=75,pad_to=512)
 figure()
 plot(freqs, 10*log10(Pxx) )
 show()
However, this produces a peak of over 30 dB at 150 Hz. Unless there is a mistake in my code above, there seems to be a
significant difference between the matplotlib and matlab implementations.
I noticed that the values 10*log10(Pxx/len(xn)) produces results that match much better. Without looking more closely at the
code for psd and reviewing Bendat and Piersol I cannot be sure that this is the correct fix.
Does anyone else have any insight? When is the next release planned, and how likely is a fix?
Thanks,
Matt
This e-mail and any files transmitted with it may be proprietary and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender.
Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of ITT Corporation. The recipient should check this e-mail and any attachments for the presence of viruses. ITT accepts no liability for any damage caused by any virus transmitted by this e-mail.
From: Jeff W. <js...@fa...> - 2008年12月01日 16:03:39
Hrafnkell Pálsson wrote:
> Any chance of further help?
> John?
>
> Hrafnkell
> 
Hrafnkell: I'm pretty sure this is a fundamental limitation of 
canvas.restore_region - everything gets draw on top of it.
If I recall correctly, you'd like to save the map with coastlines drawn, 
and just redraw contours on it. If you're reusing a Basemap instance, 
I'd be surprised if the time spent redrawing the coastlines is all that 
significant. Are you? Creating the coastline polygons in map 
projection coordinates is the most expensive operation, but that is done 
when the Basemap instance is created.
Another option would be to just remove the contours from the figure, 
then redraw the new ones and re-save the figure, i.e.
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
# create new figure
fig=plt.figure()
# setup of of mollweide Basemap.
m = Basemap(resolution='c',projection='moll',lon_0=0)
# draw some contours.
x, y = m(lons, lats) # get map projection coords of lat/lon grid
CS = m.contour(x,y,data,15,linewidths=0.5,colors='k')
# draw coastlines and projection limb.
m.drawcoastlines()
m.drawmapboundary()
# save figure with contours.
plt.savefig('fig1.png')
# remove contours, save figure again.
for coll in CS.collections:
 coll.remove()
plt.savefig('fig2.png')
# draw contours again, this time red, save figure a third time.
CS = m.contour(x,y,data,15,linewidths=0.5,colors='r')
plt.savefig('fig3.png')
HTH,
-Jeff
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: twentypoundtrout <twe...@ya...> - 2008年12月01日 16:02:22
Mauro Cavalcanti wrote:
> 
> The above code works quite well. However, I do *not* want to have the
> plot done for each edge inside the for loop; instead, I would like to
> have the x,y points stored for being plotted at once, using a plot
> command issued outside the loop. It seems that it could be done using
> MPL line collections, but I could not figure out how to do this. Any
> hints?
> 
You can plot the columns of a X/Y data using one plot command here:
from pylab import *
nodes = load('nodes.dat')
edges = int16(load('edges.dat')) - 1
x = nodes[edges,0].transpose()
y = nodes[edges,1].transpose()
plot(x,y,'-bo')
show()
-- 
View this message in context: http://www.nabble.com/Plotting-edges-between-nodes-tp20708135p20774488.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John H. <jd...@gm...> - 2008年12月01日 15:58:45
On Mon, Dec 1, 2008 at 9:17 AM, Nate <ten...@ya...> wrote:
> Is there a way to plot lines with drop shadows?
>
Nothing built-in -- but you can fake it::
 import matplotlib.pyplot as plt
 import numpy as np
 t = np.arange(0.0, 2.0, 0.01)
 s = np.sin(2*np.pi*t)
 fig = plt.figure()
 ax = fig.add_subplot(111)
 ax.plot(t+0.01, s-0.01, color='gray', lw=2)
 ax.plot(t, s, color='blue', lw=3)
 plt.show()
JDH

Showing results of 35

1 2 > >> (Page 1 of 2)
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 によって変換されたページ (->オリジナル) /