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
(23) |
2
(13) |
|
3
(1) |
4
(17) |
5
(3) |
6
(10) |
7
(7) |
8
(7) |
9
(4) |
|
10
(13) |
11
(20) |
12
(13) |
13
(17) |
14
(20) |
15
(14) |
16
(3) |
|
17
(5) |
18
(15) |
19
(18) |
20
(14) |
21
(2) |
22
(13) |
23
(8) |
|
24
(3) |
25
(7) |
26
(10) |
27
(17) |
28
(20) |
29
(42) |
|
|
From: Chris K. <chr...@co...> - 2008-02-15 22:37:43
|
hi Mike,
I was able to get it to work using:
reload(matplotlib)
matplotlib.use('Agg')
I'll have to beat on it some more to see if this is robust.
I saw the error message in this code:
http://search.cpan.org/src/NI-S/Tk-804.027/pTk/mTk/win/tkWinDraw.c
if(!bitmap) {
panic("Fail to allocate bitmap\n");
DeleteDC(dcMem);
TkWinReleaseDrawableDC(d, dc, &state);
return;
}
thanks
Michael Droettboom wrote:
> Can you provide the full traceback for the error? Are there no Python
> line numbers etc.?
>
> I don't see the string "Fail to allocate bitmap" or "Unable to free
> colormap..." anywhere in the matplotlib source, so it's hard to say
> where it's coming from. I suspect they are coming from the GUI
> framework you are using...
>
> If you put your simple example inside of a loop, does the error
> eventually occur -- or only within the context of your app? If the
> latter, we'll need to somehow narrow it down to a specific setting or
> method that causes the problem.
>
> Also, what backend are you using when it breaks? Just Agg, or one of
> the Gui+Agg backends?
>
> Cheers,
> Mike
>
> Chris Kennedy wrote:
>> hi,
>> I get this error when I'm generating numerous .png files using
>> matplotlib 0.9.2 in py2.4 on WinXP
>> -----------------------------
>> Fail to allocate bitmap
>>
>> This application has requested the Runtime to terminate it in an
>> unusual way.
>> Please contact the application's support team for more information.
>> Unable to free colormap, palette is still selected.
>>
>> This application has requested the Runtime to terminate it in an
>> unusual way.
>> Please contact the application's support team for more information.
>> -----------------------------
>>
>> The code is simple:
>> import matplotlib
>> import matplotlib.pyplot as pylab
>>
>> pylabFigure = pylab.figure()
>> pylabFigure.clf()
>> pylab.rcdefaults()
>> pylab.plot(p[0::2], p[1::2], 'b-', linewidth=3)
>> pylab.title('Endpointing Plot for '+StepMillName)
>> pylab.xlabel('Mill Distance ('+m_unit+')')
>> pylab.ylabel('~ Electron response ~' )
>> pylab.grid(True)
>> pylabFigure.savefig('EPP_'+StepMillName+'.png',
>> facecolor='lightgrey', edgecolor='w')
>> pylab.close('all')
>> pylabFigure = None
>>
>> I can put this code in a simple program and generate many images
>> without seeing the allocate bitmap error.
>>
>> Perhaps it is colliding with something else in my main app. Is there
>> a command that can clear, flush, or unselect the palette and/or
>> colormap?
>>
>> I don't see the allocate error if I switch the backend to 'SVG', that
>> has it own set of issues though: telling me it can't use, but then
>> generating SVG files anyway.
>>
>> thanks
>>
>
--
Chris Kennedy http://www.coventor.com
Sr. Product Manager Ph: 919-854-7500 x156
Cary, NC
|
|
From: Chris K. <chr...@co...> - 2008-02-15 22:09:03
|
hi Mike,
It only prints what is between the ----, ----- . I tend to think it is
related to Tkinter.
I'm using the default GTKAgg.
I have generated over 1500 images using the simple example with no
issue. When it is in the larger app, it fails on the 2nd or 3rd request.
I'm trying
reload(matplotlib)
matplotlib.use('TkAgg')
Are there some python flags I can use when running the script to get
more verbose output? I've used -v and -d and get the cleanup list, is
that useful?
thanks
Michael Droettboom wrote:
> Can you provide the full traceback for the error? Are there no Python
> line numbers etc.?
>
> I don't see the string "Fail to allocate bitmap" or "Unable to free
> colormap..." anywhere in the matplotlib source, so it's hard to say
> where it's coming from. I suspect they are coming from the GUI
> framework you are using...
>
> If you put your simple example inside of a loop, does the error
> eventually occur -- or only within the context of your app? If the
> latter, we'll need to somehow narrow it down to a specific setting or
> method that causes the problem.
>
> Also, what backend are you using when it breaks? Just Agg, or one of
> the Gui+Agg backends?
>
> Cheers,
> Mike
>
> Chris Kennedy wrote:
>> hi,
>> I get this error when I'm generating numerous .png files using
>> matplotlib 0.9.2 in py2.4 on WinXP
>> -----------------------------
>> Fail to allocate bitmap
>>
>> This application has requested the Runtime to terminate it in an
>> unusual way.
>> Please contact the application's support team for more information.
>> Unable to free colormap, palette is still selected.
>>
>> This application has requested the Runtime to terminate it in an
>> unusual way.
>> Please contact the application's support team for more information.
>> -----------------------------
>>
>> The code is simple:
>> import matplotlib
>> import matplotlib.pyplot as pylab
>>
>> pylabFigure = pylab.figure()
>> pylabFigure.clf()
>> pylab.rcdefaults()
>> pylab.plot(p[0::2], p[1::2], 'b-', linewidth=3)
>> pylab.title('Endpointing Plot for '+StepMillName)
>> pylab.xlabel('Mill Distance ('+m_unit+')')
>> pylab.ylabel('~ Electron response ~' )
>> pylab.grid(True)
>> pylabFigure.savefig('EPP_'+StepMillName+'.png',
>> facecolor='lightgrey', edgecolor='w')
>> pylab.close('all')
>> pylabFigure = None
>>
>> I can put this code in a simple program and generate many images
>> without seeing the allocate bitmap error.
>>
>> Perhaps it is colliding with something else in my main app. Is there
>> a command that can clear, flush, or unselect the palette and/or
>> colormap?
>>
>> I don't see the allocate error if I switch the backend to 'SVG', that
>> has it own set of issues though: telling me it can't use, but then
>> generating SVG files anyway.
>>
>> thanks
>>
>
--
Chris Kennedy http://www.coventor.com
Sr. Product Manager Ph: 919-854-7500 x156
Cary, NC Fx: 919-854-7501
Mobile: 919-414-6653
|
|
From: Barry W. <bar...@gm...> - 2008-02-15 21:54:08
|
On Feb 15, 2008 1:27 PM, Christopher Barker <Chr...@no...> wrote: > Barry Wark wrote: > > I'm ramping up to start building at least scipy binaries (see recent > > post on scipy-users list). I'm just waiting for tester feedback for > > eggs built from SVN trunk. They're currently for OS X 10.5, but I will > > also build for MacPython once I'm sure everything's working. > > Great, thanks! > > > numpy, ipython, and matplotlib all apear to be available via > > EasyInstall, so scipy seems to be the only missing piece. > > well, it's the hard one, as it requires Fortran. > > Adding to my last note: > > Another reason pythonmac.org/packages isn't getting the unmaintained it > used to is the easy-install works for so many things. I think it's > working fine for MPL now, for instance. Right. Since Leopard comes with setuptools, it seems like the mac-python community is being pushed towards using setuptools/EasyInstall instead of mpkg installers. I personally think that's a good thing. |
|
From: Christopher B. <Chr...@no...> - 2008-02-15 21:26:31
|
Barry Wark wrote: > I'm ramping up to start building at least scipy binaries (see recent > post on scipy-users list). I'm just waiting for tester feedback for > eggs built from SVN trunk. They're currently for OS X 10.5, but I will > also build for MacPython once I'm sure everything's working. Great, thanks! > numpy, ipython, and matplotlib all apear to be available via > EasyInstall, so scipy seems to be the only missing piece. well, it's the hard one, as it requires Fortran. Adding to my last note: Another reason pythonmac.org/packages isn't getting the unmaintained it used to is the easy-install works for so many things. I think it's working fine for MPL now, for instance. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
|
From: Barry W. <bar...@gm...> - 2008-02-15 21:13:02
|
I'm ramping up to start building at least scipy binaries (see recent post on scipy-users list). I'm just waiting for tester feedback for eggs built from SVN trunk. They're currently for OS X 10.5, but I will also build for MacPython once I'm sure everything's working. numpy, ipython, and matplotlib all apear to be available via EasyInstall, so scipy seems to be the only missing piece. barry On Feb 15, 2008 12:41 PM, Christopher Barker <Chr...@no...> wrote: > > Barry Wark wrote: > > I would take a look at the Scipy Superpack (http://trichech.us/). > > only support Intel and it seems only 10.5 -- darn. > > scipy can now be built Universal, so hope someone will start > distributing a Universal binary some day. > > > Alternatively, you can download and install the MacPython 2.5 for OS X > > 10.4 (http://www.pythonmac.org/packages/py25-fat/index.html). > > There are also a bunch of other packages there, including wxPython, and > an older MPL. > > The idea was that the pythonmac site would be the "official" place to > get binaries of python packages for OS-X. However, we don't always get > stuff contributed, and it can be a bit tricky for folks to build a > complex package that meets its specs (Universal is the big issue), so > folks build stuff like the "Superpack" that is almost there. > > I don't have time to try to do it now, but PLEASE, someone build a > recent scipy and/or MPL and put it up there! > > -Chris > > > -- > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chr...@no... > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Michael D. <md...@st...> - 2008-02-15 20:53:21
|
Can you provide the full traceback for the error? Are there no Python
line numbers etc.?
I don't see the string "Fail to allocate bitmap" or "Unable to free
colormap..." anywhere in the matplotlib source, so it's hard to say
where it's coming from. I suspect they are coming from the GUI
framework you are using...
If you put your simple example inside of a loop, does the error
eventually occur -- or only within the context of your app? If the
latter, we'll need to somehow narrow it down to a specific setting or
method that causes the problem.
Also, what backend are you using when it breaks? Just Agg, or one of
the Gui+Agg backends?
Cheers,
Mike
Chris Kennedy wrote:
> hi,
> I get this error when I'm generating numerous .png files using
> matplotlib 0.9.2 in py2.4 on WinXP
> -----------------------------
> Fail to allocate bitmap
>
> This application has requested the Runtime to terminate it in an unusual
> way.
> Please contact the application's support team for more information.
> Unable to free colormap, palette is still selected.
>
> This application has requested the Runtime to terminate it in an unusual
> way.
> Please contact the application's support team for more information.
> -----------------------------
>
> The code is simple:
> import matplotlib
> import matplotlib.pyplot as pylab
>
> pylabFigure = pylab.figure()
> pylabFigure.clf()
> pylab.rcdefaults()
> pylab.plot(p[0::2], p[1::2], 'b-', linewidth=3)
> pylab.title('Endpointing Plot for '+StepMillName)
> pylab.xlabel('Mill Distance ('+m_unit+')')
> pylab.ylabel('~ Electron response ~' )
> pylab.grid(True)
> pylabFigure.savefig('EPP_'+StepMillName+'.png',
> facecolor='lightgrey', edgecolor='w')
> pylab.close('all')
> pylabFigure = None
>
> I can put this code in a simple program and generate many images without
> seeing the allocate bitmap error.
>
> Perhaps it is colliding with something else in my main app. Is there a
> command that can clear, flush, or unselect the palette and/or colormap?
>
> I don't see the allocate error if I switch the backend to 'SVG', that
> has it own set of issues though: telling me it can't use, but then
> generating SVG files anyway.
>
> thanks
>
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
|
|
From: Christopher B. <Chr...@no...> - 2008-02-15 20:41:10
|
Barry Wark wrote: > I would take a look at the Scipy Superpack (http://trichech.us/). only support Intel and it seems only 10.5 -- darn. scipy can now be built Universal, so hope someone will start distributing a Universal binary some day. > Alternatively, you can download and install the MacPython 2.5 for OS X > 10.4 (http://www.pythonmac.org/packages/py25-fat/index.html). There are also a bunch of other packages there, including wxPython, and an older MPL. The idea was that the pythonmac site would be the "official" place to get binaries of python packages for OS-X. However, we don't always get stuff contributed, and it can be a bit tricky for folks to build a complex package that meets its specs (Universal is the big issue), so folks build stuff like the "Superpack" that is almost there. I don't have time to try to do it now, but PLEASE, someone build a recent scipy and/or MPL and put it up there! -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
|
From: Chris K. <chr...@co...> - 2008-02-15 20:34:00
|
hi,
I get this error when I'm generating numerous .png files using
matplotlib 0.9.2 in py2.4 on WinXP
-----------------------------
Fail to allocate bitmap
This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.
Unable to free colormap, palette is still selected.
This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.
-----------------------------
The code is simple:
import matplotlib
import matplotlib.pyplot as pylab
pylabFigure = pylab.figure()
pylabFigure.clf()
pylab.rcdefaults()
pylab.plot(p[0::2], p[1::2], 'b-', linewidth=3)
pylab.title('Endpointing Plot for '+StepMillName)
pylab.xlabel('Mill Distance ('+m_unit+')')
pylab.ylabel('~ Electron response ~' )
pylab.grid(True)
pylabFigure.savefig('EPP_'+StepMillName+'.png',
facecolor='lightgrey', edgecolor='w')
pylab.close('all')
pylabFigure = None
I can put this code in a simple program and generate many images without
seeing the allocate bitmap error.
Perhaps it is colliding with something else in my main app. Is there a
command that can clear, flush, or unselect the palette and/or colormap?
I don't see the allocate error if I switch the backend to 'SVG', that
has it own set of issues though: telling me it can't use, but then
generating SVG files anyway.
thanks
--
Chris Kennedy http://www.coventor.com
Sr. Product Manager Ph: 919-854-7500 x156
Cary, NC
|
|
From: Barry W. <bar...@gm...> - 2008-02-15 20:02:45
|
José, I would take a look at the Scipy Superpack (http://trichech.us/). Alternatively, you can download and install the MacPython 2.5 for OS X 10.4 (http://www.pythonmac.org/packages/py25-fat/index.html). This installs a separate Python framework (leaving the system python framework unchanged). The installer will modify your path to point to the new python2.5. You can then install setuptools/ipython/numpy/scipy/matplotlib from source or via EasyInstall. If you go this route, you'll probably also want the wxPython installer from http://www.wxpython.org/download.php#binaries. Feel free to contact me directly if you have any other questions. Barry On Feb 15, 2008 6:23 AM, José Gómez-Dans <jgo...@gm...> wrote: > Hi! > Some colleagues are starting to use python, matplotlib et al. for data > analysis and so on. However, they are using MacOSX computers, and neither of > us are particularly proficient in the use of OSX. I would like to know if > there's an easy way to install ipython, numpy, scipy and matplotlib on MacOSX > 10.4 without much hassle. Is there some "officially sanctioned" :D best way? > > Cheers! > Josea > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Alan G I. <ai...@am...> - 2008-02-15 19:11:54
|
On Thu, 14 Feb 2008, John Hunter apparently wrote:
> if we want the script to be robust in the presence of
> different use directives, eg matplotlib.use('TkAgg') then
> it is good to have the show in there.
Got it.
So ``show`` is a no-op with irrelevant backends.
Just to repeat:
the documentation link for ``show`` is dead.
Dead link: http://matplotlib.sourceforge.net/matplotlib.pyplot.html#-show
Link location: http://matplotlib.sourceforge.net/
Thanks.
Alan
|
|
From: José Gómez-D. <jgo...@gm...> - 2008-02-15 14:24:01
|
Hi! Some colleagues are starting to use python, matplotlib et al. for data analysis and so on. However, they are using MacOSX computers, and neither of us are particularly proficient in the use of OSX. I would like to know if there's an easy way to install ipython, numpy, scipy and matplotlib on MacOSX 10.4 without much hassle. Is there some "officially sanctioned" :D best way? Cheers! Josea |
|
From: Jeff W. <js...@fa...> - 2008-02-15 12:38:04
|
Tim Michelsen wrote: >> Timmie: It's possible that the windows installer is missing the httplib2 >> module - I don't have access to windows right now to check. Could you >> try installing httplib2 and let me know if that fixes it? >> > Installing httplib2 solved the issue. > > Has this dependancy on httplib2 been introduced in the last update? > Timmie: No, it has been there for a few releases, but for some reason did not get included in the windows installer this time. > What are the merits of this dependency? > Could it be made option? > If you install from source, it only installs httplib2 if you don't have it already. > Like that I would only need to have httplib2 if I use functions that load maps > from the web? > > I could do this, but it's only a single python file, so what's the big deal? > Kind regards and thanks for your efforts in developing basemap! > > Timmie > You're welcome. -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: Robin <ro...@gm...> - 2008-02-15 12:04:22
|
Hello, I have some functions that produce various figures. This is usually done by calling figure(), then the plot function (eg bar). I save the figure object and pass it out. I would like to be able to collect several figure objects from such functions and collect them as subplots in a single figure for easy printing, comparison. I don't want to change the functions that create them though, because I will also want to view them individually in the future. So given a load of figure objects, how can I make a new figure with each subplot one of the existing figures? (I hope this is clear). Does it matter if the original figure object has been closed? I'm having a look through the help to see if I could find it but it's taking a bit of time and I thought it's probably quite easy if your more familiar with the object structure of matplotlib. Thanks Robin |
|
From: Tim M. <tim...@gm...> - 2008-02-15 10:58:26
|
> Timmie: It's possible that the windows installer is missing the httplib2 > module - I don't have access to windows right now to check. Could you > try installing httplib2 and let me know if that fixes it? Installing httplib2 solved the issue. Has this dependancy on httplib2 been introduced in the last update? What are the merits of this dependency? Could it be made option? Like that I would only need to have httplib2 if I use functions that load maps from the web? Kind regards and thanks for your efforts in developing basemap! Timmie |
|
From: John H. <jd...@gm...> - 2008-02-14 22:48:06
|
On Thu, Feb 14, 2008 at 9:17 AM, Alan G Isaac <ai...@am...> wrote:
> On Thu, 14 Feb 2008, John Hunter apparently wrote:
> > import numpy as np
> > import matplotlib
> > matplotlib.use('Agg')
> > import matplotlib.pyplot as plt
...snip
> > fig.savefig('myplot.png', dpi=100)
> > plt.show()
>
> Does that ``show`` command have any effect?
> (I know the effect for TkAgg.)
> I tried clicking the ``show`` help at
In this case no, since we are using an image backend. But if we want
the script to be robust in the presence of different use directives,
eg matplotlib.use('TkAgg') then it is good to have the show in there.
JDH
|
|
From: Eric F. <ef...@ha...> - 2008-02-14 19:39:09
|
Michael Droettboom wrote:
> You can call
>
> ax.apply_aspect()
>
> to do the aspect ratio calculations -- seems to work for me here with
> your example.
>
> The aspect ratio code has always felt like a bit of a black art to me
> (it's a seemingly "necessarily complex" piece of code). Maybe someone
> else can answer -- is there a reason not to call apply_aspect() from
> set_aspect() besides a little extra computation? It obviously will
> still have to be called from draw (in case the figure size changes), but
> does it hurt to do it one extra time?
Mike, Mark,
I answered this a minute ago before seeing the present set of messages,
and without working through it carefully.
Now I see that, indeed, the simple default version of the call (no
arguments) is identical to the version in the draw method.
It is possible that it would not actually hurt to call it in set_aspect,
but I would need to look at that quite carefully, which I can't do right
now. Maybe this evening or this weekend at the latest. And, the answer
may be different for svn versus the present release; I will consider
only svn.
I agree entirely that the aspect ratio code is complex, and painful to
work with. It took a long time to get it to its present state--make it
do most things reasonably; a case is found where it doesn't work; fix
that; another problem pops up; fix that; and on and on--but throughout
there has been a sense that surely there must be a better way!
The torture test for the aspect ratio code is making a plot (or worse, a
set of subplots with shared axes) and then using the toolbar box-select
and the pan/zoom control and the display window corner to manipulate it
every which way. Then call set_aspect with a different setting and make
sure it redraws sensibly, and do it all over again.
Eric
>
> Cheers,
> Mike
>
> Mark Bakker wrote:
>> Hello -
>>
>> As reported in an earlier post, when setting aspect ratio, the axis
>> limits don't get updated correctly it seems. Or maybe I have to make
>> another function call. Very easy example:
>>
>> from pylab import *
>> ax = subplot(211)
>> plot([1,2,3])
>> ax.set_aspect('equal',adjustable='datalim')
>> print ax.get_xlim() # Gives you (0.0, 2.0), which is incorrect, as the
>> data limits have been stretched.
>> draw()
>> print ax.get_xlim() # Gives (-1.8243394308943093, 3.8243394308943093) or
>> something like it, which is correct
>>
>> I don't want to call draw, so is there some other function I can call to
>> update the axis limits? Should that function be called automatically
>> from set_aspect ?
>>
>> I am using mpl 0.92.1. Thanks, Mark
>
|
|
From: Eric F. <ef...@ha...> - 2008-02-14 19:20:57
|
Mark Bakker wrote:
> Hello -
>
> As reported in an earlier post, when setting aspect ratio, the axis
> limits don't get updated correctly it seems. Or maybe I have to make
> another function call. Very easy example:
>
> from pylab import *
> ax = subplot(211)
> plot([1,2,3])
> ax.set_aspect('equal',adjustable='datalim')
> print ax.get_xlim() # Gives you (0.0, 2.0), which is incorrect, as the
> data limits have been stretched.
> draw()
> print ax.get_xlim() # Gives (-1.8243394308943093, 3.8243394308943093) or
> something like it, which is correct
>
> I don't want to call draw, so is there some other function I can call to
> update the axis limits? Should that function be called automatically
> from set_aspect ?
>
> I am using mpl 0.92.1. Thanks, Mark
Mark,
In the present design, there is quite a bit that happens only when
draw() is invoked; in particular, the apply_aspect() method is called
when an axes is drawn. set_aspect merely sets the parameters that
apply_aspect will use. It would not make sense for set_aspect to call
apply_aspect.
I have not thought this through, but in place of the call to draw() you
could try making the same call that the Axes.draw() method does:
ax.apply_aspect(ax.get_position(True))
Eric
|
|
From: Neal B. <ndb...@gm...> - 2008-02-14 18:50:18
|
Alan G Isaac wrote: > On Thu, 14 Feb 2008, Neal Becker apparently wrote: >> Can matplotlib automatically choose line styles and/or >> markers for a group of plots? > > http://matplotlib.sourceforge.net/matplotlibrc > > Although I prefer to pass in a dict of keyword arguments. > Not sure what you're telling me here. I'm thinking: I can get nice default grid with grid() I can get nice default legend with legend() Can I get nice default line styles and markers, automatically set up with matching legend? Automatically chosen? I don't want to have to go through and manually choose each marker and line style. |
|
From: Alan G I. <ai...@am...> - 2008-02-14 18:18:31
|
On Thu, 14 Feb 2008, Neal Becker apparently wrote: > Can matplotlib automatically choose line styles and/or > markers for a group of plots? http://matplotlib.sourceforge.net/matplotlibrc Although I prefer to pass in a dict of keyword arguments. Cheers, Alan Isaac |
|
From: Neal B. <ndb...@gm...> - 2008-02-14 17:48:43
|
Can matplotlib automatically choose line styles and/or markers for a group of plots? |
|
From: Evan M. <eva...@gm...> - 2008-02-14 17:28:33
|
On Wed, Feb 13, 2008 at 2:16 PM, Jeff Whitaker <js...@fa...> wrote: > Evan Mason wrote: > > Hi Jeff > > > > Here are the corners: > > > > lon_corners = N.array([-4.09300764,-35.76003475,-43.72330207, > > -12.05627497]) > > lat_corners = N.array([41.90278813, 49.2136974, 14.7209971, 7.41008784]) > > > > The reason for the differences is that the matlab script is very > > fiddly, lots of trial and error to get the grid in the right place. > > The attraction of using basemap is it allows me to specify the > > corners, so that I have it right first time, that's the idea anyway. > > > > That would be great if you could turn off that rotation, maybe a > > keyword True/False.... > > > > Thanks, Evan > > Evan: I've changed Basemap in svn so you can set 'no_rot=True' when > creating a Basemap instance for the 'omerc' projection to get what you > want. If you don't feel like upgrading (since that requires upgrading > matplotlib to svn head at the same time), this will work in the version > you have: > > from matplotlib.toolkits.basemap import Basemap, pyproj > from pylab import * > p = pyproj.Proj(lon_2=-27.8,lon_1=-19.9,no_rot=True,proj='omerc',\ > lat_2=11.0,lat_1=45.5) > xmax,ymax = p(-4.093,41.9027) # upper right corner > xmin,ymin = p(-43.723,14.721) # lower left corner > x = linspace(xmin,xmax,35) > y = linspace(ymin,ymax,35) > x, y = meshgrid(x,y) > lonr,latr = p(x,y, inverse=True) > m = Basemap(llcrnrlon=-60,llcrnrlat=5,\ > urcrnrlon=15,urcrnrlat=60,resolution='i') > m.drawcoastlines() > m.scatter(lonr.flatten(),latr.flatten(),5,marker='o') > m.drawmeridians(arange(-60,21,10),labels=[0,0,0,1]) > m.drawparallels(arange(0,61,10),labels=[1,0,0,0]) > show() > > Let me know if this fixes it for you. > > -Jeff > > > > > > > > On Feb 13, 2008 12:56 PM, Jeff Whitaker <js...@fa... > > <mailto:js...@fa...>> wrote: > > > > Evan Mason wrote: > > > Hi Jeff > > > > > > By losing the memory I mean that the grid is no longer rotated; > that > > > the rotation I introduced through lat1, lon1, lat2, lon2 is > > lost. If > > > you look at the latitude of the two bottom corners you see that > they > > > are the same, they should be different. In other words, I want my > > > great circle not to be the equator or a meridian, instead I want > > it to > > > be between lat1, lon1, lat2, lon2. See for example: > > > > > > http://erg.usgs.gov/isb/pubs/MapProjections/projections.html#mercator > > > > > > Attached is a png from the matlab script. Here you can see the > > > rotation that I am looking for. The latitude of the two bottom > > > corners is different, unlike what happens presently with my > basemap > > > script. > > > > > > Thanks, Evan > > > > Evan: OK, I was confused by your use of the term 'losing the > memory'. > > Basemap didn't lose the rotation, it never had it in the first > place. > > It looks like matlab and Basemap define the projection regions > > differently. They both are right, but are showing you different > > regions > > of the same projection. The difference is that proj4 (and therefore > > Basemap) automatically rotates the y axis to lie along true north. > I > > think I know how to modify Basemap to display the region you want, > by > > turning off that rotation. Can you send me the lat/lon values of > > the 4 > > corners of the region that matlab produces? > > > > -Jeff > > > > P.S. I don't know if this is relevant or not, but you appear to be > > giving matlab different points to define the center of the > projection > > than you did in Basemap (the lons you gave matlab are > > -23.75,-28.25, the > > lons you give in Basemap are -27.8 and 19.9). > > > > > > > > > > > > On Feb 13, 2008 10:48 AM, Jeff Whitaker <js...@fa... > > <mailto:js...@fa...> > > > <mailto:js...@fa... <mailto:js...@fa...>>> wrote: > > > > > > Evan Mason wrote: > > > > Thanks for the replies. The map you produced, Jeff, looks > > as it > > > > should. However, I am trying to make an ocean model grid, > > and so I > > > > require two 2d arrays of lon and lat, at my desired grid > > spacing. > > > > This is why I try the steps: > > > > > > > > dl = 20000. > > > > nx = int((M.xmax - M.xmin) / dl) + 1 > > > > ny = int((M.ymax - M.ymin) / dl) + 1 > > > > lonr, latr = M.makegrid(nx, ny) <- it seems to be here > > that it > > > loses > > > > 'memory' of omerc projection that I specified, and maybe > > there is a > > > > bug here? > > > > > > Evan: Why do you say it 'loses' memory of the projection? > > The values > > > look fine to me - they are just equally spaced points in map > > > projection > > > coordinates that cover the map projection region. Take a > > look at > > > > > > M = Basemap(projection = 'omerc', \ > > > resolution = 'l', \ > > > llcrnrlon = -43.7, \ > > > llcrnrlat = 14.7, \ > > > urcrnrlon = -4.0, \ > > > urcrnrlat = 41.9, \ > > > lat_2 = 11.0, \ > > > lat_1 = 45.5, \ > > > lon_2 = -27.8, \ > > > lon_1 = -19.9) > > > dl = 200000. > > > nx = int((M.xmax - M.xmin) / dl) + 1 > > > ny = int((M.ymax - M.ymin) / dl) + 1 > > > lonr, latr,x,y= M.makegrid(nx, ny, returnxy=True) > > > M.drawcoastlines() > > > M.scatter(x.flatten(), y.flatten(),5,marker='o') > > > M.drawparallels(arange(10,51,10)) > > > M.drawmeridians(arange(-50,1,10)) > > > show() > > > > > > > > If you have matlab, the following lines do what I am > > looking for: > > > > > > > > incx = 0.00310/2; > > > > incy = 0.00306/2; > > > > Xstr = -0.275; > > > > Xend = 0.275; > > > > Ystr = 0.17; > > > > Yend = 0.8; > > > > X = [Xstr:incx:Xend]; > > > > Y = [Ystr:incy:Yend]; > > > > [XX,YY] = meshgrid(X,Y); > > > > [Lonr,Latr] = m_xy2ll(XX,YY); > > > > m_proj('Oblique Mercator','lon',[-23.75 -28.25],'lat',[45.5 > > > > 11],'direction','vertical'); > > > > plot(Lonr, Latr, 'c.') > > > > > > Sorry, I don't have matlab - but it looks at first glance > > like it > > > ought > > > to be doing the same thing. > > > > > > -Jeff > > > > > > > > > > > > > > > > -Evan > > > > > > > > > > > > > > > > > > > > > > > > On Feb 13, 2008 5:14 AM, Jeff Whitaker <js...@fa... > > <mailto:js...@fa...> > > > <mailto:js...@fa... <mailto:js...@fa...>> > > > > <mailto:js...@fa... <mailto:js...@fa...> > > <mailto:js...@fa... <mailto:js...@fa...>>>> wrote: > > > > > > > > Evan Mason wrote: > > > > > Hi, I am having some problems using the oblique > mercator > > > > projection in > > > > > basemap. I want to define a rectangular orthogonal > > grid, > > > rotated > > > > > clockwise by about 13 degrees. I want to define grid > > > cells of size, > > > > > say, about 20x20 km. The script I have so far is > > below. The > > > > problem > > > > > is that at some point (the makegrid step) I lose the > > rotation, > > > > as seen > > > > > in the plot. > > > > > > > > > > I'd appreciate any help with this, thanks, Evan > > > > > > > > > > > > > > > from matplotlib.toolkits.basemap import Basemap > > > > > > > > > > M = Basemap(projection = 'omerc', \ > > > > > resolution = None, \ > > > > > llcrnrlon = -43.7, \ > > > > > llcrnrlat = 14.7, \ > > > > > urcrnrlon = -4.0, \ > > > > > urcrnrlat = 41.9, \ > > > > > lat_2 = 11.0, \ > > > > > lat_1 = 45.5, \ > > > > > lon_2 = -27.8, \ > > > > > lon_1 = -19.9) > > > > > > > > > > dl = 20000. > > > > > nx = int((M.xmax - M.xmin) / dl) + 1 > > > > > ny = int((M.ymax - M.ymin) / dl) + 1 > > > > > > > > > > lonr, latr = M.makegrid(nx, ny) > > > > > > > > > > plot(lonr, latr, 'c.') > > > > > show() > > > > > > > > Evan: I have to admit, I'm not too familiar with the > > > Oblique Mercator > > > > projection. What exactly should it look like? > > > > > > > > If I plot > > > > > > > > M = Basemap(projection = 'omerc', \ > > > > resolution = 'l', \ > > > > llcrnrlon = -43.7, \ > > > > llcrnrlat = 14.7, \ > > > > urcrnrlon = -4.0, \ > > > > urcrnrlat = 41.9, \ > > > > lat_2 = 11.0, \ > > > > lat_1 = 45.5, \ > > > > lon_2 = -27.8, \ > > > > lon_1 = -19.9) > > > > M.drawcoastlines() > > > > M.drawparallels(arange(10,51,10)) > > > > M.drawmeridians(arange(-50,1,10)) > > > > M.show() > > > > > > > > I see a reasonable looking map, but then I don't > > really know > > > exactly > > > > what to expect. > > > > > > > > It seems that there are two ways to specify oblique > > mercator > > > in proj4 > > > > > > > > 1) by specifying 2 points (lon1,lat1), (lon2,lat2) > > along the > > > > central line > > > > 2) by specifying a central point and an azimuth that > > passes > > > > through the > > > > central point. > > > > > > > > Basemap uses (1), but every example on the web I've seen > > > uses (2). It > > > > could be there are bugs in (1), and (2) would produce > more > > > reasonable > > > > results in your case. If you can give me an example > > of what > > > your map > > > > *should* look like, it would help a lot. > > > > > > > > -Jeff > > > > > > > > > > > > > > > > > > > > -- > > > > Jeffrey S. Whitaker Phone : (303)497-6313 > > > > NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 > > > > 325 Broadway Boulder, CO, USA 80305-3328 > > > > > > > > > > > > > > > > > -- > > > Jeffrey S. Whitaker Phone : (303)497-6313 > > > Meteorologist FAX : (303)497-6449 > > > NOAA/OAR/PSD R/PSD1 Email : > > Jef...@no... <mailto:Jef...@no...> > > > <mailto:Jef...@no... > > <mailto:Jef...@no...>> > > > 325 Broadway Office : Skaggs Research Cntr > 1D-124 > > > Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > > -- > > Jeffrey S. Whitaker Phone : (303)497-6313 > > Meteorologist FAX : (303)497-6449 > > NOAA/OAR/PSD R/PSD1 Email : Jef...@no... > > <mailto:Jef...@no...> > > 325 Broadway Office : Skaggs Research Cntr 1D-124 > > Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg > > > > > > > -- > 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-124 > Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg > > That works fine now, thanks very much for your help. -Evan |
|
From: Matthew B. <mat...@gm...> - 2008-02-14 15:33:23
|
Hi, On Thu, Feb 14, 2008 at 3:10 PM, Neal Becker <ndb...@gm...> wrote: > Is there a way for me to read/write data to/from matlab? > > I know nothing about matlab, but if I need a colleague to send me some data, > what should I tell her about how to save it from matlab so that I can > import it into matplotlib/numpy? There's scipy.io.loadmat . As far as I know it reads all valid mat files, but happy to be corrected! Matthew |
|
From: Alan G I. <ai...@am...> - 2008-02-14 15:16:06
|
On Thu, 14 Feb 2008, John Hunter apparently wrote:
> import numpy as np
> import matplotlib
> matplotlib.use('Agg')
> import matplotlib.pyplot as plt
> x, y = np.random.rand(2,100)
> fig = plt.figure()
> ax = fig.add_subplot(111)
> ax.plot(x, y, marker='o', linestyle='', markerfacecolor='green')
> ax.set_title('Some random dots')
> ax.set_xlabel('x')
> ax.set_ylabel('y')
> ax.grid(True)
> fig.savefig('myplot.png', dpi=100)
> plt.show()
Does that ``show`` command have any effect?
(I know the effect for TkAgg.)
I tried clicking the ``show`` help at
<URL:http://matplotlib.sourceforge.net/>
but that directs to
<URL:http://matplotlib.sourceforge.net/matplotlib.pyplot.html#-show>
which does not exist.
Thank you,
Alan Isaac
|
|
From: Neal B. <ndb...@gm...> - 2008-02-14 15:10:35
|
Is there a way for me to read/write data to/from matlab? I know nothing about matlab, but if I need a colleague to send me some data, what should I tell her about how to save it from matlab so that I can import it into matplotlib/numpy? |
|
From: Alan G I. <ai...@am...> - 2008-02-14 14:42:47
|
On Thu, 14 Feb 2008, someone wrote: > I want to draw an xy-plot using the " Backend Agg " of matplotlib. <URL:http://matplotlib.sourceforge.net/leftwich_tut.txt> hth, Alan Isaac |