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: 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 |
|
From: <ch...@se...> - 2008-10-11 22:36:40
|
The plot PDFs that matplotlib makes by default seem to be too tiny to contain my biggest axis labels and my poor Latex stuff is chopped in half. How fix? cs |
|
From: Torsten B. <br...@ph...> - 2008-10-11 16:11:33
|
Hallöchen!
Jouni K. Seppänen writes:
> Jouni K. Seppänen <jk...@ik...> writes:
>
>> Torsten Bronger <br...@ph...> writes:
>>
>>> Does anybody has an idea at which point and why Matplotlib stops
>>> working?
>
>> ...
>> if not self.passed_in_file_object:
>> self.fh.close()
>
> I wonder if we should flush a file object that was passed in... Could
> you check if the following patch (committed on the trunk) helps with
> your problem?
>
> [...]
Yes, it solves my problem.
Apparently, if you wait long enough, the rest of the file is indeed
written. However, with your patch, I see the whole file
immediately, which is much better in the multi-processes environment
of an Apache server. Thank you!
Tschö,
Torsten.
--
Torsten Bronger, aquisgrana, europa vetus
Jabber ID: tor...@ja...
|
|
From: Jouni K. S. <jk...@ik...> - 2008-10-11 13:57:05
|
Jouni K. Seppänen <jk...@ik...> writes: > Torsten Bronger <br...@ph...> writes: > >> Does anybody has an idea at which point and why Matplotlib stops >> working? ... > if not self.passed_in_file_object: > self.fh.close() I wonder if we should flush a file object that was passed in... Could you check if the following patch (committed on the trunk) helps with your problem? |
|
From: Jouni K. S. <jk...@ik...> - 2008-10-11 13:43:39
|
Torsten Bronger <br...@ph...> writes: > Thus, this is the trailing part which is missing: > http://www-users.rwth-aachen.de/torsten.bronger/pds_missing.txt > > Does anybody has an idea at which point and why Matplotlib stops > working? The missing parts are the xref table and the trailer, which are written by functions called by close(): def close(self): # End the content stream and write out the various deferred # objects self.endStream() ... self.writeImages() self.writeMarkers() self.writeXref() self.writeTrailer() if not self.passed_in_file_object: self.fh.close() So it looks like writeMarkers() has been called but writeXref() has not. -- Jouni K. Seppänen http://www.iki.fi/jks |
|
From: Torsten B. <br...@ph...> - 2008-10-11 10:12:47
|
Hallöchen! I generate PDFs of scientific data with Matplotlib. This is done automatically within a Web application written with Django. I generate a PNG thumbnail, too, which always is correct, however, the PDF is truncated in most cases. Now I wonder whether it may be a timeout by the Web server or Django itself. Thus, if Matplotlib takes too long (maybe due to cuncurrent processes), it cannot write the full PDF. However, if it fails, the truncation happens always at the same point in the file. Here's a good PDF: http://www-users.rwth-aachen.de/torsten.bronger/pds_okay.pdf And this is the truncated version: http://www-users.rwth-aachen.de/torsten.bronger/pds_truncated.pdf Thus, this is the trailing part which is missing: http://www-users.rwth-aachen.de/torsten.bronger/pds_missing.txt Does anybody has an idea at which point and why Matplotlib stops working? Tschö, Torsten. -- Torsten Bronger, aquisgrana, europa vetus Jabber ID: tor...@ja... |
|
From: Ian C. <ia...@ac...> - 2008-10-10 16:36:37
|
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! |
|
From: John H. <jd...@gm...> - 2008-10-10 12:50:03
|
On Fri, Oct 10, 2008 at 4:17 AM, Thomas Guettler <hv...@tb...> wrote: > Hi, > > I want to change the font size of x ticks labels. > The FAQ entry is only for pylab: > http://matplotlib.sourceforge.net/faq.html#TEXTOVERLAP > > I found this solution: > > for tick in ax.xaxis.get_major_ticks(): > tick.label1.set_fontsize(7.5) > (http://cfa-www.harvard.edu/~jbattat/computer/python/pylab/) > > What is the prefered way? Maybe without a loop... There is no preferred way -- the loop is the object oriented pythonic matplotlib API, the set call is the matlab-like procedural interface. Both are and will continue to be supported. Note that the FAQ is out of date since the set function (a matlab name) is now called setp to avoid clashing with the python built-in set Personally, I use for label in ax.get_xticklabels() + ax.get_yticklabels(): label.set_fontsize(12) You can also set the defaults with your rc settings import matplotlib matplotlib.rc('xtick', labelsize=12) matplotlib.rc('ytick', labelsize=12) which will affect all subsequent figures. JDH |
|
From: Thomas G. <hv...@tb...> - 2008-10-10 09:18:12
|
Hi, I want to change the font size of x ticks labels. The FAQ entry is only for pylab: http://matplotlib.sourceforge.net/faq.html#TEXTOVERLAP I found this solution: for tick in ax.xaxis.get_major_ticks(): tick.label1.set_fontsize(7.5) (http://cfa-www.harvard.edu/~jbattat/computer/python/pylab/) What is the prefered way? Maybe without a loop... Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de |
|
From: Jeff W. <js...@fa...> - 2008-10-10 00:31:36
|
Mathew Yeates wrote: > Hi Jeff > > I took a look and I'm still confused. Do you happen to have any code > that goes Geodetic (lat,lon) to Geocentric (lat,lon)? > > Thanks > Mathew Mathew: No, and I must confess I don't even know what that means. You might check the proj4 docs and/or mailing list (http://trac.osgeo.org/proj/). pyproj is a wrapper for the proj4 C library. -Jeff > > Jeff Whitaker wrote: >> Mathew Yeates wrote: >>> Hi >>> Are there any modules in matplotlib for coordinate transformations. >>> In particular, I want to go from geodetic to WGS-84. >>> >>> Thanks >>> Mathew >>> >>> >> Mathew: The pyproj module is included in the basemap toolkit and can >> be accessed with >> >> from mpl_toolkits.basemap import pyproj >> >> To see how to use it look at the docs for the Proj class at >> http://pyproj.googlecode.com/svn/trunk/README.html. >> >> If you don't want to install the whole Basemap toolkit (a 100 mb >> download) you can just install the pyproj module from >> >> http://code.google.com/p/pyproj >> >> -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: Eric F. <ef...@ha...> - 2008-10-09 23:14:59
|
Zane Selvans wrote: > Zane Selvans <zane@...> writes: > >> I'm plotting a bunch of lines on a map. They're being colored >> according to the value of an attribute associated with the objects >> they represent, using a colormap. However, I also need to create a >> colorbar to act as a legend, describing what the colors of the lines >> means, in terms of values associated with that attribute. >> >> What's the easiest way to do that? > > I've found the matplotlib.colorbar.ColorbarBase class... and have been able to > use matplotlib.colorbar.make_axes() to create a somewhat acceptable set of axes > into which I can put a colorbar constructed from the same colormap that I'm > using to color the lines I'm plotting. However, I can't seem to get the tics > and axes on the colorbar to correspond to the values associated with the colors > - they only ever go from 0-1. I want them to go from, for instance, 0-180 > (degrees) in 20 or 30 degree intervals. It seemed like setting the keyword > arguments in ColorbarBase(boundaries=[0,180]) or values=linspace(0,180,10) or > something like that ought to have done the right thing... but no, and I don't > see any documentation on how these keywords are supposed to be used, in the > docstring or elsewhere... anyone know how they work? You probably want to use the ColorbarBase.add_lines() method; you can get an example of its use for line contours in the Colorbar class, and an example of the result is in examples/pylab_examples/contour_demo.py. Eric |
|
From: Jeff W. <js...@fa...> - 2008-10-09 23:07:47
|
Mathew Yeates wrote: > Hi > Are there any modules in matplotlib for coordinate transformations. In > particular, I want to go from geodetic to WGS-84. > > Thanks > Mathew > > Mathew: The pyproj module is included in the basemap toolkit and can be accessed with from mpl_toolkits.basemap import pyproj To see how to use it look at the docs for the Proj class at http://pyproj.googlecode.com/svn/trunk/README.html. If you don't want to install the whole Basemap toolkit (a 100 mb download) you can just install the pyproj module from http://code.google.com/p/pyproj -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: Mathew Y. <my...@jp...> - 2008-10-09 23:00:11
|
Hi Are there any modules in matplotlib for coordinate transformations. In particular, I want to go from geodetic to WGS-84. Thanks Mathew |
|
From: Jeff W. <js...@fa...> - 2008-10-09 20:13:15
|
John Hunter wrote: > On Thu, Oct 9, 2008 at 2:40 PM, Zane Selvans <za...@id...> wrote: > > >> Hmm. I'll have a look at these. Jeff Whitaker suggested them for >> something else too. I too often feel like I'm just hacking my way >> around in Matplotlib, without understanding how it is actually >> "supposed" to be used (i.e. how it was designed to work). Is there an >> architectural overview floating around somewhere that I'm not aware of? >> > > Check out http://matplotlib.sourceforge.net/doc/html/users/artists.html > and other docs at > http://matplotlib.sourceforge.net/doc/html/index.html > and basemap specific docs are at http://matplotlib.sourceforge.net/basemap/doc/html -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: John H. <jd...@gm...> - 2008-10-09 19:56:01
|
On Thu, Oct 9, 2008 at 2:40 PM, Zane Selvans <za...@id...> wrote: > Hmm. I'll have a look at these. Jeff Whitaker suggested them for > something else too. I too often feel like I'm just hacking my way > around in Matplotlib, without understanding how it is actually > "supposed" to be used (i.e. how it was designed to work). Is there an > architectural overview floating around somewhere that I'm not aware of? Check out http://matplotlib.sourceforge.net/doc/html/users/artists.html and other docs at http://matplotlib.sourceforge.net/doc/html/index.html |
|
From: Zane S. <za...@id...> - 2008-10-09 19:40:50
|
On Oct 9, 2008, at 7:08 AM, Ryan May wrote: > Zane Selvans wrote: >> Zane Selvans <zane@...> writes: >> >>> I also need to create a >>> colorbar to act as a legend, describing what the colors of the lines >>> means, in terms of values associated with that attribute. >> >> I've found the matplotlib.colorbar.ColorbarBase class... >> I want them to go from, for instance, 0-180 >> (degrees) in 20 or 30 degree intervals. It seemed like setting the >> keyword >> arguments in ColorbarBase(boundaries=[0,180]) or >> values=linspace(0,180,10) or >> something like that ought to have done the right thing... but no, >> and I don't >> see any documentation on how these keywords are supposed to be >> used, in the >> docstring or elsewhere... anyone know how they work? > > You need to pass an instance of a matplotlib.colors.Normalize to the > constructure to ColorbarBase, as in: > > cbar = ColorbarBase(norm=Normalize(0, 180)) Ahhh. There we go. > As far as colormapping lines, you can do this using a LineCollection > object. Hmm. I'll have a look at these. Jeff Whitaker suggested them for something else too. I too often feel like I'm just hacking my way around in Matplotlib, without understanding how it is actually "supposed" to be used (i.e. how it was designed to work). Is there an architectural overview floating around somewhere that I'm not aware of? Thanks for the help! Zane -- Zane Selvans Amateur Earthling za...@id... 303/815-6866 http://zaneselvans.org PGP Key: 55E0815F |
|
From: Jae-Joon L. <lee...@gm...> - 2008-10-09 19:19:47
|
Although I think it is possible to calculate the bounding box of the
all legends automatically,
Here is a manual way.
from matplotlib.patches import Rectangle
l1.get_frame().set_visible(False) # make background frame of legends invisible
l2.get_frame().set_visible(False)
# make a large background frame
rect = Rectangle((0.05, 0.75), 0.3, 0.2, # adjust these values (in
normalized axes coordinate)
fc="w", ec="k",
transform=ax.transAxes, zorder=4)
ax.add_artist(rect)
I hope this help,
-JJ
On Thu, Oct 9, 2008 at 2:43 PM, José Alexandre Nalon <na...@te...> wrote:
> Hello,
>
> Em Thursday 09 October 2008 13:46:52 Jae-Joon Lee escreveu:
>> Meanwhile, you may try to make multiple legends as a posible workarounds.
>
> Thanks for your answer. That did the trick, and the figure
> looks more or less as I wanted. It would look exactly as I
> wanted if I could remove the border from the legends and
> draw a box around the legends. How could I do that?
>
> (I apologize if this seems trivial. I use matplotlib a lot,
> but standard functions always seem to do what I need, so I
> don't go deep in its behaviour).
>
> --
> José Alexandre Nalon
> na...@te...
>
> -------------------------------------------------------------------------
> 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: José A. N. <na...@te...> - 2008-10-09 18:44:04
|
Hello, Em Thursday 09 October 2008 13:46:52 Jae-Joon Lee escreveu: > Meanwhile, you may try to make multiple legends as a posible workarounds. Thanks for your answer. That did the trick, and the figure looks more or less as I wanted. It would look exactly as I wanted if I could remove the border from the legends and draw a box around the legends. How could I do that? (I apologize if this seems trivial. I use matplotlib a lot, but standard functions always seem to do what I need, so I don't go deep in its behaviour). -- José Alexandre Nalon na...@te... |
|
From: Xavier G. <xav...@gm...> - 2008-10-09 18:06:23
|
Hi, I can do everything I want with pylab (and even more :) ). I'm only missing one thing: I really would like to have one more option in imshow to get the pixel value of the pixel pointed by the cursor. The backends are showing X qnd Y coordinates. It is fine but I need also to look at the pixels values (before dooing computations thanks to scipy). I know how to get the pixels values but I do not know how to print them at the bottom right of the backend (on the same line as the X,Y pixel number). Is there a way to do that using the tk backend for instance? If there is a way, would you consider a new boolean option in imshow to trigger this new behavior (of course, the default must be 'false' to prevent us to brake things..) Any comment would be very much appreciated :) Xavier |
|
From: Anthony F. <ant...@co...> - 2008-10-09 17:56:18
|
Hi Sebastien, Sorry, I had forgotten about that. I've taken a look at the code that we have ... and it doesn't separate out nearly as much as I had thought. The code that rebuilds the plots is actually pretty complicated and messy ... not so much from a conceptual point of view but in how it was implemented. Plus, our data structure and corresponding plot structure is very nested: we have a the concept of series in series groups, which are on plots, which are in plot groups, and so on up to a few levels of grouping. Additionally, our plots allow for up to 4 'y' axes and 2 'x' axes, making the code seem more complicated than it is. When we want to store the plots, we pickle the top object (which we call our plot manager) and because of the tree-like data structure, it pickles everything right down to the data in the series. We've been very careful to ensure that there are no mpl objects referenced in the data structure. When we unpickle the plot manager, we walk our way through the tree, calling plotPanel.addPlot(...) and plotPanel.addSeries(...) as we go. In this case, plotPanel is a class that is a wx.Frame (well, an MDI frame in our case) that has a mpl figure on it, and various methods that know how to manipulate the data from our Plot and Series objects to create appropriate mpl analogues. This is strictly a one-way operation: we always build plots and series from our own objects and any modifications occur on our objects and not on the mpl lines/figures/etc. That is, if we want to change a series colour for example, the code modifies our Series object and it emits a pubsub message that causes the plotPanel to update itself based on what's in the Series object ... we never manipulate the mpl line directly. At any rate, I've attached some code to this email which illustrates what I was talking about, but it's not runnable and it references other files which I haven't included. Still you should be able to get the idea. Hope this helps, Anthony. > -----Original Message----- > From: Sebastien Binet [mailto:bi...@ce...] > Sent: October 8, 2008 9:47 PM > To: Anthony Floyd > Cc: Anthony Floyd > Subject: Re: [Matplotlib-users] save or pickle figure object > > Hi Anthony, > > On Tuesday 16 September 2008 20:30:26 Anthony Floyd wrote: > > On Tue, Sep 16, 2008 at 8:17 PM, Sebastien Binet > > > > <hep...@gm...> wrote: > > > Hi Anthony, > > > > > >> As you've already been told, you can't pickle/shelve mpl > objects. Our > > >> solution to this is to have a native python shadow object that > > >> contains all the bits and pieces needed to create a > figure, and always > > >> build the plots from these shadow objects. This gives us the > > >> advantage of being able to shelve the shadow objects and > rebuild the > > >> figures later. > > > > > > this is rather interesting ! > > > any code to point to ? > > > > Hi Sebastien, > > > > I'll see what I can extract from the code tomorrow at work. It's > > pretty modular so I should be able to point to something. > > any news about this ? > > cheers, > sebastien. > -- > ################################### > # Dr. Sebastien Binet > # Lawrence Berkeley National Lab. > # 1 Cyclotron Road > # Berkeley, CA 94720 > ################################### > > |
|
From: Jae-Joon L. <lee...@gm...> - 2008-10-09 16:46:58
|
The current legend class does not support multiple columns.
Eric Wertman once mentioned in this list that he would work on this
feature, but I don't know the current status.
A (partial) rewrite of the legend class which I plan to support
multicolumns is in my TODO list but I haven't started it yet.
Meanwhile, you may try to make multiple legends as a posible workarounds.
For example, following code plots 10 lines and make two legends, each
with 5 lines, one at upper left and one at upper right.
ax = gca()
pl_list = []
for i in range(10):
pl, = ax.plot(random(10))
pl_list.append(pl)
from matplotlib.legend import Legend
l1 = Legend(ax, pl_list[:5], "01234", loc=2)
l2 = Legend(ax, pl_list[5:], "56789", loc=1)
#l1 = Legend(ax, pl_list[:5], "01234", loc=(0.02, 0.72))
#l2 = Legend(ax, pl_list[5:], "56789", loc=(0.2, 0.72))
ax.add_artist(l1)
ax.add_artist(l2)
draw()
You may manually adjust the legend position to place the legends side
by side (see the commented lines), but it would be somewhat tricky if
you need 4 columns.
-JJ
On Thu, Oct 9, 2008 at 10:50 AM, José Alexandre Nalon
<na...@te...> wrote:
> Hello,
>
> Is there an easy way to make a legend with multiple lines
> and columns? I need 8 plots in the same figure, and the
> legend takes a lot of space. I believe that if I could
> orient the legend in multiple lines and columns (say, 2
> lines with four columns each), I could save a lot of
> space, giving more room to the plots. Any other suggestion
> would be useful. Thanks in advance.
>
> --
> José Alexandre Nalon
> na...@te...
>
> -------------------------------------------------------------------------
> 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: José A. N. <na...@te...> - 2008-10-09 15:12:15
|
Hello, Is there an easy way to make a legend with multiple lines and columns? I need 8 plots in the same figure, and the legend takes a lot of space. I believe that if I could orient the legend in multiple lines and columns (say, 2 lines with four columns each), I could save a lot of space, giving more room to the plots. Any other suggestion would be useful. Thanks in advance. -- José Alexandre Nalon na...@te... |
|
From: Ryan M. <rm...@gm...> - 2008-10-09 14:08:53
|
Zane Selvans wrote: > Zane Selvans <zane@...> writes: > >> I'm plotting a bunch of lines on a map. They're being colored >> according to the value of an attribute associated with the objects >> they represent, using a colormap. However, I also need to create a >> colorbar to act as a legend, describing what the colors of the lines >> means, in terms of values associated with that attribute. >> >> What's the easiest way to do that? > > I've found the matplotlib.colorbar.ColorbarBase class... and have been able to > use matplotlib.colorbar.make_axes() to create a somewhat acceptable set of axes > into which I can put a colorbar constructed from the same colormap that I'm > using to color the lines I'm plotting. However, I can't seem to get the tics > and axes on the colorbar to correspond to the values associated with the colors > - they only ever go from 0-1. I want them to go from, for instance, 0-180 > (degrees) in 20 or 30 degree intervals. It seemed like setting the keyword > arguments in ColorbarBase(boundaries=[0,180]) or values=linspace(0,180,10) or > something like that ought to have done the right thing... but no, and I don't > see any documentation on how these keywords are supposed to be used, in the > docstring or elsewhere... anyone know how they work? You need to pass an instance of a matplotlib.colors.Normalize to the constructure to ColorbarBase, as in: cbar = ColorbarBase(norm=Normalize(0, 180)) As far as colormapping lines, you can do this using a LineCollection object. Hope this helps, Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |