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
(5) |
|
2
|
3
(3) |
4
(16) |
5
(8) |
6
(22) |
7
(10) |
8
(18) |
|
9
(11) |
10
(7) |
11
(16) |
12
(1) |
13
(10) |
14
(14) |
15
(2) |
|
16
(3) |
17
(19) |
18
(24) |
19
(35) |
20
(38) |
21
(27) |
22
(1) |
|
23
(9) |
24
(6) |
25
(24) |
26
(9) |
27
(7) |
28
(5) |
29
(9) |
|
30
(4) |
|
|
|
|
|
|
|
From: Jeff M. <jm...@nr...> - 2008-11-18 23:28:23
|
Jeff Mangum wrote: > > > > Robert Kern-2 wrote: >> >> Jeff Mangum wrote: >>> Hello, >>> >>> I am having a problem installing matplotlib 0.93.3 from egg on Mac OSX >>> 10.5.5. Even though I have numpy 1.2.1 installed in >>> /Library/Frameworks/..., the egg insists on using an older version of >>> numpy (1.0.4) in /opt/local/lib/python2.5/site-packages (which must have >>> been delivered with the OS). >> >> No, /opt/local is MacPorts territory. >> >>> How can I tell the egg where to find the >>> proper version of numpy? Thanks! >> >> Are you sure you are using the same versions of Python to run and install >> both >> of these? >> >> -- >> Robert Kern >> >> "I have come to believe that the whole world is an enigma, a harmless >> enigma >> that is made terrible by our own mad attempt to interpret it as though >> it had >> an underlying truth." >> -- Umberto Eco >> >> >> ------------------------------------------------------------------------- >> 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 >> >> > > Pretty sure that I am using the same versions of python to run and > install. Here is the trace when I try to install matplotlib: > > torgo:Desktop jmangum$ easy_install > ./matplotlib-0.98.3-py2.5-macosx-10.3.egg > Processing matplotlib-0.98.3-py2.5-macosx-10.3.egg > removing > '/Library/Python/2.5/site-packages/matplotlib-0.98.3-py2.5-macosx-10.3.egg' > (and everything under it) > creating > /Library/Python/2.5/site-packages/matplotlib-0.98.3-py2.5-macosx-10.3.egg > Extracting matplotlib-0.98.3-py2.5-macosx-10.3.egg to > /Library/Python/2.5/site-packages > matplotlib 0.98.3 is already the active version in easy-install.pth > > Installed > /Library/Python/2.5/site-packages/matplotlib-0.98.3-py2.5-macosx-10.3.egg > Processing dependencies for matplotlib==0.98.3 > Searching for matplotlib==0.98.3 > Reading http://pypi.python.org/simple/matplotlib/ > Reading http://matplotlib.sourceforge.net > Reading > https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194 > Reading > https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474 > Reading http://sourceforge.net/project/showfiles.php?group_id=80706 > Best match: matplotlib 0.98.3 > Downloading > http://downloads.sourceforge.net/matplotlib/matplotlib-0.98.3.tar.gz?modtime=1217773039&big_mirror=0 > Processing matplotlib-0.98.3.tar.gz > Running matplotlib-0.98.3/setup.py -q bdist_egg --dist-dir > /var/folders/P-/P-e5QX4vHmezGAqqg2iH1k++C86/-Tmp-/easy_install-wEpzrD/matplotlib-0.98.3/egg-dist-tmp-Op3Pcx > ============================================================================ > BUILDING MATPLOTLIB > matplotlib: 0.98.3 > python: 2.5.1 (r251:54863, Apr 15 2008, 22:57:26) [GCC > 4.0.1 (Apple Inc. build 5465)] > platform: darwin > > REQUIRED DEPENDENCIES > * numpy 1.1 or later is required; you have 1.0.1 > error: Setup script exited with 1 > > > Thanks for your help! > > -- Jeff > > Sorry, but indeed the easy_install is finding the "stock" Apple python rather than the python.org version I recently installed: ============================================================================ BUILDING MATPLOTLIB matplotlib: 0.98.3 python: 2.5.1 (r251:54863, Apr 15 2008, 22:57:26) [GCC 4.0.1 (Apple Inc. build 5465)] platform: darwin REQUIRED DEPENDENCIES * numpy 1.1 or later is required; you have 1.0.1 error: Setup script exited with 1 torgo:Desktop jmangum$ which python /Library/Frameworks/Python.framework/Versions/Current/bin/python torgo:Desktop jmangum$ python Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> How can I instruct the matplotlib install to find the appropriate python install? Thanks! -- Jeff -- View this message in context: http://www.nabble.com/matplotlib-egg-finds-wrong-version-of-numpy-tp20544369p20570792.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Jeff M. <jm...@nr...> - 2008-11-18 23:22:25
|
Robert Kern-2 wrote: > > Jeff Mangum wrote: >> Hello, >> >> I am having a problem installing matplotlib 0.93.3 from egg on Mac OSX >> 10.5.5. Even though I have numpy 1.2.1 installed in >> /Library/Frameworks/..., the egg insists on using an older version of >> numpy (1.0.4) in /opt/local/lib/python2.5/site-packages (which must have >> been delivered with the OS). > > No, /opt/local is MacPorts territory. > >> How can I tell the egg where to find the >> proper version of numpy? Thanks! > > Are you sure you are using the same versions of Python to run and install > both > of these? > > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless > enigma > that is made terrible by our own mad attempt to interpret it as though > it had > an underlying truth." > -- Umberto Eco > > > ------------------------------------------------------------------------- > 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 > > Pretty sure that I am using the same versions of python to run and install. Here is the trace when I try to install matplotlib: torgo:Desktop jmangum$ easy_install ./matplotlib-0.98.3-py2.5-macosx-10.3.egg Processing matplotlib-0.98.3-py2.5-macosx-10.3.egg removing '/Library/Python/2.5/site-packages/matplotlib-0.98.3-py2.5-macosx-10.3.egg' (and everything under it) creating /Library/Python/2.5/site-packages/matplotlib-0.98.3-py2.5-macosx-10.3.egg Extracting matplotlib-0.98.3-py2.5-macosx-10.3.egg to /Library/Python/2.5/site-packages matplotlib 0.98.3 is already the active version in easy-install.pth Installed /Library/Python/2.5/site-packages/matplotlib-0.98.3-py2.5-macosx-10.3.egg Processing dependencies for matplotlib==0.98.3 Searching for matplotlib==0.98.3 Reading http://pypi.python.org/simple/matplotlib/ Reading http://matplotlib.sourceforge.net Reading https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194 Reading https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474 Reading http://sourceforge.net/project/showfiles.php?group_id=80706 Best match: matplotlib 0.98.3 Downloading http://downloads.sourceforge.net/matplotlib/matplotlib-0.98.3.tar.gz?modtime=1217773039&big_mirror=0 Processing matplotlib-0.98.3.tar.gz Running matplotlib-0.98.3/setup.py -q bdist_egg --dist-dir /var/folders/P-/P-e5QX4vHmezGAqqg2iH1k++C86/-Tmp-/easy_install-wEpzrD/matplotlib-0.98.3/egg-dist-tmp-Op3Pcx ============================================================================ BUILDING MATPLOTLIB matplotlib: 0.98.3 python: 2.5.1 (r251:54863, Apr 15 2008, 22:57:26) [GCC 4.0.1 (Apple Inc. build 5465)] platform: darwin REQUIRED DEPENDENCIES * numpy 1.1 or later is required; you have 1.0.1 error: Setup script exited with 1 Thanks for your help! -- Jeff -- View this message in context: http://www.nabble.com/matplotlib-egg-finds-wrong-version-of-numpy-tp20544369p20570681.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Christopher B. <c-...@as...> - 2008-11-18 19:54:48
|
Thank you Jae-Joon, JL> get_frame() is deprecated (it is supposed to show you a JL> DeprecationWarning). Axes class now has a "frame" property, so JL> gca().frame.set_linewidth(2) should work. JL> Currently get_frame() returns Axes.patch which is used to draw a JL> axes background. -- Christopher Brown, Ph.D. Department of Speech and Hearing Science Arizona State University |
|
From: Jae-Joon L. <lee...@gm...> - 2008-11-18 19:53:11
|
On Tue, Nov 18, 2008 at 9:20 AM, John Hunter <jd...@gm...> wrote: > > > There are two related problems here: one easier, one harder. We can > start with the easier one. The easy one is to have a "detachable > axis". Right now we have one on the right and one on the left for the > x-axis. We may as well generalize this to allow folks to have as many > as they want and put them whereever they want (center, offset farther > to the left, etc.). It would be nice to support a different set of > tick locators and formatters for each axis, eg you could have a left > axis in dollars and a right axis in euros. Note this is not the same > thing as having a different scale, in the sense of the two_scales > example, this is just two different formatting of the same scale. The > harder problem is supporting an arbitrary number of axis instances > each with its own transform, etc. Eg generalizing the two_scales > example. I suggest you punt on that one for now. > I spent some time on this a while ago. And I was able to partially implement what John described above. I'm attaching my code, but note that it is more like a proof of the concept, than a practical code. What it can do now is to place an axis at some arbitrary position (can be either an axes coordinate or a data coordinate). In brief, the code is consisted of GridHelper and AxisLine. My intention was an Axes object has a single GridHelper instance and multiple AxisLine instances. I wanted to make some framework which can work with any arbitrary transformation (for example, see http://www.atnf.csiro.au/people/mcalabre/WCS/PGSBOX/index.html), and this affected some of my design. I only had a partial success on this, and then swamped by other things. So, I'm also willing to help Mike on this. And even though Mike start with easy things, I wish the design is flexible enough to be extended to support an arbitrary transformation in a future. -JJ |
|
From: Jae-Joon L. <lee...@gm...> - 2008-11-18 19:02:07
|
get_frame() is deprecated (it is supposed to show you a DeprecationWarning). Axes class now has a "frame" property, so gca().frame.set_linewidth(2) should work. Currently get_frame() returns Axes.patch which is used to draw a axes background. -JJ On Tue, Nov 18, 2008 at 12:24 PM, Christopher Brown <c-...@as...> wrote: > Hi Users, > > I use the following to adjust the line width of the ticks and bounding box: > > for tl in plt.gca().get_xticklines() + plt.gca().get_yticklines(): > tl.set_markeredgewidth(2) > plt.gca().get_frame().set_linewidth(2) > > I'm not sure when it happened, but sometime relatively recently the > get_frame().set_linewidth() command stopped working, and only the ticks > are getting updated. > > In [5]: matplotlib.__version__ > Out[5]: '0.98.3' > > In [6]: os.name > Out[6]: 'nt' > > Any ideas about what I'm doing wrong? > > -- > Christopher Brown, Ph.D. > Department of Speech and Hearing Science > Arizona State University > > ------------------------------------------------------------------------- > 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: João L. S. <js...@fc...> - 2008-11-18 18:55:16
|
Hi,
A vertical line on the x axis of a semilogy plot will be in the correct
position, but when saved with the save button of the toolbar it will be
placed in an incorrect position, although savefig will do the right
thing. Furthermore, zooming will not move the axvline correctly.
Matplotlib version: 0.98.3
Example script:
-----------------------------------------
import matplotlib.pyplot as pl
import numpy as np
x = np.linspace(0.0,1.0,100)
pl.semilogy(x,x**2)
pl.axvline(x=0.5,ls='--',color='k')
pl.show()
#pl.savefig("saved_image.png")
-----------------------------------------
image.png was saved using the toolbar, saved_image.png using savefig.
Regards,
João Silva
|
|
From: Christopher B. <c-...@as...> - 2008-11-18 17:24:21
|
Hi Users,
I use the following to adjust the line width of the ticks and bounding box:
for tl in plt.gca().get_xticklines() + plt.gca().get_yticklines():
tl.set_markeredgewidth(2)
plt.gca().get_frame().set_linewidth(2)
I'm not sure when it happened, but sometime relatively recently the
get_frame().set_linewidth() command stopped working, and only the ticks
are getting updated.
In [5]: matplotlib.__version__
Out[5]: '0.98.3'
In [6]: os.name
Out[6]: 'nt'
Any ideas about what I'm doing wrong?
--
Christopher Brown, Ph.D.
Department of Speech and Hearing Science
Arizona State University
|
|
From: Jon W. <wr...@es...> - 2008-11-18 17:19:40
|
Hello,
Thanks for updating the files API_CHANGES & MIGRATION.txt, I have now
read them and fear that a problem I have is due to calling:
f = figure()
h = f.bbox.height()
Which should change to:
f = figure()
h = f.bbox.height
Is the expectation that I should write something like this instead:
if f.bbox.height.hasattr("__call__"):
h = f.bbox.height()
else:
h = f.bbox.height
It lacks something aesthetically. How are people handling this? Do you
insist on users having a pre- or post- 0.98 version? Have I missed a
trick? Perhaps some kind of monkeypatch that can be applied so that old
versions would appear to look like the new versions?
Thanks,
Jon
|
|
From: B C. <clo...@ya...> - 2008-11-18 16:21:19
|
While I though this would be fairly
easy, I've yet to find a decent solution. I'm interested in using the
RangeSelector or standard zoom feature along with an autoscaling
function. In the example below there are two gaussian profiles created
in a matrix. I would like to have the behavior in which when I zoom in
that the Z scale is reordered to account for the new range of data. Is
my only solution to take the limits returned by a RangeSelector event
and extract a sub-matix from the original data and replot each time I
zoom in or out or is there a more elegant solution? Is there a way to also extend such functionality to contour, pcolor, etc.?
Cheers,
Brian
######paste in ipython###########################################
from numpy import *
from matplotlib.widgets import RectangleSelector
import pylab as P
def gaussian(height, center_x, center_y, width_x, width_y):
"""Returns a gaussian function with the given parameters"""
width_x = float(width_x)
width_y = float(width_y)
return lambda x,y: height*exp(-(((center_x-x)/width_x)**2+((center_y-y)/width_y)**2)/2)
def line_select_callback(event1, event2):
'event1 and event2 are the press and release events'
x1, y1 = event1.xdata, event1.ydata
x2, y2 = event2.xdata, event2.ydata
print "(%3.2f, %3.2f) --> (%3.2f, %3.2f)"%(x1,y1,x2,y2)
print " The button you used were: ",event1.button, event2.button
cla()
# Create the gaussian data
Xin, Yin = mgrid[0:201, 0:201]
Xin2, Yin2 = mgrid[0:201, 0:201]
data = gaussian(20, 100, 100, 20, 40)(Xin, Yin) + random.random(Xin.shape)
data2 = gaussian(10, 10, 10, 2, 4)(Xin2, Yin2) + random.random(Xin.shape)
P.imshow(data+data2, cmap=cm.jet)
current_ax = gca()
LS = RectangleSelector(current_ax, line_select_callback, drawtype='box',useblit=True,\
minspanx=5,minspany=5,spancoords='pixels')
P.show()
|
|
From: Jeff W. <js...@fa...> - 2008-11-18 16:21:15
|
John Hunter wrote: > On Tue, Nov 18, 2008 at 9:41 AM, Hrafnkell Pálsson <hr...@hi...> wrote: > >> Ok, I tried your last suggestion and sure enough it worked. >> But it turns out to solve only half of my problem. I'd like to be able to >> restore the background (using the Agg backend) and then use it further, i.e. >> plot on it, without it disappearing. >> >> Elaborating on my real use case, what I want to do is to make a Basemap >> instance, plot the coastlines and other things that are constant in time >> (put marker on the maps for cities, watermark the figure, draw meridians and >> parallels and so on) and save that as a background. >> I would then restore this background and plot "the weather" (open and filled >> contours, quivers and barbs) onto it. I typically have data for some dozens >> of timesteps, so I'd be restoring the background many times. Each time I'd >> > > This should work fine as long as you make the figure frame and axes > frame invisible. Basically, you need to create the figure background, > and the axes background with all the grid lines, tick labels, > coastlines, etc, save it, and then for the new figure make sure all > the stuff you have saved is turned off. I am not a basemap user, but > I know all this stuff is ultimately exposed. Eg for a plain vanilla > axes, you would do > > > fig1 = figure(frameon=False) > ax1 = fig1.add_subplot(111) > > > fig = figure(frameon=False) > ax = fig.add_subplot(111, frameon=false, xticks=[], yticks=[]) > fig.canvas.restore_region(background) > > > This will turn off the rendering of both the background rectangle as > well as all the ticks and their associated labels, ticklines and > gridlines. Perhaps Jeff can advise you vis-a-vis the basemap api what > the equivalent is > > > Don't see why this wouldn't work fine with basemap, as long as you don't call the drawmapboundary method (which will set the axes frame on). -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-11-18 16:01:17
|
On Tue, Nov 18, 2008 at 9:41 AM, Hrafnkell Pálsson <hr...@hi...> wrote: > > Ok, I tried your last suggestion and sure enough it worked. > But it turns out to solve only half of my problem. I'd like to be able to > restore the background (using the Agg backend) and then use it further, i.e. > plot on it, without it disappearing. > > Elaborating on my real use case, what I want to do is to make a Basemap > instance, plot the coastlines and other things that are constant in time > (put marker on the maps for cities, watermark the figure, draw meridians and > parallels and so on) and save that as a background. > I would then restore this background and plot "the weather" (open and filled > contours, quivers and barbs) onto it. I typically have data for some dozens > of timesteps, so I'd be restoring the background many times. Each time I'd This should work fine as long as you make the figure frame and axes frame invisible. Basically, you need to create the figure background, and the axes background with all the grid lines, tick labels, coastlines, etc, save it, and then for the new figure make sure all the stuff you have saved is turned off. I am not a basemap user, but I know all this stuff is ultimately exposed. Eg for a plain vanilla axes, you would do fig1 = figure(frameon=False) ax1 = fig1.add_subplot(111) fig = figure(frameon=False) ax = fig.add_subplot(111, frameon=false, xticks=[], yticks=[]) fig.canvas.restore_region(background) This will turn off the rendering of both the background rectangle as well as all the ticks and their associated labels, ticklines and gridlines. Perhaps Jeff can advise you vis-a-vis the basemap api what the equivalent is |
|
From: Hrafnkell P. <hr...@hi...> - 2008-11-18 15:41:25
|
Ok, I tried your last suggestion and sure enough it worked. But it turns out to solve only half of my problem. I'd like to be able to restore the background (using the Agg backend) and then use it further, i.e. plot on it, without it disappearing. Elaborating on my real use case, what I want to do is to make a Basemap instance, plot the coastlines and other things that are constant in time (put marker on the maps for cities, watermark the figure, draw meridians and parallels and so on) and save that as a background. I would then restore this background and plot "the weather" (open and filled contours, quivers and barbs) onto it. I typically have data for some dozens of timesteps, so I'd be restoring the background many times. Each time I'd plot a particular weather (corresponding to a particular timestep) onto the background I'd save that figure, so in the end I have some dozens of figures. Sliding the slider beneath the pictures at http://www.belgingur.is http://www.belgingur.is should give a good idea of what I mean (notice that the website is also in English). A somewhat simplified example of what I'd like to do (but it catches the essence of it) follows. The problem that arises is that when I try to plot onto the background it disappears and only what I tried to plot onto it remains. So figure2.png contains the coastline of Iceland while figure3.png contains only the quivers, the coastline has disappeared. import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy from mpl_toolkits.basemap import Basemap plt.close('all') basemap = Basemap(llcrnrlat=62.8, llcrnrlon=-24.8, urcrnrlat=66.7, urcrnrlon=-12.4, lat_0=65.0, lon_0=-19.5) # make sure we have all the same properties on all figs figprops = dict(figsize=(8,6), dpi=100, facecolor='white') fig1 = plt.figure(1, **figprops) basemap.drawcoastlines() fig1.canvas.draw() background = fig1.canvas.copy_from_bbox(fig1.bbox) # turn the frame off or it will overwrite the background fig2 = plt.figure(2, frameon=False, **figprops) fig2.canvas.restore_region(background) fig2.savefig('figure2.png', dpi=100) # turn the frame off or it will overwrite the background fig3 = plt.figure(3, frameon=False, **figprops) fig3.canvas.restore_region(background) # create a lon-lat grid for plotting quivers n, m = 10, 5 latitudes = numpy.resize(numpy.linspace(63.5, 65.0, n), (n, m)) longitudes = numpy.transpose(numpy.resize(numpy.linspace(-22, -14, n),(n, m))) x, y = basemap(longitudes, latitudes) # create the u and v components of the quivers u = numpy.resize([5], (n, m)) v = numpy.resize([5], (n, m)) # since keyword ax is not supplied the current axes instance is used, i.e. the axes of fig3 basemap.quiver(x, y, u, v) fig3.savefig('figure3.png', dpi=100) Hrafnkell -- View this message in context: http://www.nabble.com/Save-a-plot-background-tp20519596p20562028.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: B C. <clo...@ya...> - 2008-11-18 15:29:25
|
While I though this would be fairly
easy, I've yet to find a decent solution. I'm interested in using the
RangeSelector or standard zoom feature along with an autoscaling
function. In the example below there are two gaussian profiles created
in a matrix. I would like to have the behavior in which when I zoom in
that the Z scale is reordered to account for the new range of data. Is
my only solution to take the limits returned by a RangeSelector event
and extract a sub-matix from the original data and replot each time I
zoom in or out or is there a more elegant solution? Is there a way to also extend such functionality to contour, pcolor, etc.?
Cheers,
Brian
######paste in ipython###########################################
from numpy import *
from matplotlib.widgets import RectangleSelector
import pylab as P
def gaussian(height, center_x, center_y, width_x, width_y):
"""Returns a gaussian function with the given parameters"""
width_x = float(width_x)
width_y = float(width_y)
return lambda x,y: height*exp(-(((center_x-x)/width_x)**2+((center_y-y)/width_y)**2)/2)
def line_select_callback(event1, event2):
'event1 and event2 are the press and release events'
x1, y1 = event1.xdata, event1.ydata
x2, y2 = event2.xdata, event2.ydata
print "(%3.2f, %3.2f) --> (%3.2f, %3.2f)"%(x1,y1,x2,y2)
print " The button you used were: ",event1.button, event2.button
cla()
# Create the gaussian data
Xin, Yin = mgrid[0:201, 0:201]
Xin2, Yin2 = mgrid[0:201, 0:201]
data = gaussian(20, 100, 100, 20, 40)(Xin, Yin) + random.random(Xin.shape)
data2 = gaussian(10, 10, 10, 2, 4)(Xin2, Yin2) + random.random(Xin.shape)
P.imshow(data+data2, cmap=cm.jet)
current_ax = gca()
LS = RectangleSelector(current_ax, line_select_callback, drawtype='box',useblit=True,\
minspanx=5,minspany=5,spancoords='pixels')
P.show()
|
|
From: S. N. <sor...@gm...> - 2008-11-18 15:00:42
|
Hi, It seems that the Legend command doesnt function properly when using errorbar to plot. It includes extra lines for the errorbars themselves. I found out this is an old problem that have been fixed before?? http://osdir.com/ml/python.matplotlib.devel/2006-05/msg00038.html Regards, Soren |
|
From: S. N. <sor...@gm...> - 2008-11-18 14:22:01
|
Hi, Has anyone else noticed that using the pan tool is very slow when the data is plotted on a double log scale, or single log scale for that matter.. it's smooth as silk when the plots are in lin-lin. Is there a way to make it faster or is it a bug? Regards, Soren |
|
From: John H. <jd...@gm...> - 2008-11-18 14:20:49
|
On Tue, Nov 18, 2008 at 4:25 AM, Mike Hansen <mh...@gm...> wrote: > What would you recommend as the best way going about this? I'm > willing to put some work in on this. There was someone back in July > who posted some code moving in this direction, but it didn't feel like > it was the right way to do things. He didn't get any response from > the list. That was Tony's work, and it is a shame we didn't give him more feedback. It is definitely an important enhancement. Sometimes the things that are harder get marked with a "star" in my inbox, and the things that are easier get tackled right away, and the harder things get pushed down the queue. Which is why I encourage folks to make gentle reminders: the silence is usually not lack of interest, but lack of time. You should start by taking a look at where Tony left off. I will review his code too, and when we have both had a chance to digest it, we can discuss a plan of attack. http://www.nabble.com/Modifications-to-axis.py-to-allow-more-flexibility-in-positioning-axis-lines%2C-ticks%2C-etc.-td18573959.html#a18573959 Tony may be interested in contributing too. Reading over his email, one of the things that stumped him was trying to get this done right and maintain backwards compatibility. That is admirable, and we should try to achieve that where possible, but I don't think it is a requirement. This is a major feature enhancement, and is one of the things that have kept me from releasing mpl as 1.0, so if we need some breakage to get there we can live with it. Not too many people tweak the axis layout, in part because there is not much to tweak. Also, most use the Axes front end helper methods (eg ax.get_xticklabels()) which will insulate them from a reorg at the Axis layer. There are two related problems here: one easier, one harder. We can start with the easier one. The easy one is to have a "detachable axis". Right now we have one on the right and one on the left for the x-axis. We may as well generalize this to allow folks to have as many as they want and put them whereever they want (center, offset farther to the left, etc.). It would be nice to support a different set of tick locators and formatters for each axis, eg you could have a left axis in dollars and a right axis in euros. Note this is not the same thing as having a different scale, in the sense of the two_scales example, this is just two different formatting of the same scale. The harder problem is supporting an arbitrary number of axis instances each with its own transform, etc. Eg generalizing the two_scales example. I suggest you punt on that one for now. If you really want to keep this easy, you can forget all about the locators and formatters and just focus on allowing the user to place the axis lines wherever they want, using the standard Axis locator and formatter for all the axis lines. That is probably the place to start -- we can always try to beef it up later. That part should be fairly easy. Another enhancement that would be nice would be to support a TextCollection for the tick labels. Drawing the tick labels is actually a pretty big bottleneck in the whole plot rendering time, and since the properties are naturally homogeneous (eg the rotation, the fontsize) we could probably save some time using a collection. JDH |
|
From: John H. <jd...@gm...> - 2008-11-18 14:02:57
|
On Tue, Nov 18, 2008 at 3:41 AM, Benjamin Bardiaux <bar...@gm...> wrote: > Dear matplotlib users, > > I'l looking for the files > > http://matplotlib.sf.net/API_CHANGES > http://matplotlib.sourceforge.net/MIGRATION.txt > > that seem to have disappear from the new sf website. Thanks -- I've re-added these and put links to them in the "need help" sidebar at http://matplotlib.sf.net. You may need to refresh your browser to see the new links. We should include these in the rest docs proper, so they are exposed to the sphinx search tool, but I just went with the quick and easy for now. JDH |
|
From: Mike H. <mh...@gm...> - 2008-11-18 10:25:15
|
Hi Eric, > From: Eric Firing <efiring@ha...> - 2008-11-18 00:08 > Unfortunately, the present mpl architecture does not lend itself to this > sort of flexibility with respect to axis locations. It has been on the > wish list for a long time, and it can be done manually, but to make it > an easy-to-use mpl option will take some surgery and reconstruction on > mpl's internals. What would you recommend as the best way going about this? I'm willing to put some work in on this. There was someone back in July who posted some code moving in this direction, but it didn't feel like it was the right way to do things. He didn't get any response from the list. --Mike |
|
From: Benjamin B. <bar...@gm...> - 2008-11-18 09:56:37
|
Dear matplotlib users, I'l looking for the files http://matplotlib.sf.net/API_CHANGES http://matplotlib.sourceforge.net/MIGRATION.txt that seem to have disappear from the new sf website. Many thanks ! Benjamin |
|
From: John H. <jd...@gm...> - 2008-11-18 02:01:33
|
On Mon, Nov 17, 2008 at 8:05 AM, Hrafnkell Pálsson <hr...@hi...> wrote:
>
> Hi
>
> I tried you suggestions but it didn't work out for me.
> In the following code I try to save the axes and the grid from figure1 into
> buffer and then restore it on figure2 but figure2.png turns out to be of an
> empty canvas.
>
OK, ever since Jae-Joon clued me into to the importance of the savefig
call, I realized there is a fairly easy solution for your problem.
The problem you are having is that savefig is redrawing the "figure
frame" which is essentially just filling the rectangular background of
the figure canvas. This is obscuring the background you are trying to
restore. SO just turn the frame off, and your background will be
revealed in its place. Here is the example code:
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.close('all')
# make sure we have all the same properties on all figs
figprops = dict(figsize=(8,6), dpi=100, facecolor='white')
fig1 = plt.figure(1, **figprops)
ax1 = fig1.add_subplot(111)
ax1.grid()
fig1.canvas.draw()
background = fig1.canvas.copy_from_bbox(fig1.bbox)
fig1.savefig('figure1.png', dpi=100)
# turn the frame off or it will overwrite the background
fig2 = plt.figure(2, frameon=False, **figprops)
fig2.canvas.restore_region(background)
fig2.savefig('figure2.png', dpi=100)
|
|
From: B C. <clo...@ya...> - 2008-11-18 01:54:03
|
Matplotlibbers,
While I though this would be fairly
easy, I've yet to find a decent solution. I'm interested in using the
RangeSelector or standard zoom feature along with an autoscaling
function. In the example below there are two gaussian profiles created
in a matrix. I would like to have the behavior in which when I zoom in
that the Z scale is reordered to account for the new range of data. Is
my only solution to take the limits returned by a RangeSelector event
and extract a sub-matix from the original data and replot each time I
zoom in or out or is there a more elegant solution? Is there a way to also extend such functionality to contour, pcolor, etc.?
Cheers,
Brian
######paste in ipython###########################################
from numpy import *
from matplotlib.widgets import RectangleSelector
import pylab as P
def gaussian(height, center_x, center_y, width_x, width_y):
"""Returns a gaussian function with the given parameters"""
width_x = float(width_x)
width_y = float(width_y)
return lambda x,y: height*exp(-(((center_x-x)/width_x)**2+((center_y-y)/width_y)**2)/2)
def line_select_callback(event1, event2):
'event1 and event2 are the press and release events'
x1, y1 = event1.xdata, event1.ydata
x2, y2 = event2.xdata, event2.ydata
print "(%3.2f, %3.2f) --> (%3.2f, %3.2f)"%(x1,y1,x2,y2)
print " The button you used were: ",event1.button, event2.button
cla()
# Create the gaussian data
Xin, Yin = mgrid[0:201, 0:201]
Xin2, Yin2 = mgrid[0:201, 0:201]
data = gaussian(20, 100, 100, 20, 40)(Xin, Yin) + random.random(Xin.shape)
data2 = gaussian(10, 10, 10, 2, 4)(Xin2, Yin2) + random.random(Xin.shape)
P.imshow(data+data2, cmap=cm.jet)
current_ax = gca()
LS = RectangleSelector(current_ax, line_select_callback, drawtype='box',useblit=True,\
minspanx=5,minspany=5,spancoords='pixels')
P.show()
|
|
From: John H. <jd...@gm...> - 2008-11-18 01:40:15
|
On Mon, Nov 17, 2008 at 1:50 PM, Jae-Joon Lee <lee...@gm...> wrote: > I think the savefig() command calls draw() internally, doesn't it? Ahh yes. The copy_from_bbox / restore_region was conceived as an aid to animation and I don't think I've used it in the context of savefig where none of the artists are involved in the restored region. Ie, in a typical animation use case, you draw the axes, background and ticks, store the region, and then animate a line on top of it. When you go to savefig, the axes background is redrawn because the associated artists already reside in the figure, along with the line in its final state. It should be fairly easy to expose the agg BufferRegion object in the artist API, so you could grab a buffer region from one canvas, bless it as an artist, and add it to the figure or another figure, with the x and y location attrs exposed so it could be easily moved. In this case you would get the zorder for free. This would help some, and would certainly address the case at hand, but the really big win would probably be something more like the chaco model, where each zorder is rendered onto a different rendering buffer, with a fairly straight-forward way to just re-render certain planes. This would certainly be harder. Could you elaborate a bit on your use case, which will help me in thinking about how this should be done? JDH |
|
From: Eric F. <ef...@ha...> - 2008-11-18 00:08:55
|
jas...@cr... wrote: > There is some work going on in Sage (http://www.sagemath.org) to more > fully use matplotlib on a higher level than is currently done. One > issue that is coming up is using matplotlib to make a plot with axis > lines crossing in the center of the plot, like is shown in the plot at > http://sagemath.org/tour-education.html > > Is this easy to do in matplotlib (preferably with the stock axes > object)? It seems that there is not an example illustrating an axes of > this form and I couldn't find any mention in the documentation of such a > feature. Unfortunately, the present mpl architecture does not lend itself to this sort of flexibility with respect to axis locations. It has been on the wish list for a long time, and it can be done manually, but to make it an easy-to-use mpl option will take some surgery and reconstruction on mpl's internals. Eric |
|
From: <jas...@cr...> - 2008-11-17 22:48:05
|
There is some work going on in Sage (http://www.sagemath.org) to more fully use matplotlib on a higher level than is currently done. One issue that is coming up is using matplotlib to make a plot with axis lines crossing in the center of the plot, like is shown in the plot at http://sagemath.org/tour-education.html Is this easy to do in matplotlib (preferably with the stock axes object)? It seems that there is not an example illustrating an axes of this form and I couldn't find any mention in the documentation of such a feature. Thanks, Jason |
|
From: Robert K. <rob...@gm...> - 2008-11-17 20:34:25
|
Jeff Mangum wrote: > Hello, > > I am having a problem installing matplotlib 0.93.3 from egg on Mac OSX > 10.5.5. Even though I have numpy 1.2.1 installed in > /Library/Frameworks/..., the egg insists on using an older version of > numpy (1.0.4) in /opt/local/lib/python2.5/site-packages (which must have > been delivered with the OS). No, /opt/local is MacPorts territory. > How can I tell the egg where to find the > proper version of numpy? Thanks! Are you sure you are using the same versions of Python to run and install both of these? -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco |