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
(35) |
2
(29) |
3
(12) |
4
|
5
(8) |
6
(5) |
|
7
(3) |
8
(38) |
9
(15) |
10
(20) |
11
(14) |
12
(12) |
13
(17) |
|
14
(6) |
15
(41) |
16
(38) |
17
(31) |
18
(7) |
19
(14) |
20
(12) |
|
21
(3) |
22
(3) |
23
(15) |
24
(4) |
25
|
26
(3) |
27
(2) |
|
28
(7) |
29
(16) |
30
(17) |
31
(10) |
|
|
|
|
From: Robin <ro...@gm...> - 2008-12-13 22:08:39
|
On Sat, Dec 13, 2008 at 9:17 PM, John Hunter <jd...@gm...> wrote: > On Sat, Dec 13, 2008 at 3:01 PM, Robin <ro...@gm...> wrote: > >> As in my other mail I am having trouble building from source. >> Previously I used the mac .egg to get around this, but the >> matplotlib-0.98.5-py2.5-macosx-10.3.egg for 0.98.5 doesn't appear to >> work. > > I think the egg may be broken. Try grabbing the tarball and following > the instructions at > > http://ipython.scipy.org/moin/Py4Science/InstallationOSX Right - following these exactly worked (I had been missing out the pkgconfig bit) Thanks, Robin |
|
From: John H. <jd...@gm...> - 2008-12-13 21:17:15
|
On Sat, Dec 13, 2008 at 3:01 PM, Robin <ro...@gm...> wrote: > As in my other mail I am having trouble building from source. > Previously I used the mac .egg to get around this, but the > matplotlib-0.98.5-py2.5-macosx-10.3.egg for 0.98.5 doesn't appear to > work. I think the egg may be broken. Try grabbing the tarball and following the instructions at http://ipython.scipy.org/moin/Py4Science/InstallationOSX or http://ipython.scipy.org/moin/MatplotlibOSXBuildNotes I will see if we can do something about the os x egg situation, but the above may be the path of least resistance right now. JDH |
|
From: Robin <ro...@gm...> - 2008-12-13 21:01:43
|
Hi,
As in my other mail I am having trouble building from source.
Previously I used the mac .egg to get around this, but the
matplotlib-0.98.5-py2.5-macosx-10.3.egg for 0.98.5 doesn't appear to
work.
I install with -N as I found recommended elsewhere on the list, since
otherwise it tries to build from source which fails as in the other
mail.
After installing the egg
easy_install -N matplotlib-0.98.5-py2.5-macosx-10.3.egg
I get the following error about missing png library - is there a
dependency I need to install?
In [2]: import pylab
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
/Users/robince/code/scipy_build/<ipython console> in <module>()
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5-py2.5-macosx-10.3.egg/pylab.py
in <module>()
----> 1 from matplotlib.pylab import *
2 import matplotlib.pylab
3 __doc__ = matplotlib.pylab.__doc__
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5-py2.5-macosx-10.3.egg/matplotlib/pylab.py
in <module>()
204 from numpy import ma
205
--> 206 from matplotlib import mpl # pulls in most modules
207
208 from matplotlib.dates import date2num, num2date,\
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5-py2.5-macosx-10.3.egg/matplotlib/mpl.py
in <module>()
2 from matplotlib import axis
----> 3 from matplotlib import axes
4 from matplotlib import cbook
5 from matplotlib import collections
6 from matplotlib import colors
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5-py2.5-macosx-10.3.egg/matplotlib/axes.py
in <module>()
16 import matplotlib.dates as mdates
17 import matplotlib.font_manager as font_manager
---> 18 import matplotlib.image as mimage
19 import matplotlib.legend as mlegend
20 import matplotlib.lines as mlines
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5-py2.5-macosx-10.3.egg/matplotlib/image.py
in <module>()
17 # For clarity, names from _image are given explicitly in this module:
18 from matplotlib import _image
---> 19 from matplotlib import _png
20
21 # For user convenience, the names from _image are also imported into
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5-py2.5-macosx-10.3.egg/matplotlib/_png.so,
2): Library not loaded: /usr/local/lib/libpng12.0.dylib
Referenced from:
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5-py2.5-macosx-10.3.egg/matplotlib/_png.so
Reason: image not found
Thanks
Robin
|
|
From: Robin <ro...@gm...> - 2008-12-13 20:47:23
|
Oops.. I'll continue
I am having a problem building matplotlib on OS X. It seems it has
come up quite a few times, but I haven't seen an answer. The problem
is that it seems to be trying to build a fat binary (-arch i386 -arch
ppc) but some of the depencies (installed via macports) are i386 only
so I get a "file is not of required architecture for architecture ppc"
error on linking. (See below)
How can I stop setup.py from trying to build ppc architecture?
I tried
CFLAGS="-Os -arch i386" LDFLAGS="-Os -arch i386" python setup.py build
but it didn't seem to make any difference.
Thanks
Robin
============================================================================
BUILDING MATPLOTLIB
matplotlib: 0.98.5
python: 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC
4.0.1 (Apple Computer, Inc. build 5367)]
platform: darwin
REQUIRED DEPENDENCIES
numpy: 1.3.0.dev6050
freetype2: 9.18.3
OPTIONAL BACKEND DEPENDENCIES
libpng: 1.2.33
Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4
wxPython: 2.8.6.0
* WxAgg extension not required for wxPython >= 2.8
Gtk+: no
* Building for Gtk+ requires pygtk; you must be able
* to "import gtk" in your build/install environment
Mac OS X native: yes
Qt: no
Qt4: no
Cairo: no
OPTIONAL DATE/TIMEZONE DEPENDENCIES
datetime: present, version unknown
dateutil: matplotlib will provide
pytz: matplotlib will provide
adding pytz
OPTIONAL USETEX DEPENDENCIES
dvipng: 1.11
ghostscript: 8.62
latex: 3.1415926
pdftops: 3.02
EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES
configobj: matplotlib will provide
enthought.traits: no
[Edit setup.cfg to suppress the above messages]
============================================================================
pymods ['pylab', 'configobj']
packages ['matplotlib', 'matplotlib.backends',
'matplotlib.projections', 'mpl_toolkits', 'matplotlib.numerix',
'matplotlib.numerix.mlab', 'matplotlib.numerix.ma',
'matplotlib.numerix.npyma', 'matplotlib.numerix.linear_algebra',
'matplotlib.numerix.random_array', 'matplotlib.numerix.fft',
'matplotlib.delaunay', 'pytz', 'dateutil', 'dateutil/zoneinfo',
'matplotlib.config']
running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc ->
build/lib.macosx-10.3-fat-2.5/matplotlib/mpl-data
copying lib/matplotlib/mpl-data/matplotlib.conf ->
build/lib.macosx-10.3-fat-2.5/matplotlib/mpl-data
running build_ext
building 'matplotlib.ft2font' extension
g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g
-bundle -undefined dynamic_lookup
build/temp.macosx-10.3-fat-2.5/src/ft2font.o
build/temp.macosx-10.3-fat-2.5/src/mplutils.o
build/temp.macosx-10.3-fat-2.5/CXX/cxx_extensions.o
build/temp.macosx-10.3-fat-2.5/CXX/cxxsupport.o
build/temp.macosx-10.3-fat-2.5/CXX/IndirectPythonInterface.o
build/temp.macosx-10.3-fat-2.5/CXX/cxxextensions.o -L/opt/local/lib
-L/usr/local/lib -L/usr/lib -L/usr/X11R6/lib -lfreetype -lz -lz
-lstdc++ -lm -o build/lib.macosx-10.3-fat-2.5/matplotlib/ft2font.so
-Wl,-framework,CoreServices -Wl,-framework,ApplicationServices
ld: warning in build/temp.macosx-10.3-fat-2.5/src/ft2font.o, file is
not of required architecture
ld: warning in build/temp.macosx-10.3-fat-2.5/src/mplutils.o, file is
not of required architecture
ld: warning in build/temp.macosx-10.3-fat-2.5/CXX/cxx_extensions.o,
file is not of required architecture
ld: warning in build/temp.macosx-10.3-fat-2.5/CXX/cxxsupport.o, file
is not of required architecture
ld: warning in build/temp.macosx-10.3-fat-2.5/CXX/IndirectPythonInterface.o,
file is not of required architecture
ld: warning in build/temp.macosx-10.3-fat-2.5/CXX/cxxextensions.o,
file is not of required architecture
ld: warning in /opt/local/lib/libfreetype.dylib, file is not of
required architecture
ld: warning in /opt/local/lib/libz.dylib, file is not of required architecture
ld: in /opt/local/lib/libJPEG.dylib, file is not of required
architecture for architecture ppc
collect2: ld returned 1 exit status
ld: warning, duplicate dylib /opt/local/lib/libz.1.dylib
lipo: can't open input file:
/var/folders/8s/8sR4EeeWGVKm6eizf-nS9U+++TI/-Tmp-//cchTIwch.out (No
such file or directory)
error: command 'g++' failed with exit status 1
|
|
From: Robin <ro...@gm...> - 2008-12-13 20:43:42
|
Hi, I am having a problem building matplotlib on OS X. It seems it has come up quite a few times, but I haven't seen an answer. The problem is that it seems to be trying to build a fat binary (-arch i386 -arch ppc) but some of the depencies (installed via macports) are i386 only so I get |
|
From: Jeff W. <js...@fa...> - 2008-12-13 18:21:27
|
Mauro Cavalcanti wrote: > Dear Jeff, > > Thanks for your attention. > > 2008/12/13 Jeff Whitaker <js...@fa...>: > >> Mauro: Did you update from SVN? If so, can be more specific about what >> didn't work? The return value of fillcontinents should be a list of Polygon >> instances, each with a remove method. >> > > Well, let's see... I am using version 0.99.2 from the regular > installation package (under Ubuntu Hardy). The problem is that I > cannot resort to SVN versions because my application should run with > MPL/Basemap versions that can be downloaded and installed by > unsophisticated Windows users (those that know how to download an > ".exe" file, click on it, and install). > Mauro: I realize that - but if you can test the SVN version then I can make a new release before you release your app. > So, if I do correctly understood, the sample code below will work only > with the SVN version? > > contpolys = map.fillcontinents() > for contpoly in contpolys: > contpoly.remove() > Yes. > With best regards, > > PS BTW, the new "scale" parameter on the Blue Marble drawing method > works quite well! Using it, I have been able to reduce the time > required to draw an excellent image by several orders of magnitude! > Good. > Have not yet tested the speed improvements you did to the drawrivers() > method. > I haven't changed the drawrivers method. -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: Gregor T. <gre...@gm...> - 2008-12-13 17:34:29
|
Years ago I observed a similar behaviour with gnuplot. This behaviour
appears if you use line join style 'miter' and if your data is very fine
spaced with small noise. Then in the figure the noise appears much
larger than it actually is. Limited output precision for representing
the plot data in the different backends may also both increase or
attenuate the observed noise. Best solution: use round line join style.
I would propose to make this the default.
I attached a script that shows this behaviour, and some images, pdf with
Acrobat Reader. Agg does not show this noise, unless you render the
figure with high resolution (here 1000dpi), and even then the noise is
smaller. Perhaps Agg does some optimization/rounding? Difficult to tell
which backend shows the correct behaviour, which might be not the
preferred one.
Gregor
x = linspace(0,0.02, 1001) + random(1001)*1e-5
x[-1] = 1
y = ones_like(x)
y[:500:2] = 1 + random(250)*1e-4
clf()
plot(x,y, solid_joinstyle = 'miter')
plot(x,y+0.05, solid_joinstyle = 'round')
ylim(0.9,1.1)
savefig('testnoise.pdf')
Michael Droettboom schrieb:
> Also -- for mtcoder:
>
> Can you send us the script that generates your plot?
>
> Also, if you set your backend to Cairo, and then generate the pdf, to
> you get the same result?
>
> Cheers,
> Mike
>
> Michael Droettboom wrote:
>
>> There's something funny going on with line caps, maybe? It looks like
>> the corners aren't getting capped in the same way as Agg does.
>>
>> I've created screenshots of Jesse's pdf file in acrobat and evince.
>>
>> Any thought, Jouni?
>>
>> Cheers,
>> Mike
>>
>> John Hunter wrote:
>>
>>> On Thu, Dec 11, 2008 at 11:16 PM, mtcoder <jbe...@gm...> wrote:
>>>
>>>
>>>
>>>> http://www.nabble.com/file/p20970084/testode.rk45.a0.99.eps1e-07.pdf
>>>> testode.rk45.a0.99.eps1e-07.pdf . This comes from a completely
>>>> deterministic
>>>> ode. But is looks like I've added a tiny amount of noise.
>>>>
>>>> On a technical note, I'm running Ubuntu 8.04, python2.5.1,
>>>> matplotlib0.91.2
>>>> (with GTKAgg backend).
>>>>
>>>> (Hopefully I didn't miss a similar question--and solution--elsewhere
>>>> in the
>>>> forum.)
>>>>
>>>>
>>> My guess is that you may be seeing the antialiasing of your pdf
>>> renderer. matplotlib has a pretty good antialiasing renderer for the
>>> screen display (antigrain) but your mileage may vary for your pdf
>>> renderer. Since pdf is a vector output, we have no control over the
>>> renderering. What pdf viewer are you using? The best way for us to
>>> see what you are seeing is to take a PNG screenshot of your PDF file
>>> displayed in your viewer and then post the PNG. Ie, here is what I am
>>> seeing in the Preview app: the fuzziness is from the antialiasing, but
>>> I am used to seeing this.
>>>
>
|
|
From: Jeff W. <js...@fa...> - 2008-12-13 17:05:36
|
Mauro Cavalcanti wrote: > Dear Jeff, > > 2008/12/13 Jeff Whitaker <js...@fa...>: > >> Mauro: That's a bug - the fillcontinents method was only returning the last >> Polygon instance drawn. I've fixed it in SVN (r6579) to return a list of >> all the Polygon instances. You can now iterate over that list and remove >> each Polygon, like this >> contpolys = m.fillcontinents() >> for contpoly in contpolys: >> contpoly.remove() >> > > In my application, it didn't work. Mauro: Did you update from SVN? If so, can be more specific about what didn't work? The return value of fillcontinents should be a list of Polygon instances, each with a remove method. > But I just figured out that a much > simpler solution is to call ax.cla() (brute force, isn't it? :)) That deletes everything, not just the continent polygons. I don't think you want to do that. Removing just the continent Polygons should work if you have the latest SVN revision (0.99.3). Let's figure out why that's not working for you. -Jeff > and > then call the Blue Marble drawing routine (err, method... I sometimes > miss the old and good FORTRAN times...). The problem with this > paleolitic approach is that by clearing the axis first, I lost all the > points and trees I have plotted on the map... :(. I will have to work > this out, because I have the same problem with other Basemap methods > in my application (for example, if I want to draw the map in different > resolutions, or on different projections). > > >> Thanks for the bug report. >> > > Well, I even didn't know that it was a bug! > > With warmest regards, > > -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |
|
From: Michael D. <md...@st...> - 2008-12-13 16:46:09
|
Also -- for mtcoder: Can you send us the script that generates your plot? Also, if you set your backend to Cairo, and then generate the pdf, to you get the same result? Cheers, Mike Michael Droettboom wrote: > There's something funny going on with line caps, maybe? It looks like > the corners aren't getting capped in the same way as Agg does. > > I've created screenshots of Jesse's pdf file in acrobat and evince. > > Any thought, Jouni? > > Cheers, > Mike > > John Hunter wrote: >> On Thu, Dec 11, 2008 at 11:16 PM, mtcoder <jbe...@gm...> wrote: >> >> >>> http://www.nabble.com/file/p20970084/testode.rk45.a0.99.eps1e-07.pdf >>> testode.rk45.a0.99.eps1e-07.pdf . This comes from a completely >>> deterministic >>> ode. But is looks like I've added a tiny amount of noise. >>> >>> On a technical note, I'm running Ubuntu 8.04, python2.5.1, >>> matplotlib0.91.2 >>> (with GTKAgg backend). >>> >>> (Hopefully I didn't miss a similar question--and solution--elsewhere >>> in the >>> forum.) >>> >> >> My guess is that you may be seeing the antialiasing of your pdf >> renderer. matplotlib has a pretty good antialiasing renderer for the >> screen display (antigrain) but your mileage may vary for your pdf >> renderer. Since pdf is a vector output, we have no control over the >> renderering. What pdf viewer are you using? The best way for us to >> see what you are seeing is to take a PNG screenshot of your PDF file >> displayed in your viewer and then post the PNG. Ie, here is what I am >> seeing in the Preview app: the fuzziness is from the antialiasing, but >> I am used to seeing this. >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------------ >> >> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, >> Nevada. >> The future of the web can't happen without you. Join us at MIX09 to >> help >> pave the way to the Next Web now. Learn more and register at >> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Michael D. <md...@st...> - 2008-12-13 16:44:20
|
There's something funny going on with line caps, maybe? It looks like the corners aren't getting capped in the same way as Agg does. I've created screenshots of Jesse's pdf file in acrobat and evince. Any thought, Jouni? Cheers, Mike John Hunter wrote: > On Thu, Dec 11, 2008 at 11:16 PM, mtcoder <jbe...@gm...> wrote: > > >> http://www.nabble.com/file/p20970084/testode.rk45.a0.99.eps1e-07.pdf >> testode.rk45.a0.99.eps1e-07.pdf . This comes from a completely deterministic >> ode. But is looks like I've added a tiny amount of noise. >> >> On a technical note, I'm running Ubuntu 8.04, python2.5.1, matplotlib0.91.2 >> (with GTKAgg backend). >> >> (Hopefully I didn't miss a similar question--and solution--elsewhere in the >> forum.) >> > > My guess is that you may be seeing the antialiasing of your pdf > renderer. matplotlib has a pretty good antialiasing renderer for the > screen display (antigrain) but your mileage may vary for your pdf > renderer. Since pdf is a vector output, we have no control over the > renderering. What pdf viewer are you using? The best way for us to > see what you are seeing is to take a PNG screenshot of your PDF file > displayed in your viewer and then post the PNG. Ie, here is what I am > seeing in the Preview app: the fuzziness is from the antialiasing, but > I am used to seeing this. > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Jouni K. S. <jk...@ik...> - 2008-12-13 16:07:27
|
"John Hunter" <jd...@gm...> writes: > One more thought -- you should be able to turn off the antialiased > property, eg with > > plot(x, y, antialiased=False) > > Unfortunately, I poked into our backend_pdf and it appears this > property is ignored. Jouni: is there a way to turn off antialiasing > in PDF, and could we add support for this in the backend? Unfortunately, there is no way (that I know of) to turn off antialiasing in the pdf file. -- Jouni K. Seppänen http://www.iki.fi/jks |
|
From: John H. <jd...@gm...> - 2008-12-13 15:43:42
|
On Sat, Dec 13, 2008 at 9:38 AM, John Hunter <jd...@gm...> wrote: > My guess is that you may be seeing the antialiasing of your pdf > renderer. matplotlib has a pretty good antialiasing renderer for the > screen display (antigrain) but your mileage may vary for your pdf > renderer. Since pdf is a vector output, we have no control over the > renderering. What pdf viewer are you using? The best way for us to > see what you are seeing is to take a PNG screenshot of your PDF file > displayed in your viewer and then post the PNG. Ie, here is what I am > seeing in the Preview app: the fuzziness is from the antialiasing, but > I am used to seeing this. One more thought -- you should be able to turn off the antialiased property, eg with plot(x, y, antialiased=False) Unfortunately, I poked into our backend_pdf and it appears this property is ignored. Jouni: is there a way to turn off antialiasing in PDF, and could we add support for this in the backend? Thanks, JDH |
|
From: John H. <jd...@gm...> - 2008-12-13 15:38:57
|
On Thu, Dec 11, 2008 at 11:16 PM, mtcoder <jbe...@gm...> wrote: > http://www.nabble.com/file/p20970084/testode.rk45.a0.99.eps1e-07.pdf > testode.rk45.a0.99.eps1e-07.pdf . This comes from a completely deterministic > ode. But is looks like I've added a tiny amount of noise. > > On a technical note, I'm running Ubuntu 8.04, python2.5.1, matplotlib0.91.2 > (with GTKAgg backend). > > (Hopefully I didn't miss a similar question--and solution--elsewhere in the > forum.) My guess is that you may be seeing the antialiasing of your pdf renderer. matplotlib has a pretty good antialiasing renderer for the screen display (antigrain) but your mileage may vary for your pdf renderer. Since pdf is a vector output, we have no control over the renderering. What pdf viewer are you using? The best way for us to see what you are seeing is to take a PNG screenshot of your PDF file displayed in your viewer and then post the PNG. Ie, here is what I am seeing in the Preview app: the fuzziness is from the antialiasing, but I am used to seeing this. |
|
From: Jeff W. <js...@fa...> - 2008-12-13 14:56:47
|
Mauro Cavalcanti wrote: > Dear ALL, > > I just noted that the remove() method which worked OK in version 0.99 > of MPL Basemap to remove country borders and rivers is not working > anymore after I upgraded to Basemap version 0.99.2. > > What have changed? > > Thanks in advance. > > Best regards, > > Mauro: Seems to works fine for me. Can you send a small, self-contained example script that illustrates your problem? -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: Jeff W. <js...@fa...> - 2008-12-13 14:49:28
|
Mauro Cavalcanti wrote:
> Dear ALL,
>
> Am I intending to change the world's geography? No, not quite. I just
> would like to know how to deal with the following problem, I have
> stumbled upon in MPL/Basemap: I have a line:
>
> continents = map.fillcontinents(color='coral, lake_color='blue')
>
> where map is, of course, a Basemap instance
>
> According to the Basemap documentation, the Basemap.fillcontinents()
> method returns a matplotlib.patches.Polygon object.
>
> Later on, I do the following, in an attempt to erase this object:
>
> del continents
>
> But nothing happens.
>
> If I try instead continents.remove(), I got an error message:
> TypeError: remove() takes exactly one argument (0 given) what is not
> suprising as the objet returned by fillcontinents() is not a list.
>
> Any hints?
>
> Thanks in advance!
>
> With best wishes,
>
>
Mauro: That's a bug - the fillcontinents method was only returning the
last Polygon instance drawn. I've fixed it in SVN (r6579) to return a
list of all the Polygon instances. You can now iterate over that list
and remove each Polygon, like this
contpolys = m.fillcontinents()
for contpoly in contpolys:
contpoly.remove()
Thanks for the bug report.
-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: Mauro C. <mau...@gm...> - 2008-12-13 13:58:32
|
Dear ALL, I just noted that the remove() method which worked OK in version 0.99 of MPL Basemap to remove country borders and rivers is not working anymore after I upgraded to Basemap version 0.99.2. What have changed? Thanks in advance. Best regards, -- Dr. Mauro J. Cavalcanti Ecoinformatics Studio P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: mau...@gm... Web: http://studio.infobio.net Linux Registered User #473524 * Ubuntu User #22717 "Life is complex. It consists of real and imaginary parts." |
|
From: Mauro C. <mau...@gm...> - 2008-12-13 13:51:35
|
Dear ALL, Am I intending to change the world's geography? No, not quite. I just would like to know how to deal with the following problem, I have stumbled upon in MPL/Basemap: I have a line: continents = map.fillcontinents(color='coral, lake_color='blue') where map is, of course, a Basemap instance According to the Basemap documentation, the Basemap.fillcontinents() method returns a matplotlib.patches.Polygon object. Later on, I do the following, in an attempt to erase this object: del continents But nothing happens. If I try instead continents.remove(), I got an error message: TypeError: remove() takes exactly one argument (0 given) what is not suprising as the objet returned by fillcontinents() is not a list. Any hints? Thanks in advance! With best wishes, -- Dr. Mauro J. Cavalcanti Ecoinformatics Studio P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: mau...@gm... Web: http://studio.infobio.net Linux Registered User #473524 * Ubuntu User #22717 "Life is complex. It consists of real and imaginary parts." |
|
From: R. A. <ra...@gm...> - 2008-12-12 23:50:44
|
Thanks Jeff,
I'll study your code and will see if I can adapt it for my use.
Great tool also,
Roger
--
On Fri, Dec 12, 2008 at 3:20 PM, Jeff Whitaker <js...@fa...> wrote:
> Roger André wrote:
>
>> Hi All,
>>
>> I'm very new to Matplotlib and am having some trouble getting a colorbar
>> to be positioned and sized I want it to. A big part of the problem is that
>> I have adapted several examples from the Cookbook and Gallery, just to see
>> if I could roughly approximate what I want to see, and now am having trouble
>> integrating the different pieces. Specifically, I can't seem to resolve
>> when to use add_subplot vs. add_axes. Below are 2 examples of code. The
>> first one shows correct layout of a data figure and a separate colorbar
>> below it. The colorbar is the correct size, and is located in the right
>> spot. The second example has the correct data mapped in it using the
>> basemap module, but I cannot get the colorbar to move up closer to the
>> figure, or to shrink it. Could someone advise me on this? I've looked at
>> the "Artist tutorial", and although it is very well written, I'm still not
>> sure how to get this done .
>>
>> Thanks in advance,
>>
>> Roger
>>
>
> Roger: I usually explicity two separate axes instances, one for the plot
> and one for the colorbar. The location of the axes always takes a bit of
> tweaking to get right. Here's an example:
>
> from mpl_toolkits.basemap import Basemap
> import matplotlib.pyplot as plt
> import numpy as np
> # create figure instance.
> fig = plt.figure(figsize=(8,8))
> # create an axes instance, leaving room for colorbars on right and bottom.
> ax = fig.add_axes([0.05,0.15,0.8,0.8]) # color on bottom
> # set up orthographic map projection with
> # perspective of satellite looking down at 50N, 100W.
> # use low resolution coastlines.
> map = Basemap(projection='ortho',lat_0=50,lon_0=-100,resolution='c')
> # draw coastlines, country boundaries, fill continents.
> map.drawcoastlines()
> # draw the edge of the map projection region (the projection limb)
> map.drawmapboundary()
> # draw lat/lon grid lines every 30 degrees.
> map.drawmeridians(np.arange(0,360,30))
> map.drawparallels(np.arange(-90,90,30))
> # make up some data on a regular lat/lon grid.
> nlats = 73; nlons = 145; delta = 2.*np.pi/(nlons-1)
> lats = (0.5*np.pi-delta*np.indices((nlats,nlons))[0,:,:])
> lons = (delta*np.indices((nlats,nlons))[1,:,:])
> wave = 0.75*(np.sin(2.*lats)**8*np.cos(4.*lons))
> mean = 0.5*np.cos(2.*lats)*((np.sin(2.*lats))**2 + 2.)
> # compute native map projection coordinates of lat/lon grid.
> x, y = map(lons*180./np.pi, lats*180./np.pi)
> # contour data over the map.
> cs = map.contourf(x,y,wave+mean,15)
> # get axes bounds.
> pos = ax.get_position()
> l, b, w, h = pos.bounds
> # create axes instance for colorbar on right.
> cax = plt.axes([l+w+0.03, b, 0.04, h])
> # draw colorbar on right.
> plt.colorbar(cax=cax,orientation='vertical')
> # create axes instance for colorbar on bottom.
> cax = plt.axes([l, b-0.07, w, 0.04])
> # draw colorbar on bottom.
> plt.colorbar(cax=cax,orientation='horizontal')
> plt.show()
>
> HTH,
>
> -Jeff
>
>> -------------
>>
>> Example 1:
>>
>> #! /usr/bin/python
>>
>> import matplotlib.pyplot as plt
>> import numpy as np
>> from numpy.random import randn
>> from matplotlib import mpl
>>
>> # Make plot with horizontal colorbar
>>
>> fig = plt.figure(figsize=(7,8))
>> ax = fig.add_subplot(111)
>>
>> # 'add_axes' for color bar
>> ax1 = fig.add_axes([0.25, .07, 0.5, 0.03]) # [x_loc, y_loc, x_size,
>> y_size]
>>
>> data = np.clip(randn(250, 250), -1, 1) # DATA FOR SQUARE FIG
>> ax.imshow(data, interpolation='nearest') # DRAW DATA IN SQUARE FIG
>>
>> ax.set_title('Monthly PCP percentiles for 9-2008')
>>
>> ########### Colorbar Settings ########
>> cmap = mpl.cm.cool
>> norm = mpl.colors.Normalize(vmin=0.0, vmax=1.0)
>> cb1 = mpl.colorbar.ColorbarBase(ax1, cmap=cmap, norm=norm,
>> orientation='horizontal')
>> cb1.set_label('percentile')
>> ################################
>>
>> plt.show()
>> fig.savefig('test.png')
>>
>>
>> --------------------------------------------------------------------------------------------
>> Example 2:
>>
>> #! /usr/bin/python
>>
>> """taken from geos_demo_2.py"""
>>
>> from PIL import Image
>> from mpl_toolkits.basemap import Basemap
>> import numpy as np
>> import matplotlib
>> from matplotlib import mpl
>> import matplotlib.pyplot as plt
>> from matplotlib.image import pil_to_array
>>
>> plot_name = 'hydro_demo.png'
>> overlay_color = 'black'
>>
>> # read in jpeg image to rgb array
>> pilImage = Image.open('wms_mapser.png')
>>
>> #data = asarray(pilImage)
>> data = pil_to_array(pilImage)
>> data = data[:, :, :] # get data from RGB channels of image
>>
>> # define data region and projection parameters
>> ll_lon = -125
>> ll_lat = 39
>> ur_lon = -108
>> ur_lat = 54
>> lon_0 = 0
>>
>>
>> fig = plt.figure(figsize=(7,8))
>> #ax = fig.add_axes((0.1,0.1,0.8,0.8))
>> ax = fig.add_axes((.1,0.1,0.8,0.8))
>>
>> # create Basemap instance for cylindrical equidistant projection, htdro
>> image domain
>> m = Basemap(projection='cyl', lon_0=lon_0, llcrnrlon=ll_lon,
>> llcrnrlat=ll_lat, urcrnrlon=ur_lon,
>> urcrnrlat=ur_lat, suppress_ticks=False)
>>
>> # add data
>> cmap = mpl.cm.cool
>> m.imshow(data, cmap, interpolation=None)
>> plt.clim(0, 1)
>>
>> # add a colobar
>> plt.colorbar(orientation='horizontal')
>>
>> # add timestamp and save
>> fig = plt.gcf()
>>
>> # ADD FIGURE TEXT
>> fig.text(x=0.5, y=0.1,
>> s='percentile',
>> fontsize=10,
>> )
>>
>> fig.set_size_inches((7,7))
>>
>> # ADD A FIGURE TITLE
>> plt.title('Monthly PCP percentiles for 9-2008',y=1.05,fontsize=12)
>>
>> plt.show()
>> #fig.savefig(plot_name)
>> #print 'Plot saved to %s' % (plot_name)
>> ------------------------------------------------------------------------
>>
>>
>> ------------------------------------------------------------------------------
>> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
>> Nevada.
>> The future of the web can't happen without you. Join us at MIX09 to help
>> pave the way to the Next Web now. Learn more and register at
>>
>> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
>
> --
> 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: Jeff W. <js...@fa...> - 2008-12-12 23:21:19
|
Roger André wrote:
> Hi All,
>
> I'm very new to Matplotlib and am having some trouble getting a
> colorbar to be positioned and sized I want it to. A big part of the
> problem is that I have adapted several examples from the Cookbook and
> Gallery, just to see if I could roughly approximate what I want to
> see, and now am having trouble integrating the different pieces.
> Specifically, I can't seem to resolve when to use add_subplot vs.
> add_axes. Below are 2 examples of code. The first one shows correct
> layout of a data figure and a separate colorbar below it. The
> colorbar is the correct size, and is located in the right spot. The
> second example has the correct data mapped in it using the basemap
> module, but I cannot get the colorbar to move up closer to the figure,
> or to shrink it. Could someone advise me on this? I've looked at the
> "Artist tutorial", and although it is very well written, I'm still not
> sure how to get this done .
>
> Thanks in advance,
>
> Roger
Roger: I usually explicity two separate axes instances, one for the
plot and one for the colorbar. The location of the axes always takes a
bit of tweaking to get right. Here's an example:
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np
# create figure instance.
fig = plt.figure(figsize=(8,8))
# create an axes instance, leaving room for colorbars on right and bottom.
ax = fig.add_axes([0.05,0.15,0.8,0.8]) # color on bottom
# set up orthographic map projection with
# perspective of satellite looking down at 50N, 100W.
# use low resolution coastlines.
map = Basemap(projection='ortho',lat_0=50,lon_0=-100,resolution='c')
# draw coastlines, country boundaries, fill continents.
map.drawcoastlines()
# draw the edge of the map projection region (the projection limb)
map.drawmapboundary()
# draw lat/lon grid lines every 30 degrees.
map.drawmeridians(np.arange(0,360,30))
map.drawparallels(np.arange(-90,90,30))
# make up some data on a regular lat/lon grid.
nlats = 73; nlons = 145; delta = 2.*np.pi/(nlons-1)
lats = (0.5*np.pi-delta*np.indices((nlats,nlons))[0,:,:])
lons = (delta*np.indices((nlats,nlons))[1,:,:])
wave = 0.75*(np.sin(2.*lats)**8*np.cos(4.*lons))
mean = 0.5*np.cos(2.*lats)*((np.sin(2.*lats))**2 + 2.)
# compute native map projection coordinates of lat/lon grid.
x, y = map(lons*180./np.pi, lats*180./np.pi)
# contour data over the map.
cs = map.contourf(x,y,wave+mean,15)
# get axes bounds.
pos = ax.get_position()
l, b, w, h = pos.bounds
# create axes instance for colorbar on right.
cax = plt.axes([l+w+0.03, b, 0.04, h])
# draw colorbar on right.
plt.colorbar(cax=cax,orientation='vertical')
# create axes instance for colorbar on bottom.
cax = plt.axes([l, b-0.07, w, 0.04])
# draw colorbar on bottom.
plt.colorbar(cax=cax,orientation='horizontal')
plt.show()
HTH,
-Jeff
> -------------
>
> Example 1:
>
> #! /usr/bin/python
>
> import matplotlib.pyplot as plt
> import numpy as np
> from numpy.random import randn
> from matplotlib import mpl
>
> # Make plot with horizontal colorbar
>
> fig = plt.figure(figsize=(7,8))
> ax = fig.add_subplot(111)
>
> # 'add_axes' for color bar
> ax1 = fig.add_axes([0.25, .07, 0.5, 0.03]) # [x_loc, y_loc, x_size,
> y_size]
>
> data = np.clip(randn(250, 250), -1, 1) # DATA FOR SQUARE FIG
> ax.imshow(data, interpolation='nearest') # DRAW DATA IN SQUARE FIG
>
> ax.set_title('Monthly PCP percentiles for 9-2008')
>
> ########### Colorbar Settings ########
> cmap = mpl.cm.cool
> norm = mpl.colors.Normalize(vmin=0.0, vmax=1.0)
> cb1 = mpl.colorbar.ColorbarBase(ax1, cmap=cmap, norm=norm,
> orientation='horizontal')
> cb1.set_label('percentile')
> ################################
>
> plt.show()
> fig.savefig('test.png')
>
> --------------------------------------------------------------------------------------------
> Example 2:
>
> #! /usr/bin/python
>
> """taken from geos_demo_2.py"""
>
> from PIL import Image
> from mpl_toolkits.basemap import Basemap
> import numpy as np
> import matplotlib
> from matplotlib import mpl
> import matplotlib.pyplot as plt
> from matplotlib.image import pil_to_array
>
> plot_name = 'hydro_demo.png'
> overlay_color = 'black'
>
> # read in jpeg image to rgb array
> pilImage = Image.open('wms_mapser.png')
>
> #data = asarray(pilImage)
> data = pil_to_array(pilImage)
> data = data[:, :, :] # get data from RGB channels of image
>
> # define data region and projection parameters
> ll_lon = -125
> ll_lat = 39
> ur_lon = -108
> ur_lat = 54
> lon_0 = 0
>
>
> fig = plt.figure(figsize=(7,8))
> #ax = fig.add_axes((0.1,0.1,0.8,0.8))
> ax = fig.add_axes((.1,0.1,0.8,0.8))
>
> # create Basemap instance for cylindrical equidistant projection,
> htdro image domain
> m = Basemap(projection='cyl', lon_0=lon_0, llcrnrlon=ll_lon,
> llcrnrlat=ll_lat, urcrnrlon=ur_lon,
> urcrnrlat=ur_lat, suppress_ticks=False)
>
> # add data
> cmap = mpl.cm.cool
> m.imshow(data, cmap, interpolation=None)
> plt.clim(0, 1)
>
> # add a colobar
> plt.colorbar(orientation='horizontal')
>
> # add timestamp and save
> fig = plt.gcf()
>
> # ADD FIGURE TEXT
> fig.text(x=0.5, y=0.1,
> s='percentile',
> fontsize=10,
> )
>
> fig.set_size_inches((7,7))
>
> # ADD A FIGURE TITLE
> plt.title('Monthly PCP percentiles for 9-2008',y=1.05,fontsize=12)
>
> plt.show()
> #fig.savefig(plot_name)
> #print 'Plot saved to %s' % (plot_name)
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you. Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
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: R. A. <ra...@gm...> - 2008-12-12 21:54:35
|
Hi All,
I'm very new to Matplotlib and am having some trouble getting a colorbar to
be positioned and sized I want it to. A big part of the problem is that I
have adapted several examples from the Cookbook and Gallery, just to see if
I could roughly approximate what I want to see, and now am having trouble
integrating the different pieces. Specifically, I can't seem to resolve
when to use add_subplot vs. add_axes. Below are 2 examples of code. The
first one shows correct layout of a data figure and a separate colorbar
below it. The colorbar is the correct size, and is located in the right
spot. The second example has the correct data mapped in it using the
basemap module, but I cannot get the colorbar to move up closer to the
figure, or to shrink it. Could someone advise me on this? I've looked at
the "Artist tutorial", and although it is very well written, I'm still not
sure how to get this done.
Thanks in advance,
Roger
-------------
Example 1:
#! /usr/bin/python
import matplotlib.pyplot as plt
import numpy as np
from numpy.random import randn
from matplotlib import mpl
# Make plot with horizontal colorbar
fig = plt.figure(figsize=(7,8))
ax = fig.add_subplot(111)
# 'add_axes' for color bar
ax1 = fig.add_axes([0.25, .07, 0.5, 0.03]) # [x_loc, y_loc, x_size, y_size]
data = np.clip(randn(250, 250), -1, 1) # DATA FOR SQUARE FIG
ax.imshow(data, interpolation='nearest') # DRAW DATA IN SQUARE FIG
ax.set_title('Monthly PCP percentiles for 9-2008')
########### Colorbar Settings ########
cmap = mpl.cm.cool
norm = mpl.colors.Normalize(vmin=0.0, vmax=1.0)
cb1 = mpl.colorbar.ColorbarBase(ax1, cmap=cmap, norm=norm,
orientation='horizontal')
cb1.set_label('percentile')
################################
plt.show()
fig.savefig('test.png')
--------------------------------------------------------------------------------------------
Example 2:
#! /usr/bin/python
"""taken from geos_demo_2.py"""
from PIL import Image
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib
from matplotlib import mpl
import matplotlib.pyplot as plt
from matplotlib.image import pil_to_array
plot_name = 'hydro_demo.png'
overlay_color = 'black'
# read in jpeg image to rgb array
pilImage = Image.open('wms_mapser.png')
#data = asarray(pilImage)
data = pil_to_array(pilImage)
data = data[:, :, :] # get data from RGB channels of image
# define data region and projection parameters
ll_lon = -125
ll_lat = 39
ur_lon = -108
ur_lat = 54
lon_0 = 0
fig = plt.figure(figsize=(7,8))
#ax = fig.add_axes((0.1,0.1,0.8,0.8))
ax = fig.add_axes((.1,0.1,0.8,0.8))
# create Basemap instance for cylindrical equidistant projection, htdro
image domain
m = Basemap(projection='cyl', lon_0=lon_0, llcrnrlon=ll_lon,
llcrnrlat=ll_lat, urcrnrlon=ur_lon,
urcrnrlat=ur_lat, suppress_ticks=False)
# add data
cmap = mpl.cm.cool
m.imshow(data, cmap, interpolation=None)
plt.clim(0, 1)
# add a colobar
plt.colorbar(orientation='horizontal')
# add timestamp and save
fig = plt.gcf()
# ADD FIGURE TEXT
fig.text(x=0.5, y=0.1,
s='percentile',
fontsize=10,
)
fig.set_size_inches((7,7))
# ADD A FIGURE TITLE
plt.title('Monthly PCP percentiles for 9-2008',y=1.05,fontsize=12)
plt.show()
#fig.savefig(plot_name)
#print 'Plot saved to %s' % (plot_name)
|
|
From: Kaushik G. <Kau...@hm...> - 2008-12-12 20:10:27
|
Hi Everyone,
I am running into a problem when trying to install 0.98.5 egg on a Mac OS X
machine. Any help much appreciated. Relevant error messages follow:
Thanks
-Kaushik
sudo easy_install
matplotlib-0.98.5-py2.5-macosx-10.3.egg**********************************************************************
============================================================================
BUILDING MATPLOTLIB
matplotlib: 0.98.5
python: 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) [GCC
4.0.1 (Apple Computer, Inc. build 5363)]
platform: darwin
REQUIRED DEPENDENCIES
numpy: 1.2.1
freetype2: found, but unknown version (no pkg-config)
OPTIONAL BACKEND DEPENDENCIES
libpng: found, but unknown version (no pkg-config)
Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4
wxPython: no
* wxPython not found
Gtk+: no
* Building for Gtk+ requires pygtk; you must be able
* to "import gtk" in your build/install environment
Mac OS X native: yes
Qt: no
Qt4: no
Cairo: no
OPTIONAL DATE/TIMEZONE DEPENDENCIES
datetime: present, version unknown
dateutil: matplotlib will provide
pytz: 2008c
OPTIONAL USETEX DEPENDENCIES
dvipng: no
ghostscript: /bin/sh: gs: command not found
latex: no
EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES
configobj: matplotlib will provide
enthought.traits: no
[Edit setup.cfg to suppress the above messages]
============================================================================
error: lib/matplotlib/mpl-data/matplotlib.conf.template: No such file or directory
Exception exceptions.OSError: (2, 'No such file or directory', 'src/image.cpp')
in <bound method CleanUpFile.__del__ of <setupext.CleanUpFile instance at
0xf61120>> ignored
Exception exceptions.OSError: (2, 'No such file or directory', 'src/path.cpp')
in <bound method CleanUpFile.__del__ of <setupext.CleanUpFile instance at
0xf48968>> ignored
Exception exceptions.OSError: (2, 'No such file or directory',
'src/backend_agg.cpp') in <bound method CleanUpFile.__del__ of
<setupext.CleanUpFile instance at 0xf48c38>> ignored
From within
ipython:***************************************************************************************************
In [1]: import pylab
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
/Users/kghose/<ipython console> in <module>()
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5-py2.5-macosx-10.3.egg/pylab.py
in <module>()
----> 1 from matplotlib.pylab import *
2 import matplotlib.pylab
3 __doc__ = matplotlib.pylab.__doc__
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5-py2.5-macosx-10.3.egg/matplotlib/pylab.py
in <module>()
204 from numpy import ma
205
--> 206 from matplotlib import mpl # pulls in most modules
207
208 from matplotlib.dates import date2num, num2date,\
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5-py2.5-macosx-10.3.egg/matplotlib/mpl.py
in <module>()
2 from matplotlib import axis
----> 3 from matplotlib import axes
4 from matplotlib import cbook
5 from matplotlib import collections
6 from matplotlib import colors
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5-py2.5-macosx-10.3.egg/matplotlib/axes.py
in <module>()
16 import matplotlib.dates as mdates
17 import matplotlib.font_manager as font_manager
---> 18 import matplotlib.image as mimage
19 import matplotlib.legend as mlegend
20 import matplotlib.lines as mlines
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5-py2.5-macosx-10.3.egg/matplotlib/image.py
in <module>()
17 # For clarity, names from _image are given explicitly in this module:
18 from matplotlib import _image
---> 19 from matplotlib import _png
20
21 # For user convenience, the names from _image are also imported into
ImportError:
dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5-py2.5-macosx-10.3.egg/matplotlib/_png.so,
2): Library not loaded: /usr/local/lib/libpng12.0.dylib
Referenced from:
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5-py2.5-macosx-10.3.egg/matplotlib/_png.so
Reason: image not found
In [2]:
|
|
From: Jörgen S. <jor...@bo...> - 2008-12-12 18:58:06
|
Jouni K. Seppänen skrev: > Michael Droettboom <md...@st...> writes: > >> Jörgen Stenarson wrote: >>> I tried to use usetex to generate my pdf figures but I got a crash >>> when saving the figure, log attached. I traced the crash to >>> find_tex_file(), apparently ' can not be used to quote filenames in >>> the windows shell it has to be ". In my patch I just changed it to >>> always use " I don't know if that works on other systems. >> Someone who knows about usetex should review and apply this patch. > > In Unix shells ' is the better quoting character because all sorts of > things have special meaning within " characters... but I changed it to > use subprocess.Popen instead, so we shouldn't need to worry about shell > quoting at all. > > Jörgen: Thanks for your report, which I think is the first one from a > Windows user using usetex with the pdf backend. Can you check that the > latest version on the trunk works (either by updating from svn or by > applying the attached patch)? Have you run into any other problems? What > TeX distribution are you using? > It works from current svn. I'm running miktex2.7. I have seen some font mismatch problems but I'm not sure they are bugs. But I will get back to you on those. /Jörgen |
|
From: Mauro C. <mau...@gm...> - 2008-12-12 18:29:26
|
Dear Jeff, 2008/12/12 Jeff Whitaker <js...@fa...>: > Mauro: The image flipping looks to be a Wx backend bug - it doesn't happen > if you use WxAgg instead. Thank you very much. It works quite well with WxAgg. Incidentally, the WXAgg backend also provides for a slightly better and faster rendering (not of the Blue Marble itself, but of usual maps). > P.S. It's not recommended to use tabs in python code. Especially don't mix > tabs and spaces (http://www.python.org/dev/peps/pep-0008/). I do agree that tabs and spaces have *never* to be mixed. The mixing of tabs and spaces may be a misconfiguration of the IDE I use (DrPython). Have to check. With best regards, -- Dr. Mauro J. Cavalcanti Ecoinformatics Studio P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: mau...@gm... Web: http://studio.infobio.net Linux Registered User #473524 * Ubuntu User #22717 "Life is complex. It consists of real and imaginary parts." |
|
From: Michael D. <md...@st...> - 2008-12-12 15:48:55
|
We have just released a new version of matplotlib, available for download at https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194&release_id=646644 It is a simple bugfix release to fix a number of critical bugs found in 0.98.4. These "what's new" release notes, with graphs and links, are available in html at http://matplotlib.sourceforge.net/users/whats_new.html Thanks to Charlie Moad for testing and preparing the source release, including binaries for OS X and Windows for python 2.4 and 2.5 (2.6 and 3.0 will not be available until numpy is available on those releases). Thanks to the many developers who contributed to this release, with contributions from Jae-Joon Lee, Michael Droettboom, Ryan May, Eric Firing, Manuel Metz, Jouni K. Seppaenen, Jeff Whitaker, Darren Dale, David Kaplan, Michiel de Hoon and many others who submitted patches What's new in 0.98.5 ============================== It's only been a matter of days since 0.98.4, but there were a number of critical bugs that warranted a new release. 2008-12-11 Use subprocess.Popen instead of os.popen in dviread (Windows problem reported by Jorgen Stenarson) - JKS 2008-12-10 Added Michael's font_manager fix and Jae-Joon's figure/subplot fix. Bumped version number to 0.98.5 - JDH -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
|
From: Alan G I. <ai...@am...> - 2008-12-12 14:44:40
|
On 12/12/2008 7:48 AM Jeff Whitaker apparently wrote: > It's not recommended to use tabs in python code. That is project dependent. And a religious war. (Note that tabs have many advantages. E.g., explicit is better than implicit, and one tab is explicitly one level on indent.) > Especially don't mix tabs and spaces (http://www.python.org/dev/peps/pep-0008/). True enough. (For indenting.) Maybe PEP 666 should have been accepted. http://www.python.org/dev/peps/pep-0666/ Alan Isaac |