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





Showing 9 results of 9

From: John H. <jdh...@ac...> - 2004年05月27日 21:34:11
This is a bug fix release
 * rotated text with newlines at all angles should work correctly now
 * fixed errorbar autoscaling and capsize problem 
 * right tick labels now in correct position
 * Added Gary's errorbar color options 
 * fixed some problems relating to singleton plots and constant plots
 * Tweaked TkAgg backend so that canvas.draw() works more like the
 other backends. Fixed a bug resulting in 2 draws per figure
 manager show(). 
 * several small optimizations to improve framerates on animated
 plots.
 * fixed a gtkagg on win98/winME bug
 * added converter=None option to plot_date for dates already in epoch
 format
 * made the figure background transparent in agg so matplotlib output
 can overlay another canvas.
http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474&release_id=241494
From: Peter G. <pgr...@ge...> - 2004年05月27日 18:54:46
>
>
>It turns out that the difference in execution times between these two
>cases is explained by the fact that the default plot style for plot is
>'-' and the default plot style for date is 'o'. 
> 
>
Yes.. changing the style to '-' fixes the performance issue... great!
>There is a small change I can make which is to allow converter to be
>None for the case in which your dates are already epoch. This will
>save some cycles, 
>
Yes.. I would certainly be for it!.. But I'm biased - all my data is 
already epoch.. ;)
-- 
Peter Groszkowski Gemini Observatory
Tel: +1 808 974-2509 670 N. A'ohoku Place
Fax: +1 808 935-9235 Hilo, Hawai'i 96720, USA
From: James B. <bo...@ll...> - 2004年05月27日 17:33:33
Until contouring is implemented, the only way to display 2D data is by 
pcolor.
I have two observations:
(1) While trying to figure out exactly what pcolor was doing ( I did 
not understand the
grid registration) I looked into the matlab documentation. The matlab 
docs explained
what was going on, so that I could get my values properly aligned on 
the grid.
This brings up a question - How close does matplotlib follow Matlab? 
Will there always
be such a close correspondence in the implementation of functions such 
as I found in pcolor?
(2) To do quantitative representation using pcolor, a colorbar function 
 is needed. This feature does not
appear on the list of future goals, I would like it to be added. I'm 
not that competent, but I will
give it a try myself. The first few easy things I tried did not work 
out.
From: John H. <jdh...@ac...> - 2004年05月27日 14:35:30
>>>>> "Philippe" == Philippe Strauss <phi...@pr...> writes:
 Philippe> Hello, I would like to use plot_date, with a 'fill'
 Philippe> style of drawing. Is it possible to do that?
date_plot doesn't do too much - it converts your dates to seconds
since the epoch and sets a date ticker and formatter. You can do the
same yourself, and then call whatever function you want. To borrow
and adapt Peter's example above. 
 import time
 from matplotlib.dates import EpochConverter
 from matplotlib.matlab import *
 from matplotlib.ticker import DateFormatter, DayLocator, HourLocator
 now=time.time()
 then=now-60*60*24*2
 dates=arange(then, now, 20) #Say have a point every 20 secs..
 vals= sin(0.001*pi*dates/60.0)
 fmt = DateFormatter('%D')
 days = DayLocator(1)
 hours = HourLocator(12)
 ax = subplot(111)
 ax.xaxis.set_major_locator(days)
 ax.xaxis.set_major_formatter(fmt)
 ax.xaxis.set_minor_locator(hours)
 fill(dates, vals)
 ax.autoscale_view()
 show()
See http://matplotlib.sf.net/matplotlib.ticker.html for more
information of tick locators and formaters. See
http://matplotlib.sf.net/matplotlib.dates.html for info on how to
convert your datetime instances to seconds since the epoch.
Cheers,
JDH
From: John H. <jdh...@ac...> - 2004年05月27日 14:25:15
>>>>> "Peter" == Peter Groszkowski <pgr...@ge...> writes:
 Peter> Hi: I was wondering whether anyone else has noticed a
 Peter> performance difference between using plot_date() and
 Peter> plot(). Here is a dummy script:
It turns out that the difference in execution times between these two
cases is explained by the fact that the default plot style for plot is
'-' and the default plot style for date is 'o'. 
Drawing a long connected line is still much faster than drawing a
bunch of circles. I think if I start using collections in Line2D to
draw markers we'll see a performance boost there, but until I do it
it's hard to estimate how much. 
There is a small change I can make which is to allow converter to be
None for the case in which your dates are already epoch. This will
save some cycles, but is negligible compared to the arc drawing time
in your example; from the profiler:
 60480 7.470 0.000 7.470 0.000 backend_agg.py:117(draw_arc)
 60480 0.200 0.000 0.200 0.000 dates.py:410(epoch)
But if I can get the marker performance much better by using
collections, then the conversion step will be worth bypassing.
JDH
From: John H. <jdh...@ac...> - 2004年05月27日 13:54:11
>>>>> "Gary" == Gary Ruben <ga...@em...> writes:
 Gary> Hi John, I can confirm that 0.54.1a fixes the crashing
 Gary> problem - thanks! However, I tested it with a few errorbar
 Gary> plots and I noticed a few things. You've changed the
 Gary> errorbar bar-ends to use markers, but the scaling is now
 Gary> different and seems no longer to be settable via the capsize
 Gary> parameter. The autoscaling no longer works either.
Doh! There was one major problem in that I had commented out the
return in maplotlib.matlab.errorbar during debugging. This explains
all your problems with working on the return lines. The body of that
function should be
 try: ret = gca().errorbar(x, y, yerr, xerr, fmt, ecolor, capsize)
 except ValueError, msg:
 msg = raise_msg_to_str(msg)
 error_msg(msg)
 else:
 draw_if_interactive()
 return ret
I don't see any problems with the capsize or autoscaling. Perhaps
with this new code you can see if you are still having troubles and
post an example.
Sorry for the troubles,
JDH
From: Philippe S. <phi...@pr...> - 2004年05月27日 13:10:22
Hello,
I would like to use plot_date, with a 'fill' style of drawing.
Is it possible to do that?
Thanks
--
Philippe Strauss, ingénieur ETS, associé
phi...@pr...
http://www.practeo.ch/
From: Peter G. <pgr...@ge...> - 2004年05月27日 03:57:29
Hi:
I was wondering whether anyone else has noticed a performance difference 
between using plot_date() and plot().
Here is a dummy script:
#!/usr/bin/env python
import time
from matplotlib.dates import EpochConverter
from matplotlib.matlab import *
from matplotlib.ticker import DateFormatter, DayLocator, HourLocator
useDates=0
now=time.time()
weekAgo=now-60*60*24*7
dates=arange(weekAgo, now, 10) #Say have a point every 10 secs..
vals=dates
if useDates:
 #Date plot
 fmt=DateFormatter('%D')
 days=DayLocator(1)
 hours=HourLocator(12)
 converter = EpochConverter()
 ax = subplot(111)
 plot_date(dates, vals, converter)
 ax.xaxis.set_major_locator(days)
 ax.xaxis.set_major_formatter(fmt)
 ax.xaxis.set_minor_locator(hours)
 #What will this do??
 #ax.autoscale_view()
else:
 #Regular plot
 plot(dates, vals)
ylabel('Number of points: '+str(len(dates)))
xlabel('time')
grid(True)
show()
I use python2.2 running on a 3.2 PIV with 2GB or ram and when I use 
regular plotting, this takes ~1sec. With plot_date() it takes ~8sec.
I really like the flexibility of the way dates are handled but this 
seems to be too much of a performance hit for me to use (I ofter have 
data sets of 500 000 points). So my question is whether I am perhaps 
missing something trivial and not setting things up right. I cannot run 
any of the date_demo scripts because don't have python2.3 so cannot test 
how fast they run.
I will need to setup the x-axis labeling as dates, but now it seems it 
would be faster to just update the xticslabels of a "regular" plot.
Any thoughts?
Thanks.
--
Peter Groszkowski Gemini Observatory
Tel: +1 808 974-2509 670 N. A'ohoku Place
Fax: +1 808 935-9235 Hilo, Hawai'i 96720, USA
From: Gary R. <ga...@em...> - 2004年05月27日 02:49:10
Hi John,
I can confirm that 0.54.1a fixes the crashing problem - thanks!
However, I tested it with a few errorbar plots and I noticed a few things.
You've changed the errorbar bar-ends to use markers, but the scaling is now different and seems no longer to be settable via the capsize parameter.
The autoscaling no longer works either.
If I use the example:
--
from matplotlib.matlab import *
t = arange(0.1, 4, 0.1)
s = exp(-t)
e = 0.1*randn(len(s))
f = 0.1*randn(len(s))
l1 = errorbar(t, s, e, f)
set(l1, 'color', 'g')
show()
--
a traceback is generated:
Traceback (most recent call last):
 File "errorbar_demo.pyw", line 10, in ?
 set(l1, 'color', 'g')
 File "C:\APPS\PYTHON23\Lib\site-packages\matplotlib\matlab.py", line 1275, in set
 func = getattr(o,funcName) 
AttributeError: 'NoneType' object has no attribute 'set_color'
I'm pretty sure this worked in 0.53
If you change 
l1 = errorbar(t, s, e, f)
to
l1,l2 = errorbar(t, s, e, f)
you get another traceback:
Traceback (most recent call last):
 File "errorbar_demo.pyw", line 8, in ?
 l1,l2 = errorbar(t, s, e, f)
TypeError: unpack non-sequence
This worked in 0.53
If you remove the set() call, the plot appears, but you'll see the autoscaling is wonky.
I discovered these because I was trying to reproduce the plots on my python page <http://users.bigpond.net.au/gazzar/python.html>
When I try to reproduce the first one, I get a traceback. If I remove the l1,e1 assignment part and the legend call, no traceback occurs. I don't understand why:
The traceback produced is:
Traceback (most recent call last):
 File "_mass_matplotlib.py", line 17, in ?
 l1,e1=errorbar(m, PrimeVals(t), [NegErrs(t), PosErrs(t)], fmt='r')
TypeError: unpack non-sequence
When I try to reproduce the second plot, the plot window appears.
The scaling shown on my webpage is the autoscaling produced with 0.53 (xaxis=2->4.5, yaxis=5.?->5.32), but the autoscaling in 0.54.1a has the axis ranges of (xaxis=1->5.5, yaxis=4->6.5). Also I have to squint to see the bar-ends ;-) <- (smiley of my left eye squinting)
regards and thanks for sorting out the GTKAgg stuff,
Gary
-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm

Showing 9 results of 9

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