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
(8) |
2
(11) |
3
(4) |
4
(6) |
|
5
(13) |
6
(30) |
7
(21) |
8
(9) |
9
(19) |
10
(4) |
11
(5) |
|
12
(14) |
13
(19) |
14
(22) |
15
(12) |
16
(15) |
17
(14) |
18
(1) |
|
19
(1) |
20
(11) |
21
(9) |
22
(18) |
23
(39) |
24
(12) |
25
(7) |
|
26
(13) |
27
(18) |
28
(3) |
29
(5) |
30
(12) |
31
(10) |
|
|
From: Eric F. <ef...@ha...> - 2008-10-12 23:26:51
|
Goyo wrote:
> El lun, 13-10-2008 a las 00:41 +0200, Goyo escribió:
>
>> But I don't know how to set the dpi value this way. I tried to use the
>> OO API but no success.
>
> Well yes...
>
> import matplotlib
> matplotlib.use('GTKAgg')
> from matplotlib import pyplot
> fig = pyplot.figure(dpi=100)
> ax = fig.add_subplot('111')
> ax.plot([1, 2, 3], [1, 2, 3])
> fig.savefig('test.jpg')
>
> But changing the dpi value has no effect so maybe I'm missing something.
The figure dpi is irrelevant when saving the figure; only the dpi
specified in the savefig command matters for that. This is inherently
confusing. I'm thinking about a solution, but haven't tried it yet.
Eric
|
|
From: Eric F. <ef...@ha...> - 2008-10-12 23:23:13
|
Goyo wrote:
> Hi all,
>
> I'm plotting time series and using a custom format for x tick labels
> because I want to see both date and time. But calling xlim makes the
> default format return -- only dates or only times, it depends on the
> displayed interval.
>
> I can get my preferred format back by calling set_major_formatter again,
> but this is inconvenient for interactive use.
>
> I wonder if there is a better way for changing x limits while keeping
> tick labels format unchanged.
>
> I'm using matplotlib 0.98.3
>
> Thanks
>
> Goyo
>
>
> Sample code -- you need a combination of python shell and matplotlib GUI
> which allows for interactive use in order to get this working as
> expected:
>
> ----------------------------------------
>
> from matplotlib import pyplot
> from matplotlib import dates
> from datetime import datetime, timedelta
> from numpy import random
>
> pyplot.ion()
>
> # create data
> dstart = datetime(2008, 1, 1, 0, 0)
> dend = datetime(2008, 1, 5, 23, 50)
> delta = timedelta(minutes=10)
> x = dates.drange(dstart, dend, delta)
> y = random.random_sample(len(x))
>
> # plot data
> pyplot.plot(x, y)
>
> # format x tick labels
> axis = pyplot.gca()
> fig = pyplot.gcf()
> axis.xaxis.set_major_formatter(dates.DateFormatter('%Y-%b-%d %H:%M'))
> fig.autofmt_xdate()
>
> # draw the figure
> pyplot.draw()
>
> --------------------------------------
>
> Look at the tick labels, they show both date and time even if you zoom
> and pan using the GUI.
>
> Now if I want to look at the second day:
>
> dstart = datetime(2008, 1, 1, 0, 0)
> dend = datetime(2008, 1, 1, 23, 50)
> pyplot.xlim(dstart, dend)
>
> And the format has changed.
I don't see this problem using ipython -pylab with mpl from svn on
linux, gtkagg backend. What version, backend, and platform are you using?
Eric
|
|
From: Goyo <goy...@gm...> - 2008-10-12 23:17:09
|
El lun, 13-10-2008 a las 00:41 +0200, Goyo escribió:
> But I don't know how to set the dpi value this way. I tried to use the
> OO API but no success.
Well yes...
import matplotlib
matplotlib.use('GTKAgg')
from matplotlib import pyplot
fig = pyplot.figure(dpi=100)
ax = fig.add_subplot('111')
ax.plot([1, 2, 3], [1, 2, 3])
fig.savefig('test.jpg')
But changing the dpi value has no effect so maybe I'm missing something.
Goyo
|
|
From: Eric F. <ef...@ha...> - 2008-10-12 23:16:32
|
Goyo wrote:
> I can't make much sense of this. You don't plot anything and don't use
> canvas.
>
> This code works:
>
> import matplotlib
> matplotlib.use('GTKAgg')
> from matplotlib import pyplot
> pyplot.plot([0, 1, 2, 3], [0, 1, 2, 3])
> fig = pyplot.gcf()
> fig.savefig('test.jpg')
fig.savefig('test.jpg', dpi=150) # or whatever dpi you want
If you are only using savefig, not plotting to the screen, then you
might as well use the agg backend, not the gtkagg.
Eric
>
> But I don't know how to set the dpi value this way. I tried to use the
> OO API but no success.
>
> Goyo
>
> El dom, 12-10-2008 a las 23:45 +0200, Jesper Larsen escribió:
>> Hi matplotlib-users,
>>
>> I decided to try to make some plots that I have previously made in png
>> format using the Agg backend in jpeg format using the GTKAgg backend
>> (which I guess is the one I should use for this). Unfortunately my
>> script exits with an error. I have therefore created a simple test
>> script (test.py) that illustrates the problem (at least on my
>> computer):
>>
>> import matplotlib
>> from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as
>> FigureCanvas
>>
>> fig = matplotlib.figure.Figure(dpi=100)
>> canvas = FigureCanvas(fig)
>> fig.savefig('test.jpg')
>>
>> When I run it I get:
>>
>> $ python test.py
>> /usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py:357:
>> GtkWarning: gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED
>> (widget) || GTK_IS_INVISIBLE (widget)' failed
>> gtk.DrawingArea.realize(self)
>> /usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py:360:
>> GtkWarning: gdk_pixmap_new: assertion `(drawable != NULL) || (depth !=
>> -1)' failed
>> pixmap = gdk.Pixmap (self.window, width, height)
>> Traceback (most recent call last):
>> File "test.py", line 6, in <module>
>> fig.savefig('test.jpg')
>> File "/usr/lib/python2.5/site-packages/matplotlib/figure.py", line
>> 964, in savefig
>> self.canvas.print_figure(*args, **kwargs)
>> File "/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py",
>> line 1310, in print_figure
>> **kwargs)
>> File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
>> line 347, in print_jpeg
>> return self._print_image(filename, 'jpeg')
>> File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
>> line 360, in _print_image
>> pixmap = gdk.Pixmap (self.window, width, height)
>> RuntimeError: could not create GdkPixmap object
>>
>> I am using matplotlib 0.98.3, pygtk 2.14.0. My system is a Linux Ubuntu:
>>
>> $ uname -a
>> Linux <blanket out> #1 SMP Wed Aug 20 18:39:13 UTC 2008 i686 GNU/Linux
>>
>> Does anyone know what is wrong?
>>
>> Best regards,
>> Jesper
|
|
From: Goyo <goy...@gm...> - 2008-10-12 22:41:41
|
I can't make much sense of this. You don't plot anything and don't use
canvas.
This code works:
import matplotlib
matplotlib.use('GTKAgg')
from matplotlib import pyplot
pyplot.plot([0, 1, 2, 3], [0, 1, 2, 3])
fig = pyplot.gcf()
fig.savefig('test.jpg')
But I don't know how to set the dpi value this way. I tried to use the
OO API but no success.
Goyo
El dom, 12-10-2008 a las 23:45 +0200, Jesper Larsen escribió:
> Hi matplotlib-users,
>
> I decided to try to make some plots that I have previously made in png
> format using the Agg backend in jpeg format using the GTKAgg backend
> (which I guess is the one I should use for this). Unfortunately my
> script exits with an error. I have therefore created a simple test
> script (test.py) that illustrates the problem (at least on my
> computer):
>
> import matplotlib
> from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as
> FigureCanvas
>
> fig = matplotlib.figure.Figure(dpi=100)
> canvas = FigureCanvas(fig)
> fig.savefig('test.jpg')
>
> When I run it I get:
>
> $ python test.py
> /usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py:357:
> GtkWarning: gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED
> (widget) || GTK_IS_INVISIBLE (widget)' failed
> gtk.DrawingArea.realize(self)
> /usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py:360:
> GtkWarning: gdk_pixmap_new: assertion `(drawable != NULL) || (depth !=
> -1)' failed
> pixmap = gdk.Pixmap (self.window, width, height)
> Traceback (most recent call last):
> File "test.py", line 6, in <module>
> fig.savefig('test.jpg')
> File "/usr/lib/python2.5/site-packages/matplotlib/figure.py", line
> 964, in savefig
> self.canvas.print_figure(*args, **kwargs)
> File "/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py",
> line 1310, in print_figure
> **kwargs)
> File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
> line 347, in print_jpeg
> return self._print_image(filename, 'jpeg')
> File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
> line 360, in _print_image
> pixmap = gdk.Pixmap (self.window, width, height)
> RuntimeError: could not create GdkPixmap object
>
> I am using matplotlib 0.98.3, pygtk 2.14.0. My system is a Linux Ubuntu:
>
> $ uname -a
> Linux <blanket out> #1 SMP Wed Aug 20 18:39:13 UTC 2008 i686 GNU/Linux
>
> Does anyone know what is wrong?
>
> Best regards,
> Jesper
>
> -------------------------------------------------------------------------
> 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: Goyo <goy...@gm...> - 2008-10-12 21:57:50
|
Hi all,
I'm plotting time series and using a custom format for x tick labels
because I want to see both date and time. But calling xlim makes the
default format return -- only dates or only times, it depends on the
displayed interval.
I can get my preferred format back by calling set_major_formatter again,
but this is inconvenient for interactive use.
I wonder if there is a better way for changing x limits while keeping
tick labels format unchanged.
I'm using matplotlib 0.98.3
Thanks
Goyo
Sample code -- you need a combination of python shell and matplotlib GUI
which allows for interactive use in order to get this working as
expected:
----------------------------------------
from matplotlib import pyplot
from matplotlib import dates
from datetime import datetime, timedelta
from numpy import random
pyplot.ion()
# create data
dstart = datetime(2008, 1, 1, 0, 0)
dend = datetime(2008, 1, 5, 23, 50)
delta = timedelta(minutes=10)
x = dates.drange(dstart, dend, delta)
y = random.random_sample(len(x))
# plot data
pyplot.plot(x, y)
# format x tick labels
axis = pyplot.gca()
fig = pyplot.gcf()
axis.xaxis.set_major_formatter(dates.DateFormatter('%Y-%b-%d %H:%M'))
fig.autofmt_xdate()
# draw the figure
pyplot.draw()
--------------------------------------
Look at the tick labels, they show both date and time even if you zoom
and pan using the GUI.
Now if I want to look at the second day:
dstart = datetime(2008, 1, 1, 0, 0)
dend = datetime(2008, 1, 1, 23, 50)
pyplot.xlim(dstart, dend)
And the format has changed.
|
|
From: Mathew Y. <my...@jp...> - 2008-10-12 21:57:04
|
never mind. Got it working. One annoying thing, though, when the line reaches the edge of the figure, a line is drawn horizontally to the other side. This doesn't happen when I display all of the points at once. Mathew Mathew Yeates wrote: > something isn't working > In my main routine I have > xpt,ypt= m(lons[0:500],lats[0:500]) > outlines=m.plot(xpt,ypt,'r-') #m is my basemap, outlines is a list of > size 1. Huh? > > then in my update routine I have > counter=0 > def update(): > global counter > xpt,ypt= > m(lons[counter*500:(counter+1)*500],lats[counter*500:(counter+1)*500]) > counter += 1 > outlines[0].set_data(xpt,ypt) > canvas.draw_idle() > return True > > but this produces strange results. After a few iterations the line > disappears completely. Is it wrong to use lists when I get xpt and ypt? > > Mathew > > > > > > Jeff Whitaker wrote: > >> Mathew Yeates wrote: >> >>> Hi >>> >>> I see the example of updating a plot in >>> examples/animation/gtk_timeout.py where the 2 lines >>> ---- >>> line.set_ydata(np.random.rand(10)) >>> fig.canvas.draw_idle() >>> ---- >>> >>> >>> What is the equivalent when I want to update a Basemap with new >>> latitudes and longitudes and I have done >>> m=Basemap(......) >>> m.plot(longitude_list,latitude_list) >>> >>> Thanks >>> Mathew >>> >>> >> Mathew: The Basemap plot method returns a list of matplotlib Line2d >> objects which you can use just as in the example. >> >> -Jeff >> >> > > > > ------------------------------------------------------------------------- > 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: Jeff W. <js...@fa...> - 2008-10-12 21:56:33
|
Mathew Yeates wrote: > something isn't working > In my main routine I have > xpt,ypt= m(lons[0:500],lats[0:500]) > outlines=m.plot(xpt,ypt,'r-') #m is my basemap, outlines is a list of > size 1. Huh? Mathew: It's one line, so the list has one Line2D object. > > then in my update routine I have > counter=0 > def update(): > global counter > xpt,ypt= > m(lons[counter*500:(counter+1)*500],lats[counter*500:(counter+1)*500]) > counter += 1 > outlines[0].set_data(xpt,ypt) > canvas.draw_idle() > return True > > but this produces strange results. After a few iterations the line > disappears completely. Is it wrong to use lists when I get xpt and ypt? > > Mathew Don't really understand what you're trying to do here, so I can't comment. -Jeff > > > > > > Jeff Whitaker wrote: >> Mathew Yeates wrote: >>> Hi >>> >>> I see the example of updating a plot in >>> examples/animation/gtk_timeout.py where the 2 lines >>> ---- >>> line.set_ydata(np.random.rand(10)) >>> fig.canvas.draw_idle() >>> ---- >>> >>> >>> What is the equivalent when I want to update a Basemap with new >>> latitudes and longitudes and I have done >>> m=Basemap(......) >>> m.plot(longitude_list,latitude_list) >>> >>> Thanks >>> Mathew >>> >> >> Mathew: The Basemap plot method returns a list of matplotlib Line2d >> objects which you can use just as in the example. >> >> -Jeff >> > > -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |
|
From: Jesper L. <jes...@gm...> - 2008-10-12 21:51:30
|
Hi matplotlib-users,
I decided to try to make some plots that I have previously made in png
format using the Agg backend in jpeg format using the GTKAgg backend
(which I guess is the one I should use for this). Unfortunately my
script exits with an error. I have therefore created a simple test
script (test.py) that illustrates the problem (at least on my
computer):
import matplotlib
from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as
FigureCanvas
fig = matplotlib.figure.Figure(dpi=100)
canvas = FigureCanvas(fig)
fig.savefig('test.jpg')
When I run it I get:
$ python test.py
/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py:357:
GtkWarning: gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED
(widget) || GTK_IS_INVISIBLE (widget)' failed
gtk.DrawingArea.realize(self)
/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py:360:
GtkWarning: gdk_pixmap_new: assertion `(drawable != NULL) || (depth !=
-1)' failed
pixmap = gdk.Pixmap (self.window, width, height)
Traceback (most recent call last):
File "test.py", line 6, in <module>
fig.savefig('test.jpg')
File "/usr/lib/python2.5/site-packages/matplotlib/figure.py", line
964, in savefig
self.canvas.print_figure(*args, **kwargs)
File "/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py",
line 1310, in print_figure
**kwargs)
File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
line 347, in print_jpeg
return self._print_image(filename, 'jpeg')
File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
line 360, in _print_image
pixmap = gdk.Pixmap (self.window, width, height)
RuntimeError: could not create GdkPixmap object
I am using matplotlib 0.98.3, pygtk 2.14.0. My system is a Linux Ubuntu:
$ uname -a
Linux <blanket out> #1 SMP Wed Aug 20 18:39:13 UTC 2008 i686 GNU/Linux
Does anyone know what is wrong?
Best regards,
Jesper
|
|
From: Mathew Y. <my...@jp...> - 2008-10-12 21:12:07
|
something isn't working
In my main routine I have
xpt,ypt= m(lons[0:500],lats[0:500])
outlines=m.plot(xpt,ypt,'r-') #m is my basemap, outlines is a list of
size 1. Huh?
then in my update routine I have
counter=0
def update():
global counter
xpt,ypt=
m(lons[counter*500:(counter+1)*500],lats[counter*500:(counter+1)*500])
counter += 1
outlines[0].set_data(xpt,ypt)
canvas.draw_idle()
return True
but this produces strange results. After a few iterations the line
disappears completely. Is it wrong to use lists when I get xpt and ypt?
Mathew
Jeff Whitaker wrote:
> Mathew Yeates wrote:
>> Hi
>>
>> I see the example of updating a plot in
>> examples/animation/gtk_timeout.py where the 2 lines
>> ----
>> line.set_ydata(np.random.rand(10))
>> fig.canvas.draw_idle()
>> ----
>>
>>
>> What is the equivalent when I want to update a Basemap with new
>> latitudes and longitudes and I have done
>> m=Basemap(......)
>> m.plot(longitude_list,latitude_list)
>>
>> Thanks
>> Mathew
>>
>
> Mathew: The Basemap plot method returns a list of matplotlib Line2d
> objects which you can use just as in the example.
>
> -Jeff
>
|
|
From: Jeff W. <js...@fa...> - 2008-10-12 18:37:30
|
Mathew Yeates wrote: > Hi > > I see the example of updating a plot in > examples/animation/gtk_timeout.py where the 2 lines > ---- > line.set_ydata(np.random.rand(10)) > fig.canvas.draw_idle() > ---- > > > What is the equivalent when I want to update a Basemap with new > latitudes and longitudes and I have done > m=Basemap(......) > m.plot(longitude_list,latitude_list) > > Thanks > Mathew > Mathew: The Basemap plot method returns a list of matplotlib Line2d objects which you can use just as in the example. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |
|
From: Mathew Y. <my...@jp...> - 2008-10-12 17:41:36
|
Hi I see the example of updating a plot in examples/animation/gtk_timeout.py where the 2 lines ---- line.set_ydata(np.random.rand(10)) fig.canvas.draw_idle() ---- What is the equivalent when I want to update a Basemap with new latitudes and longitudes and I have done m=Basemap(......) m.plot(longitude_list,latitude_list) Thanks Mathew |
|
From: Friedrich, R. K <Rob...@us...> - 2008-10-12 16:30:43
|
I'm having an unusually hard time with plotting some data on a date axis.
All I want to do is plot several data series over a specific 8 week period. It works fine when I plot all the data (that is not specifying a date range) but
when I try to use the axis command to put in my limits it puts the scales up nicely but no data points appear and moreover then I reload and run it again it
goes into an infinite loop. I've tried it with Matplotlib 0.90.1 and 0.98.1 with the same results.
The plot() method below:
class Plotter:
"""Generate plots of disk trend data
"""
Marker = ['s','o','^','d','v','p','x','+','h','<','>','1']
Color = ['black','red','blue','green','aqua','fuchsia',
'navy','purple','olive','maroon','gray','teal']
def __init__(self, trenddict):
self.trenddict = trenddict
self.today = datetime.date.today()
self.dates = trenddict.keys() #keys are datetime objects
self.dates.sort() #sorted list of datetime objects
def extract(self, dirlist):
x = []
ys = {}
for date in self.dates:
x.append(date2num(date))
for dirname in dirlist:
value = self.trenddict[date][dirname]
try:
ys[dirname].append(value)
except KeyError:
ys[dirname] = [value]
return x, ys
def plot(self, dirlist, title, scalemax, filename):
fig = figure(num=1, figsize=(8,10), frameon=False)
ax = fig.add_subplot(111)
ax.set_title(title)
ax.xaxis.set_major_locator(WeekdayLocator(MONDAY))
ax.xaxis.set_minor_locator(MultipleLocator(1))
ax.yaxis.set_major_locator(MultipleLocator(10))
ax.set_ylabel("GBytes")
ax.grid(True)
start = date2num(self.today - datetime.timedelta(49))
end = date2num(self.today + datetime.timedelta(7))
#fig.autofmt_xdate()
ax.axis([start, end, 0, scalemax])
x, ys = self.extract(dirlist)
for i, directory in enumerate(dirlist):
plot_date(x, ys[directory],
linestyle='-',
marker=self.Marker[i],
color=self.Color[i],
label=directory)
tl = ax.get_xticklabels()
setp(tl, 'rotation', 45, fontsize=10)
legend(loc='lower left', prop=FontProperties(size="smaller"))
savefig(filename)
show()
close()
|
|
From: Jeff W. <js...@fa...> - 2008-10-12 12:37:30
|
Ian Curington wrote: > Does anyone have extensions or hints on how to create high quality > vector contour plots on unstructured triangle meshes, with values at > nodes? I can convert to structured with griddata, but I much prefer to > get a direct contour from the original triangles. Thanks! Ian: Matplotlib's contour cannot do this (although I believe the underlying c code does have this capability). I think it would be a useful addition. For right now, however, your workaround is the best solution. PyNGL (http://www.pyngl.ucar.edu/Graphics/contour_grids.shtml) can contour triangular meshes, if you'd like to give that a try. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |