[Matplotlib-users] All kinds of issues inslalling basemap under Ubuntu 8.10 64bit [SEC=UNCLASSIFIED]
Greetings... I have been using basemap extensively to do presentation graphics under quite a wide variety of platforms but I got a new 64bit dual core laptop recently and have been having all kinds of problems installing it... I am using (K)ubuntu 8.10 and have tried to install it two ways... This is a 64bit system (1) using the pre-compiles libgeos 3.0.0: this is installed using the libgeos-dev package under ubuntu The package (seems) to install ok I then grab the latest source and do the usual python setup.py build jobbo and get a massive raft of errors eg: .. src/_proj.c:2353: error: '__pyx_kp_4' undeclared here (not in a function) src/_proj.c:2353: warning: excess elements in struct initializer src/_proj.c:2353: warning: (near initialization for '__pyx_string_tab[19]') src/_proj.c:2353: warning: excess elements in struct initializer src/_proj.c:2353: warning: (near initialization for '__pyx_string_tab[19]') src/_proj.c:2353: warning: excess elements in struct initializer .. .. src/_proj.c:3155: error: expected ')' before '*' token src/_proj.c:3170: error: expected ')' before '*' token src/_proj.c:3185: error: expected ')' before '*' token src/_proj.c:3200: error: expected ')' before '*' token src/_proj.c:3215: error: expected ')' before '*' token src/_proj.c:3230: error: expected ')' before '*' token error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Isrc -I/usr/lib/python2.5/site-packages/numpy/core/include -I/usr/include/python2.5 -c src/_proj.c -o build/temp.linux-x86_64-2.5/src/_proj.o" failed with exit status 1 (2) building libgeos from source... I get the same error for 2.2.3 (a version I have had no problems compiling on centos5 64bit machines in the past) and 3.0.0 make[3]: Entering directory `/home/scollis/geos-3.0.0/source/index/quadtree' if /bin/bash ../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../../../source/headers -I../../../source/headers/geos -I../../../source/headers -g -O2 -DGEOS_INLINE -Wall -ansi -pedantic -Wno-long-long -MT DoubleBits.lo -MD -MP -MF ".deps/DoubleBits.Tpo" -c -o DoubleBits.lo DoubleBits.cpp; \ then mv -f ".deps/DoubleBits.Tpo" ".deps/DoubleBits.Plo"; else rm -f ".deps/DoubleBits.Tpo"; exit 1; fi g++ -DHAVE_CONFIG_H -I. -I. -I../../../source/headers -I../../../source/headers/geos -I../../../source/headers -g -O2 -DGEOS_INLINE -Wall -ansi -pedantic -Wno-long-long -MT DoubleBits.lo -MD -MP -MF .deps/DoubleBits.Tpo -c DoubleBits.cpp -fPIC -DPIC -o .libs/DoubleBits.o DoubleBits.cpp: In static member function 'static double geos::index::quadtree::DoubleBits::powerOf2(int)': DoubleBits.cpp:51: error: 'memcpy' was not declared in this scope DoubleBits.cpp: In constructor 'geos::index::quadtree::DoubleBits::DoubleBits(double)': DoubleBits.cpp:94: error: 'memcpy' was not declared in this scope make[3]: *** [DoubleBits.lo] Error 1 make[3]: Leaving directory `/home/scollis/geos-3.0.0/source/index/quadtree' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/scollis/geos-3.0.0/source/index' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/scollis/geos-3.0.0/source' make: *** [all-recursive] Error 1 ANY help very very very welcome! I am some what at a loss as I have managed to compile both libgeos and basemap under much more "user unfriendly" distros before... Dr Scott Collis Postdoctoral Researcher Centre for Australian Weather and Climate Research (CAWCR) Atmosphere and Land Observation and Assessment Group Australian Bureau of Meteorology Room 9.57 Level 9 700 Collins Street Docklands 3008 Office: (03) 9669 4766 MB: 0412177550 http://www.bom.gov.au/bmrc/wefor/staff/scollis/ -- Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] All kinds of issues inslalling basemap under Ubuntu 8.10 64bit [SEC=UNCLASSIFIED]
Scott Collis wrote: > Greetings... > I have been using basemap extensively to do presentation graphics > under quite a wide variety of platforms but I got a new 64bit dual > core laptop recently and have been having all kinds of problems > installing it... > I am using (K)ubuntu 8.10 and have tried to install it two ways... > This is a 64bit system > (1) using the pre-compiles libgeos 3.0.0: > this is installed using the libgeos-dev package under ubuntu > The package (seems) to install ok > I then grab the latest source and do the usual python setup.py build jobbo > and get a massive raft of errors eg: > .. > src/_proj.c:2353: error: ‘__pyx_kp_4’ undeclared here (not in a function) > src/_proj.c:2353: warning: excess elements in struct initializer > src/_proj.c:2353: warning: (near initialization for > ‘__pyx_string_tab[19]’) > src/_proj.c:2353: warning: excess elements in struct initializer > src/_proj.c:2353: warning: (near initialization for > ‘__pyx_string_tab[19]’) > src/_proj.c:2353: warning: excess elements in struct initializer > .. > .. > src/_proj.c:3155: error: expected ‘)’ before ‘*’ token > src/_proj.c:3170: error: expected ‘)’ before ‘*’ token > src/_proj.c:3185: error: expected ‘)’ before ‘*’ token > src/_proj.c:3200: error: expected ‘)’ before ‘*’ token > src/_proj.c:3215: error: expected ‘)’ before ‘*’ token > src/_proj.c:3230: error: expected ‘)’ before ‘*’ token > error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv > -O2 -Wall -Wstrict-prototypes -fPIC -Isrc > -I/usr/lib/python2.5/site-packages/numpy/core/include > -I/usr/include/python2.5 -c src/_proj.c -o > build/temp.linux-x86_64-2.5/src/_proj.o" failed with exit status 1 > (2) building libgeos from source... > I get the same error for 2.2.3 (a version I have had no problems > compiling on centos5 64bit machines in the past) and 3.0.0 > make[3]: Entering directory > `/home/scollis/geos-3.0.0/source/index/quadtree' > if /bin/bash ../../../libtool --tag=CXX --mode=compile g++ > -DHAVE_CONFIG_H -I. -I. -I../../../source/headers > -I../../../source/headers/geos -I../../../source/headers -g -O2 > -DGEOS_INLINE -Wall -ansi -pedantic -Wno-long-long -MT DoubleBits.lo > -MD -MP -MF ".deps/DoubleBits.Tpo" -c -o DoubleBits.lo DoubleBits.cpp; \ > then mv -f ".deps/DoubleBits.Tpo" ".deps/DoubleBits.Plo"; else rm -f > ".deps/DoubleBits.Tpo"; exit 1; fi > g++ -DHAVE_CONFIG_H -I. -I. -I../../../source/headers > -I../../../source/headers/geos -I../../../source/headers -g -O2 > -DGEOS_INLINE -Wall -ansi -pedantic -Wno-long-long -MT DoubleBits.lo > -MD -MP -MF .deps/DoubleBits.Tpo -c DoubleBits.cpp -fPIC -DPIC -o > .libs/DoubleBits.o > DoubleBits.cpp: In static member function 'static double > geos::index::quadtree::DoubleBits::powerOf2(int)': > DoubleBits.cpp:51: error: 'memcpy' was not declared in this scope > DoubleBits.cpp: In constructor > 'geos::index::quadtree::DoubleBits::DoubleBits(double)': > DoubleBits.cpp:94: error: 'memcpy' was not declared in this scope > make[3]: *** [DoubleBits.lo] Error 1 > make[3]: Leaving directory > `/home/scollis/geos-3.0.0/source/index/quadtree' > make[2]: *** [all-recursive] Error 1 > make[2]: Leaving directory `/home/scollis/geos-3.0.0/source/index' > make[1]: *** [all-recursive] Error 1 > make[1]: Leaving directory `/home/scollis/geos-3.0.0/source' > make: *** [all-recursive] Error 1 > ANY help very very very welcome! I am some what at a loss as I have > managed to compile both libgeos and basemap under much more "user > unfriendly" distros before... > Dr Scott Collis > Postdoctoral Researcher > Centre for Australian Weather and Climate Research (CAWCR) > Atmosphere and Land Observation and Assessment Group > Australian Bureau of Meteorology Room 9.57 Level 9 700 Collins Street > Docklands 3008 > Office: (03) 9669 4766 > MB: 0412177550 > http://www.bom.gov.au/bmrc/wefor/staff/scollis/ > Scott: I don't think the error compiling _proj.c has anything to do with libgeos, my guess is it can't find Python.h - perhaps you have to install a python-dev package? The geos compile error (can't find "memcpy") suggest that all your C header files are not found (I think that function is in "string.h"), which suggests that you haven't installed all the necessary gcc packages. -Jeff -- Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] An issue with Basemap high resolution under Windows
Dear Jeff & ALL, A user just reported to me that he has found a problem when tryng to create a map using the "high" resolution option under MS-Windows. He is running Basemap version 0.99.1 with Python 2.5 (from the Enthought Python Distribution) and got the following error: "IOError: Unable to open boundary dataset file. Only the 'crude', 'low', 'intermediate' and 'high' resolution datasets are installed by default. If you are requesting a 'full' resolution dataset, you may need to download and install those files separately." It seems that the error appears when he attempts to use both the 'high' and 'full' resolutions (all the others work OK). I could not find any hint on this in the Basemap README file, and do not have a Windows box to be able to test it here. Would an upgrade to the latest Basemap version solve this issue? Thanks in advance for any assistance you can provide. With best regards, -- Dr. Mauro J. Cavalcanti Ecoinformatics Studio P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: [email protected] Web: http://studio.infobio.net Linux Registered User #473524 * Ubuntu User #22717 "Life is complex. It consists of real and imaginary parts." -- Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] updating image in wxpython gui...
Hi All: I'm very new to matplotlib, but it seems like a very powerful tool! I'm trying to write a wxpython GUI that displays an image from a data file that the user selected. I've looked at a bunch of examples, but can't seem to get it quite right. I've initialized the image to a buffer of zeros, but can never get it to display the new data! Any/all help & suggestions are greatly appreciated!!! I wrote a "setupPlot" method that is called in the init method of a wx.ScrolledWindow: def SetupPlot(self): self.figure = Figure() self.axes = self.figure.add_subplot(111) self.data = np.zeros((64,8800),float) self.myImage = self.axes.imshow(self.data,aspect=100,animated=True) self.canvas = FigureCanvas(self, -1, self.figure) self.sizer.Add(self.canvas,pos=(1,1)) self.add_toolbar() Here is my "onPaint" event: def OnPaint(self, event): self.canvas.draw() Finally, here is my "openFile" event: def OnOpenFileEvent(self,event): dlg = wx.FileDialog(self,"Open Channel data file...",os.getcwd(), style=wx.OPEN,wildcard=self.wildcard) if dlg.ShowModal() == wx.ID_OK: self.filename = dlg.GetPath() datatype = np.complex64 shape = (64,8800) fd = open(self.filename, 'rb') read_data = np.fromfile(file=fd, dtype=datatype).reshape(shape) x = abs(fftshift(read_data)) self.myImage.set_array(x) self.axes.draw_artist(self.myImage) self.canvas.blit() THANXS amb -- Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] An issue with Basemap high resolution under Windows
Mauro Cavalcanti wrote: > Dear Jeff & ALL, > > A user just reported to me that he has found a problem when tryng to > create a map using the "high" resolution option under MS-Windows. He > is running Basemap version 0.99.1 with Python 2.5 (from the Enthought > Python Distribution) and got the following error: > > "IOError: Unable to open boundary dataset file. Only the 'crude', > 'low', 'intermediate' and 'high' resolution datasets are installed by > default. If you are requesting a 'full' resolution dataset, you may > need to download and install those files separately." > > It seems that the error appears when he attempts to use both the > 'high' and 'full' resolutions (all the others work OK). > > I could not find any hint on this in the Basemap README file, and do > not have a Windows box to be able to test it here. > > Would an upgrade to the latest Basemap version solve this issue? > > Thanks in advance for any assistance you can provide. > > With best regards, > > Mauro: That appears to be a modification to Basemap made by the Enthought folks to save disk space. The installer provided on the matplotlib sourceforge site includes all the datasets. -Jeff -- Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] updating image in wxpython gui...
On Wed, Jan 7, 2009 at 7:57 AM, Lewis, Ambrose J. wrote: > Hi All: > > I'm very new to matplotlib, but it seems like a very powerful tool! > > I'm trying to write a wxpython GUI that displays an image from a data file > that the user selected. I've looked at a bunch of examples, but can't seem > to get it quite right. I've initialized the image to a buffer of zeros, but > can never get it to display the new data! > > Any/all help & suggestions are greatly appreciated!!! You might try simplifying the problem to see if it is matplotlib, your image data, your use of animation or wx. Ie, with *your* image data, can you get the image to update in the pylab shell In [1]: ax = subplot(111) In [2]: data = np.random.rand(10,5) In [3]: im = ax.imshow(data) In [4]: ax.figure.canvas.draw() In [5]: data2 = np.random.rand(10,5) In [6]: im.set_array(data2) In [7]: ax.figure.canvas.draw() If not, perhaps there is some massaging of the raw data that is needed. If that works, try taking the animation calls out of the loop (don't set the animated property, don't use draw_artist, don't use blit) but just set the image data and call canvas.draw() I did a quick read through of the code and did not find anything glaringly wrong, so you need to start simplifying the problem and reducing it to hone in on where the problem is occurring. If you post a free standing script that we can run , with the data, in all likelihood we can find the problem. You might even find it yourself in the process of developing a minimal script JDH -- Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [matplotlib-devel] What would you like to see in a book about Matplotlib?
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Great discussion.
I think this tangent indicates a need for a section to explain both the
history of pylab, matplotlib.pyplot, and how they relate. (I'm still
confused at what exactly the difference is.)
My perspective is that of a scientist doing numerical analysis who needs to
visualize computational results and compare it to experimental data. I
normally don't have time to get into the interesting computer science
essoterica: what I need are
- a toolkit of HOWTOs;
- a solid reference to the various classes and functions; and
- a comprehensive index.
I also echo the request for a consistency in style: e.g., always use the OO
style as a basis, *supplementing* (i.e., duplicating) with a MATLAB-style as
needed.
When doing dev and programming work in python, I find myself constantly
refering to Martelli's "Python in a Nutshell" (2nd ed., but often using the
index from the 1st ed. because it's soo much better). At times I also
find Martelli & Ascher's "Python Cookbook" invaluable. I think that a good
reference to functions with liberal use of code snippets, combined with a
chapter of short cookbook examples, would be most useful for the Matplotlib
book.
Tell the gent who floated you the proposal that I'm looking forward to
purchasing the book. Oh, and please hurry up with the publication!:-)
James
On Monday 05 January 2009 17:48:43 Christopher Barker wrote:
> Sandro Tosi wrote:
> > So you suggest to start from matplotlib.pyplot and not from pylab?
>
> actually, I think matpoltlib.pyplot still has all of pylab in it, just
> not all of numpy also. So yes, do that, but what I meant was to focus on
> using the OO interface, rather than the state machine interface:
>
> rather than 'gca', 'gcf', etc, store references to the figures and axis,
> etc:
>
> this kind of thing:
>
> fig = plt.Figure()
>
> ax = fig.add_subplot(111)
> ax.plot([1,2,3])
>
> ax.set_title('hi mom')
>
> ax.grid(True)
>
> ax.set_xlabel('time')
> ax.set_ylabel('volts')
>
> While we are at it, discourage the use of "import *" !
>
> -Chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQFJZMs1xOXthSHeGJIRAjFeAKC5vxJUaUfS+ePtyW2/ehBfL/GtRQCfVI63
WNT4U8fOaaLL5ijsi4JTz3g=
=SpGy
-END PGP SIGNATURE-
--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] All kinds of issues inslalling basemap under Ubuntu 8.10 64bit [SEC=UNCLASSIFIED]
Scott Collis wrote: > Greetings... > I have been using basemap extensively to do presentation graphics > under quite a wide variety of platforms but I got a new 64bit dual > core laptop recently and have been having all kinds of problems > installing it... > I am using (K)ubuntu 8.10 and have tried to install it two ways... > This is a 64bit system > (1) using the pre-compiles libgeos 3.0.0: > this is installed using the libgeos-dev package under ubuntu > The package (seems) to install ok > I then grab the latest source and do the usual python setup.py build jobbo > and get a massive raft of errors eg: > .. > src/_proj.c:2353: error: ‘__pyx_kp_4’ undeclared here (not in a function) > src/_proj.c:2353: warning: excess elements in struct initializer > src/_proj.c:2353: warning: (near initialization for > ‘__pyx_string_tab[19]’) > src/_proj.c:2353: warning: excess elements in struct initializer > src/_proj.c:2353: warning: (near initialization for > ‘__pyx_string_tab[19]’) > src/_proj.c:2353: warning: excess elements in struct initializer > .. > .. > src/_proj.c:3155: error: expected ‘)’ before ‘*’ token > src/_proj.c:3170: error: expected ‘)’ before ‘*’ token > src/_proj.c:3185: error: expected ‘)’ before ‘*’ token > src/_proj.c:3200: error: expected ‘)’ before ‘*’ token > src/_proj.c:3215: error: expected ‘)’ before ‘*’ token > src/_proj.c:3230: error: expected ‘)’ before ‘*’ token > error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv > -O2 -Wall -Wstrict-prototypes -fPIC -Isrc > -I/usr/lib/python2.5/site-packages/numpy/core/include > -I/usr/include/python2.5 -c src/_proj.c -o > build/temp.linux-x86_64-2.5/src/_proj.o" failed with exit status 1 > (2) building libgeos from source... > I get the same error for 2.2.3 (a version I have had no problems > compiling on centos5 64bit machines in the past) and 3.0.0 > make[3]: Entering directory > `/home/scollis/geos-3.0.0/source/index/quadtree' > if /bin/bash ../../../libtool --tag=CXX --mode=compile g++ > -DHAVE_CONFIG_H -I. -I. -I../../../source/headers > -I../../../source/headers/geos -I../../../source/headers -g -O2 > -DGEOS_INLINE -Wall -ansi -pedantic -Wno-long-long -MT DoubleBits.lo > -MD -MP -MF ".deps/DoubleBits.Tpo" -c -o DoubleBits.lo DoubleBits.cpp; \ > then mv -f ".deps/DoubleBits.Tpo" ".deps/DoubleBits.Plo"; else rm -f > ".deps/DoubleBits.Tpo"; exit 1; fi > g++ -DHAVE_CONFIG_H -I. -I. -I../../../source/headers > -I../../../source/headers/geos -I../../../source/headers -g -O2 > -DGEOS_INLINE -Wall -ansi -pedantic -Wno-long-long -MT DoubleBits.lo > -MD -MP -MF .deps/DoubleBits.Tpo -c DoubleBits.cpp -fPIC -DPIC -o > .libs/DoubleBits.o > DoubleBits.cpp: In static member function 'static double > geos::index::quadtree::DoubleBits::powerOf2(int)': > DoubleBits.cpp:51: error: 'memcpy' was not declared in this scope > DoubleBits.cpp: In constructor > 'geos::index::quadtree::DoubleBits::DoubleBits(double)': > DoubleBits.cpp:94: error: 'memcpy' was not declared in this scope > make[3]: *** [DoubleBits.lo] Error 1 > make[3]: Leaving directory > `/home/scollis/geos-3.0.0/source/index/quadtree' > make[2]: *** [all-recursive] Error 1 > make[2]: Leaving directory `/home/scollis/geos-3.0.0/source/index' > make[1]: *** [all-recursive] Error 1 > make[1]: Leaving directory `/home/scollis/geos-3.0.0/source' > make: *** [all-recursive] Error 1 > ANY help very very very welcome! I am some what at a loss as I have > managed to compile both libgeos and basemap under much more "user > unfriendly" distros before... Scott: Could you try this modification to DoubleBits.cpp and let me know if it fixes the geos-2.2.3 compilation? I think you must be using gcc 4.3, which is much pickier than earlier versions about such things. Index: source/index/quadtree/DoubleBits.cpp === --- source/index/quadtree/DoubleBits.cpp (revision 6729) +++ source/index/quadtree/DoubleBits.cpp (working copy) @@ -15,6 +15,7 @@ #include #include +#include #include Thanks, -Jeff > Dr Scott Collis > Postdoctoral Researcher > Centre for Australian Weather and Climate Research (CAWCR) > Atmosphere and Land Observation and Assessment Group > Australian Bureau of Meteorology Room 9.57 Level 9 700 Collins Street > Docklands 3008 > Office: (03) 9669 4766 > MB: 0412177550 > http://www.bom.gov.au/bmrc/wefor/staff/scollis/ > > > -- > Check out the new SourceForge.net Marketplace. > It is the best place to buy or sell services for > just about anything Open Source. > http://p.sf.net/sfu/Xq1LFB > > > ___ > Matplotlib-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/matplotlib-user
Re: [Matplotlib-users] An issue with Basemap high resolution under Windows
Dear Jeff, Thanks. I advised the user to download the latest version of Basemap from the SF site and perfom an upgrade. Hope this may fix the problem. Best regards, 2009/1/7 Jeff Whitaker : > Mauro Cavalcanti wrote: >> >> Dear Jeff & ALL, >> >> A user just reported to me that he has found a problem when tryng to >> create a map using the "high" resolution option under MS-Windows. He >> is running Basemap version 0.99.1 with Python 2.5 (from the Enthought >> Python Distribution) and got the following error: >> >> "IOError: Unable to open boundary dataset file. Only the 'crude', >> 'low', 'intermediate' and 'high' resolution datasets are installed by >> default. If you are requesting a 'full' resolution dataset, you may >> need to download and install those files separately." >> >> It seems that the error appears when he attempts to use both the >> 'high' and 'full' resolutions (all the others work OK). >> >> I could not find any hint on this in the Basemap README file, and do >> not have a Windows box to be able to test it here. >> >> Would an upgrade to the latest Basemap version solve this issue? >> >> Thanks in advance for any assistance you can provide. >> >> With best regards, >> >> > > Mauro: That appears to be a modification to Basemap made by the Enthought > folks to save disk space. The installer provided on the matplotlib > sourceforge site includes all the datasets. > -Jeff > -- Dr. Mauro J. Cavalcanti Ecoinformatics Studio P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: [email protected] Web: http://studio.infobio.net Linux Registered User #473524 * Ubuntu User #22717 "Life is complex. It consists of real and imaginary parts." -- Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Switching between different font settings
"Johan Ekh" writes:
> I am trying to use helvetica and yes, text(r'$1+2+3={}$1+2+3') gives me
> helvetica for the non math mode case.
> But how do I get math mode to use the same font?
You can't. The problem is that while Helvetica contains all the usual
letters and numbers, TeX math fonts must include Greek letters and a
variety of symbols. (There exists a commercial Helvetica-like math font
called HV Math from Micropress Inc.)
Instead of getting math mode to use Helvetica, you want to make the tick
labels use text mode. I don't think there is existing support for that
in Matplotlib, but take a look at the Formatter classes in ticker.py -
if the functionality of OldScalarFormatter is enough for you, use that,
otherwise you'll have to hack ScalarFormatter to do what you want. If
you want the labels to look like they do right now except for the font
of the numbers, I think you could just wrap every number in
\textsf{...}, but there could be problems with spacing.
> I've tried to set 'mathtext.rm': 'sans-serif' in my params dict
The mathtext options have no effect in usetex mode - everything gets
rendered by TeX.
--
Jouni K. Seppänen
http://www.iki.fi/jks
--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Tick formatting
Hello,
Using the following simple script, the scientific notation used on the
y-axis is missing a multiplication symbol, as seen in the figure. My
matplotlibrc file consists of
backend : GTKAgg
and I am using SVN r6760.
I found this when I was trying to change the ScalarFormatter to have
useMathText = True by default, so the scientific notation would use a
superscript and not '1e7'.
Paul Novak
---
import matplotlib.pyplot as plt
import numpy as np
t = np.arange(0.0, 4.0)
s = 2.0e7*t
plt.plot(t, s, linewidth=1.0)
plt.xlabel(r'time (s)')
plt.ylabel('voltage (mV)')
plt.show()
<>--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Tick formatting
I think this is just historical, since matplotlib never used to rely on
having proper Unicode character rendering in all backends. (And
displaying a multiplication symbol, rather than just * or x requires
non-ascii). I believe that is no longer a problem these days, so we
could change it to display a multiplication symbol.
This doesn't appear to be a regression from an earlier version. Was
that what you're implying?
All that said, this raises another question -- we should probably make
it easier to set useMathText to True in the ScalarFormatter, either
through an rcParam or a kwarg somewhere. As it stands, it appears
(unless my grepping search has been wrong) the only way to get this
behavior is by modifying the matplotlib source. Not ideal ;)
Mike
Paul Novak wrote:
> Hello,
>
> Using the following simple script, the scientific notation used on the
> y-axis is missing a multiplication symbol, as seen in the figure. My
> matplotlibrc file consists of
>
> backend : GTKAgg
>
> and I am using SVN r6760.
>
> I found this when I was trying to change the ScalarFormatter to have
> useMathText = True by default, so the scientific notation would use a
> superscript and not '1e7'.
>
> Paul Novak
>
> ---
> import matplotlib.pyplot as plt
> import numpy as np
>
> t = np.arange(0.0, 4.0)
> s = 2.0e7*t
> plt.plot(t, s, linewidth=1.0)
>
> plt.xlabel(r'time (s)')
> plt.ylabel('voltage (mV)')
> plt.show()
>
>
>
>
>
>
> --
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
>
>
> ___
> Matplotlib-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Two bugs when plotting date/time histograms
Hi!
Below is a sample program. It demonstrates two bugs when plotting date/
time histograms.
1. When the y scale is made "log", the histogram points plot as
lines, but when the y scale is not log, they histogram plots as bars.
I do not think that the look of the bars should change depending on
whether or not the Y scale is logarithmic.
2. When the "agg.pdf" is removed, specifying "log" for the yscale
produces a TypeError on the mac (see below)
I would really like to know how to plot a histogram with real
bars ,rather than little lines.
Thanks!
import matplotlib
matplotlib.use('agg.pdf')
if __name__=="__main__":
import datetime
import numpy as np
import matplotlib
import matplotlib.pyplot as pyplot
import matplotlib.dates as mdates
import matplotlib.mlab as mlab
dates_and_counts = [[datetime.datetime(90,i,1), i*10] for i in
range(1,13)]
dates, counts = zip(*dates_and_counts)
years= mdates.YearLocator() # every year
months = mdates.MonthLocator() # every month
yearsFmt = mdates.DateFormatter('%Y')
fig = pyplot.figure()
ax = fig.add_subplot(111)
ax.bar(dates,counts)
ax.set_ylabel('file count')
ax.set_xlabel('file modification time (mtime)')
ax.set_yscale('log')
ax.xaxis.set_major_locator(years)
ax.xaxis.set_major_formatter(yearsFmt)
datemin = datetime.date(min(dates).year, 1, 1)
datemax = datetime.date(max(dates).year, 1, 1)
ax.set_xlim(datemin, datemax)
ax.set_ylim(0,max(counts))
# format the coords message box
def price(x): return '$%1.2f'%x
ax.format_xdata = mdates.DateFormatter('%Y-%m-%d')
ax.format_ydata = price
ax.grid(True)
# rotates and right aligns the x labels, and moves the bottom of the
# axes up to make room for them
fig.autofmt_xdate()
pyplot.savefig("hist.pdf",format='pdf')
12:12 PM m:~$ python f.py
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/matplotlib/figure.py", line 772, in draw
for a in self.axes: a.draw(renderer)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/matplotlib/axes.py", line 1601, in draw
a.draw(renderer)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/matplotlib/axis.py", line 710, in draw
tick.draw(renderer)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/matplotlib/axis.py", line 193, in draw
self.label1.draw(renderer)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/matplotlib/text.py", line 502, in draw
ismath=ismath)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/matplotlib/backends/backend_macosx.py", line
120, in draw_text
self._draw_mathtext(gc, x, y, s, prop, angle)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/matplotlib/backends/backend_macosx.py", line
112, in _draw_mathtext
gc.draw_mathtext(x, y, angle, 255 - image.as_array())
TypeError: image has incorrect type (should be uint8)
12:12 PM m:~$ %
V/r,
Simson Garfinkel
--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Two bugs when plotting date/time histograms
Simson Garfinkel wrote:
>
> import matplotlib
> matplotlib.use('agg.pdf')
Simson,
Sorry to be addressing a side point, not your real questions, but your
example shows up a bug in matplotlib.use, which I will fix shortly.
There is an agg backend, and there is a pdf backend, but there is no
agg.pdf. You are simply getting the agg backend, and when you save the
figure you are using the pdf backend, which is fine. Only the cairo
backend has "sub-backends" or versions, like "cairo.pdf" or "cairo.png"
or "cairo.ps" or "cairo.svg".
Eric
--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] All kinds of issues inslalling basemap under Ubuntu 8.10 64bit [SEC=UNCLASSIFIED]
Thanks Jeff or all your help (and Scott too... and all the people that have posted to this list over the years... it is an amazing source of information... A great example of why open source works so well for those in the scientific community) Jeff's libgeos mod worked... after some massaging.. I needed to put #include in: ../source/io/StringTokenizer.cpp ../source/io/ByteOrderValues.cpp ../source/capi/geos_c.cpp (and #include must be retained) ../source/io/markup/MarkupSTL.cpp (also inserted #include ) ../source/io/markup/MarkupSTL.h libgeos then compiled and I was able install basemap (tested by running the garp.py example...) fingers crossed the rest of my code works.. As noted it seems to be an issue with gcc4.3 requiring more explicit coding... Dr Scott Collis Postdoctoral Researcher Centre for Australian Weather and Climate Research (CAWCR) Atmosphere and Land Observation and Assessment Group Australian Bureau of Meteorology Room 9.57 Level 9 700 Collins Street Docklands 3008 Office: (03) 9669 4766 MB: 0412177550 http://www.bom.gov.au/bmrc/wefor/staff/scollis/ From: Jeff Whitaker [mailto:[email protected]] Sent: Thu 8/01/2009 3:16 AM To: Scott Collis Cc: [email protected] Subject: Re: [Matplotlib-users] All kinds of issues inslalling basemap under Ubuntu 8.10 64bit [SEC=UNCLASSIFIED] Scott Collis wrote: > Greetings... > I have been using basemap extensively to do presentation graphics > under quite a wide variety of platforms but I got a new 64bit dual > core laptop recently and have been having all kinds of problems > installing it... > I am using (K)ubuntu 8.10 and have tried to install it two ways... > This is a 64bit system > (1) using the pre-compiles libgeos 3.0.0: > this is installed using the libgeos-dev package under ubuntu > The package (seems) to install ok > I then grab the latest source and do the usual python setup.py build jobbo > and get a massive raft of errors eg: > .. > src/_proj.c:2353: error: '__pyx_kp_4' undeclared here (not in a function) > src/_proj.c:2353: warning: excess elements in struct initializer > src/_proj.c:2353: warning: (near initialization for > '__pyx_string_tab[19]') > src/_proj.c:2353: warning: excess elements in struct initializer > src/_proj.c:2353: warning: (near initialization for > '__pyx_string_tab[19]') > src/_proj.c:2353: warning: excess elements in struct initializer > .. > .. > src/_proj.c:3155: error: expected ')' before '*' token > src/_proj.c:3170: error: expected ')' before '*' token > src/_proj.c:3185: error: expected ')' before '*' token > src/_proj.c:3200: error: expected ')' before '*' token > src/_proj.c:3215: error: expected ')' before '*' token > src/_proj.c:3230: error: expected ')' before '*' token > error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv > -O2 -Wall -Wstrict-prototypes -fPIC -Isrc > -I/usr/lib/python2.5/site-packages/numpy/core/include > -I/usr/include/python2.5 -c src/_proj.c -o > build/temp.linux-x86_64-2.5/src/_proj.o" failed with exit status 1 > (2) building libgeos from source... > I get the same error for 2.2.3 (a version I have had no problems > compiling on centos5 64bit machines in the past) and 3.0.0 > make[3]: Entering directory > `/home/scollis/geos-3.0.0/source/index/quadtree' > if /bin/bash ../../../libtool --tag=CXX --mode=compile g++ > -DHAVE_CONFIG_H -I. -I. -I../../../source/headers > -I../../../source/headers/geos -I../../../source/headers -g -O2 > -DGEOS_INLINE -Wall -ansi -pedantic -Wno-long-long -MT DoubleBits.lo > -MD -MP -MF ".deps/DoubleBits.Tpo" -c -o DoubleBits.lo DoubleBits.cpp; \ > then mv -f ".deps/DoubleBits.Tpo" ".deps/DoubleBits.Plo"; else rm -f > ".deps/DoubleBits.Tpo"; exit 1; fi > g++ -DHAVE_CONFIG_H -I. -I. -I../../../source/headers > -I../../../source/headers/geos -I../../../source/headers -g -O2 > -DGEOS_INLINE -Wall -ansi -pedantic -Wno-long-long -MT DoubleBits.lo > -MD -MP -MF .deps/DoubleBits.Tpo -c DoubleBits.cpp -fPIC -DPIC -o > .libs/DoubleBits.o > DoubleBits.cpp: In static member function 'static double > geos::index::quadtree::DoubleBits::powerOf2(int)': > DoubleBits.cpp:51: error: 'memcpy' was not declared in this scope > DoubleBits.cpp: In constructor > 'geos::index::quadtree::DoubleBits::DoubleBits(double)': > DoubleBits.cpp:94: error: 'memcpy' was not declared in this scope > make[3]: *** [DoubleBits.lo] Error 1 > make[3]: Leaving directory > `/home/scollis/geos-3.0.0/source/index/quadtree' > make[2]: *** [all-recursive] Error 1 > make[2]: Leaving directory `/home/scollis/geos-3.0.0/source/index' > make[1]: *** [all-recursive] Error 1 > make[1]: Leaving directory `/home/scollis/geos-3.0.0/source' > make: *** [all-recursive] Error 1 > ANY help very very very welcome! I am some what at a loss as I have > managed to compile both libgeos and basemap under much more "user > unfriendly" distros before... Scott: Could you try this modification to DoubleBits.cpp and let me
Re: [Matplotlib-users] Tick formatting
I don't think this is a regression; I guess what I was looking for was
an rcParam or a kwarg to set useMathText. Would it make sense to set
useMathText=True by default?
Thanks,
Paul
Michael Droettboom wrote:
> I think this is just historical, since matplotlib never used to rely on
> having proper Unicode character rendering in all backends. (And
> displaying a multiplication symbol, rather than just * or x requires
> non-ascii). I believe that is no longer a problem these days, so we
> could change it to display a multiplication symbol.
>
> This doesn't appear to be a regression from an earlier version. Was
> that what you're implying?
>
> All that said, this raises another question -- we should probably make
> it easier to set useMathText to True in the ScalarFormatter, either
> through an rcParam or a kwarg somewhere. As it stands, it appears
> (unless my grepping search has been wrong) the only way to get this
> behavior is by modifying the matplotlib source. Not ideal ;)
>
> Mike
>
> Paul Novak wrote:
>> Hello,
>>
>> Using the following simple script, the scientific notation used on the
>> y-axis is missing a multiplication symbol, as seen in the figure. My
>> matplotlibrc file consists of
>>
>> backend : GTKAgg
>>
>> and I am using SVN r6760.
>>
>> I found this when I was trying to change the ScalarFormatter to have
>> useMathText = True by default, so the scientific notation would use a
>> superscript and not '1e7'.
>>
>> Paul Novak
>>
>> ---
>> import matplotlib.pyplot as plt
>> import numpy as np
>>
>> t = np.arange(0.0, 4.0)
>> s = 2.0e7*t
>> plt.plot(t, s, linewidth=1.0)
>>
>> plt.xlabel(r'time (s)')
>> plt.ylabel('voltage (mV)')
>> plt.show()
>>
--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Two bugs when plotting date/time histograms
Eric,
Thanks for addressing the side-issue. If there were a simple way to
list all of the backends, that might help?
Any idea about the main point?
On Jan 7, 2009, at 12:52 PM, Eric Firing wrote:
> Simson Garfinkel wrote:
>
>> import matplotlib
>> matplotlib.use('agg.pdf')
>
> Simson,
>
> Sorry to be addressing a side point, not your real questions, but
> your example shows up a bug in matplotlib.use, which I will fix
> shortly. There is an agg backend, and there is a pdf backend, but
> there is no agg.pdf. You are simply getting the agg backend, and
> when you save the figure you are using the pdf backend, which is
> fine. Only the cairo backend has "sub-backends" or versions, like
> "cairo.pdf" or "cairo.png" or "cairo.ps" or "cairo.svg".
>
> Eric
>
--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
