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
(10) |
2
(17) |
3
(14) |
4
(28) |
5
(23) |
6
(12) |
7
(3) |
8
(11) |
9
(29) |
10
(31) |
11
(9) |
12
(35) |
13
(3) |
14
(9) |
15
(16) |
16
(14) |
17
(10) |
18
(7) |
19
(3) |
20
|
21
(4) |
22
(6) |
23
(14) |
24
(16) |
25
(10) |
26
(5) |
27
(4) |
28
(8) |
29
(19) |
30
(21) |
|
|
|
|
From: Tommy G. <tg...@ma...> - 2009-06-30 23:54:41
|
That is what I was assuming, but it still seems a little odd that matplotlib generates that large of a memory footprint. Loading the fits file into the program using pyfits, with the code only uses 19MB of real memory and 600MB of virtual memory (strangly adding the line img = hdu[1].data, increases this to 208MB/800MB). Displaying images of various sizes I get these numbers from Activity Monitor Size Real Mem Virtual 3k x 3k 0.68GB 1.57GB 4k x 4k 0.92GB 1.80GB 5k x 5k 1.20GB 2.10GB 5.5k x 5.5k 1.38GB 2.28GB And the limit seems to be somewhere just above 5.5k by 5.5k (darn :( ) Cheers Tommy On Jun 30, 2009, at 7:27 PM, Perry Greenfield wrote: > Because the image is so large, and matplotlib carries out various > operations on the image (scaling, resampling, etc), it uses a lot of > memory. This is one area where a specialized display program will be > more efficient. If you need to use matplotlib, decide whether you > really only want to display a subsection, or only need a lower > resolution version (e.g., boxcar smooth and subsample) before > displaying. I've found that image sizes well over 1kx1k can take > some time to display, and those that are much larger can cause you > to run out of memory. At least, that's what I think is happening. > > Perry > > On Jun 30, 2009, at 7:20 PM, Tommy Grav wrote: > >> I am trying to use imshow to plot some semi-large fits images. >> Here is the code: >> >> from math import * >> import numpy as np >> from matplotlib import pyplot as plt >> from matplotlib import cm as cm >> import pyfits >> >> cat = "/Volumes/Sweden/PS1SC/Data/PS20090603-3/MD09/skycell.092/" >> fname = "o4985g0263o.warp.MD09.skycell.092" >> >> hdu = pyfits.open(cat+fname+".fits") >> print hdu.info() >> img = hdu[1].data.astype("int") >> >> plt.figure(figsize=[12,12]) >> plt.imshow(img,cmap=cm.cool) >> plt.savefig("test.png") >> >> Which gives the result: >> >> Filename: /Volumes/Sweden/PS1SC/Data/PS20090603-3/MD09/skycell.092/ >> o4985g0263o.warp.MD09.skycell.092.fits >> No. Name Type Cards Dimensions Format >> 0 PRIMARY PrimaryHDU 6 () int16 >> 1 CompImageHDU 101 (6000, 6000) float32 >> None >> Python(23117,0xa04f2720) malloc: *** mmap(size=1152000000) failed >> (error code=12) >> *** error: can't allocate region >> *** set a breakpoint in malloc_error_break to debug >> Traceback (most recent call last): >> File "quick_look.py", line 16, in <module> >> plt.savefig("test.png") >> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ >> python2.5/site-packages/matplotlib/pyplot.py", line 345, in savefig >> return fig.savefig(*args, **kwargs) >> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ >> python2.5/site-packages/matplotlib/figure.py", line 990, in savefig >> self.canvas.print_figure(*args, **kwargs) >> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ >> python2.5/site-packages/matplotlib/backend_bases.py", line 1419, in >> print_figure >> **kwargs) >> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ >> python2.5/site-packages/matplotlib/backends/backend_agg.py", line >> 323, >> in print_png >> FigureCanvasAgg.draw(self) >> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ >> python2.5/site-packages/matplotlib/backends/backend_agg.py", line >> 279, >> in draw >> self.figure.draw(self.renderer) >> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ >> python2.5/site-packages/matplotlib/figure.py", line 772, in draw >> for a in self.axes: a.draw(renderer) >> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ >> python2.5/site-packages/matplotlib/axes.py", line 1545, in draw >> im.draw(renderer) >> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ >> python2.5/site-packages/matplotlib/image.py", line 233, in draw >> im = self.make_image(renderer.get_image_magnification()) >> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ >> python2.5/site-packages/matplotlib/image.py", line 180, in make_image >> x = self.to_rgba(self._A, self._alpha) >> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ >> python2.5/site-packages/matplotlib/cm.py", line 79, in to_rgba >> x = self.cmap(x, alpha=alpha, bytes=bytes) >> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ >> python2.5/site-packages/matplotlib/colors.py", line 501, in __call__ >> rgba = np.empty(shape=xa.shape+(4,), dtype=lut.dtype) >> MemoryError >> >> I found the earlier thread of http://www.mail-archive.com/mat...@li.../msg11216.html >> but that didn't seem to produce any fixes or good explanations. >> >> I am on a Mac Pro Intel machine running 10.5.7 and >> [Heimdall:tgrav ~/Work/myCode/Python/pyPS1SC]> python >> ActivePython 2.5.4.3 (ActiveState Software Inc.) based on >> Python 2.5.4 (r254:67916, Jan 20 2009, 14:11:42) >> [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin >> Type "help", "copyright", "credits" or "license" for more >> information. >>>>> import numpy >>>>> numpy.__version__ >> '1.3.0rc2' >>>>> import pyfits >>>>> pyfits.__version__ >> '2.1.1dev462' >>>>> import matplotlib >>>>> matplotlib.__version__ >> '0.98.5.2' >>>>> >> >> Cheers >> Tommy >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Perry G. <pe...@st...> - 2009-06-30 23:27:17
|
Because the image is so large, and matplotlib carries out various operations on the image (scaling, resampling, etc), it uses a lot of memory. This is one area where a specialized display program will be more efficient. If you need to use matplotlib, decide whether you really only want to display a subsection, or only need a lower resolution version (e.g., boxcar smooth and subsample) before displaying. I've found that image sizes well over 1kx1k can take some time to display, and those that are much larger can cause you to run out of memory. At least, that's what I think is happening. Perry On Jun 30, 2009, at 7:20 PM, Tommy Grav wrote: > I am trying to use imshow to plot some semi-large fits images. > Here is the code: > > from math import * > import numpy as np > from matplotlib import pyplot as plt > from matplotlib import cm as cm > import pyfits > > cat = "/Volumes/Sweden/PS1SC/Data/PS20090603-3/MD09/skycell.092/" > fname = "o4985g0263o.warp.MD09.skycell.092" > > hdu = pyfits.open(cat+fname+".fits") > print hdu.info() > img = hdu[1].data.astype("int") > > plt.figure(figsize=[12,12]) > plt.imshow(img,cmap=cm.cool) > plt.savefig("test.png") > > Which gives the result: > > Filename: /Volumes/Sweden/PS1SC/Data/PS20090603-3/MD09/skycell.092/ > o4985g0263o.warp.MD09.skycell.092.fits > No. Name Type Cards Dimensions Format > 0 PRIMARY PrimaryHDU 6 () int16 > 1 CompImageHDU 101 (6000, 6000) float32 > None > Python(23117,0xa04f2720) malloc: *** mmap(size=1152000000) failed > (error code=12) > *** error: can't allocate region > *** set a breakpoint in malloc_error_break to debug > Traceback (most recent call last): > File "quick_look.py", line 16, in <module> > plt.savefig("test.png") > File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ > python2.5/site-packages/matplotlib/pyplot.py", line 345, in savefig > return fig.savefig(*args, **kwargs) > File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ > python2.5/site-packages/matplotlib/figure.py", line 990, in savefig > self.canvas.print_figure(*args, **kwargs) > File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ > python2.5/site-packages/matplotlib/backend_bases.py", line 1419, in > print_figure > **kwargs) > File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ > python2.5/site-packages/matplotlib/backends/backend_agg.py", line 323, > in print_png > FigureCanvasAgg.draw(self) > File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ > python2.5/site-packages/matplotlib/backends/backend_agg.py", line 279, > in draw > self.figure.draw(self.renderer) > File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ > python2.5/site-packages/matplotlib/figure.py", line 772, in draw > for a in self.axes: a.draw(renderer) > File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ > python2.5/site-packages/matplotlib/axes.py", line 1545, in draw > im.draw(renderer) > File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ > python2.5/site-packages/matplotlib/image.py", line 233, in draw > im = self.make_image(renderer.get_image_magnification()) > File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ > python2.5/site-packages/matplotlib/image.py", line 180, in make_image > x = self.to_rgba(self._A, self._alpha) > File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ > python2.5/site-packages/matplotlib/cm.py", line 79, in to_rgba > x = self.cmap(x, alpha=alpha, bytes=bytes) > File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ > python2.5/site-packages/matplotlib/colors.py", line 501, in __call__ > rgba = np.empty(shape=xa.shape+(4,), dtype=lut.dtype) > MemoryError > > I found the earlier thread of http://www.mail-archive.com/mat...@li.../msg11216.html > but that didn't seem to produce any fixes or good explanations. > > I am on a Mac Pro Intel machine running 10.5.7 and > [Heimdall:tgrav ~/Work/myCode/Python/pyPS1SC]> python > ActivePython 2.5.4.3 (ActiveState Software Inc.) based on > Python 2.5.4 (r254:67916, Jan 20 2009, 14:11:42) > [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin > Type "help", "copyright", "credits" or "license" for more information. >>>> import numpy >>>> numpy.__version__ > '1.3.0rc2' >>>> import pyfits >>>> pyfits.__version__ > '2.1.1dev462' >>>> import matplotlib >>>> matplotlib.__version__ > '0.98.5.2' >>>> > > Cheers > Tommy > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Tommy G. <tg...@ma...> - 2009-06-30 23:20:33
|
I am trying to use imshow to plot some semi-large fits images. Here is the code: from math import * import numpy as np from matplotlib import pyplot as plt from matplotlib import cm as cm import pyfits cat = "/Volumes/Sweden/PS1SC/Data/PS20090603-3/MD09/skycell.092/" fname = "o4985g0263o.warp.MD09.skycell.092" hdu = pyfits.open(cat+fname+".fits") print hdu.info() img = hdu[1].data.astype("int") plt.figure(figsize=[12,12]) plt.imshow(img,cmap=cm.cool) plt.savefig("test.png") Which gives the result: Filename: /Volumes/Sweden/PS1SC/Data/PS20090603-3/MD09/skycell.092/ o4985g0263o.warp.MD09.skycell.092.fits No. Name Type Cards Dimensions Format 0 PRIMARY PrimaryHDU 6 () int16 1 CompImageHDU 101 (6000, 6000) float32 None Python(23117,0xa04f2720) malloc: *** mmap(size=1152000000) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug Traceback (most recent call last): File "quick_look.py", line 16, in <module> plt.savefig("test.png") File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/pyplot.py", line 345, in savefig return fig.savefig(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/figure.py", line 990, in savefig self.canvas.print_figure(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/backend_bases.py", line 1419, in print_figure **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/backends/backend_agg.py", line 323, in print_png FigureCanvasAgg.draw(self) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/backends/backend_agg.py", line 279, in draw self.figure.draw(self.renderer) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/figure.py", line 772, in draw for a in self.axes: a.draw(renderer) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/axes.py", line 1545, in draw im.draw(renderer) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/image.py", line 233, in draw im = self.make_image(renderer.get_image_magnification()) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/image.py", line 180, in make_image x = self.to_rgba(self._A, self._alpha) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/cm.py", line 79, in to_rgba x = self.cmap(x, alpha=alpha, bytes=bytes) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/colors.py", line 501, in __call__ rgba = np.empty(shape=xa.shape+(4,), dtype=lut.dtype) MemoryError I found the earlier thread of http://www.mail-archive.com/mat...@li.../msg11216.html but that didn't seem to produce any fixes or good explanations. I am on a Mac Pro Intel machine running 10.5.7 and [Heimdall:tgrav ~/Work/myCode/Python/pyPS1SC]> python ActivePython 2.5.4.3 (ActiveState Software Inc.) based on Python 2.5.4 (r254:67916, Jan 20 2009, 14:11:42) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import numpy >>> numpy.__version__ '1.3.0rc2' >>> import pyfits >>> pyfits.__version__ '2.1.1dev462' >>> import matplotlib >>> matplotlib.__version__ '0.98.5.2' >>> Cheers Tommy |
From: Alan G I. <ala...@gm...> - 2009-06-30 22:21:40
|
On 6/30/2009 5:42 PM ms apparently wrote: > I am writing a script that uses pyplot.show() to show a plot, on which > the user has to ponder and decide a course of action (telling the script > what to do on a raw_input). This is not how `show` is used. But you could save the plot as a temporary file and open it in a viewer. Or build a GUI for the user to interact with: http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_tk.html Alan Isaac |
From: ms <dev...@gm...> - 2009-06-30 21:37:08
|
Hi, I am writing a script that uses pyplot.show() to show a plot, on which the user has to ponder and decide a course of action (telling the script what to do on a raw_input). I would be happy if the pyplot window does not "freeze" python below, i.e. if the window can somehow exist while the python script continues to work. Now if I want the script to continue, I have to close the window. I didn't find examples on how to manage this. Any hint on where to read? Thanks, Massimo |
From: Rick M. <rpm...@gm...> - 2009-06-30 19:10:08
|
I have a working system now. Here's what I did to fix it. 1. Installed libpng from source 2. Installed freetype2 from source 3. Installed pkg-config from source 4. Installed a new version of the Xcode developer tools for the mac. During the build I still saw a few 'incompatible architecture' errors flash by, but I guess they weren't serious enough for the build to stop. On Tue, Jun 30, 2009 at 9:51 AM, Rick Muller <rpm...@gm...> wrote: > > > On Tue, Jun 30, 2009 at 9:14 AM, Michael Droettboom <md...@st...>wrote: > >> What does >> >> pkg-config libpng --modversion --libs --cflags >> >> give? >> >> The pkg-config error may actually be a red herring, since matplotlib will >> look in /usr/local even if pkg-config fails, and it obviously found the >> headers or it wouldn't have gotten to the linking stage. As the author of >> the pkg-config support I would like to rule that out as the problem though. >> >> I think it's more likely that the libpng isn't being built correctly to >> match the kind of binary matplotlib is building. I'm afraid that's where I >> hit the end of my knowledge as a non-Mac user, but I'm sure another Mac >> developer will chime in. >> > > Okay, I just installed pkg-config, and it now finds the proper libpng... > > libpng: 1.2.37 > > However, I still get exactly the same compile problem: > > g++ -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g > -bundle -u > ndefined dynamic_lookup build/temp.macosx-10.3-fat-2.6/src/ft2font.o > build/temp. > macosx-10.3-fat-2.6/src/mplutils.o > build/temp.macosx-10.3-fat-2.6/CXX/cxx_extens > ions.o build/temp.macosx-10.3-fat-2.6/CXX/cxxsupport.o > build/temp.macosx-10.3-fa > t-2.6/CXX/IndirectPythonInterface.o > build/temp.macosx-10.3-fat-2.6/CXX/cxxextens > ions.o -L/usr/local/lib -L/usr/lib -L/usr/X11R6/lib -lfreetype -lz -lstdc++ > -lm > -o build/lib.macosx-10.3-fat-2.6/matplotlib/ft2font.so > ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libPng.dylib, file is > not o > f required architecture for architecture ppc > collect2: ld returned 1 exit status > lipo: can't open input file: > /var/folders/tu/tuLdYMqlEm00c5EVXrMQ+U+++TQ/-Tmp-// > ccU5pNn1.out (No such file or directory) > error: command 'g++' failed with exit status 1 > > -- > Rick Muller > rpm...@gm... > -- Rick Muller rpm...@gm... |
From: Ondrej C. <on...@ce...> - 2009-06-30 18:10:20
|
Hi, this must have been answered many times already, but I searched the archives, online docs, but couldn't find anything. If I do: $ python Python 2.6.2 (release26-maint, Apr 19 2009, 01:58:18) [GCC 4.3.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import pylab >>> pylab.plot([1, 3, 3]) [<matplotlib.lines.Line2D object at 0x2154350>] >>> pylab.show() >>> pylab.show() >>> the first pylab.show() shows the plot and stays hanging (this is ok) and then if I close it, to get back to the shell, the second call to show() does nothing. One fix is to use: ipython --pylab but if I just want to call regular python, or from my own script --- how do I plot for the second time? Ondrej |
From: Markus F. <fel...@gm...> - 2009-06-30 17:22:43
|
Hi All, my program lets slow down my cpu. This only appears if i plot to much points. I am not sure how many point i need to get this, normally i plot 3*14e6 + 8e3, that is round about 50million points. My system is a dual core 2GHz cpu with 2Gbyte Ram. Here is my method to plot, def drawtransientall(self,min): self.subplot = self.figure.add_subplot(111) self.subplot.grid(True) list_t1,list_peaks,t2,list_samples = self.computetransientall(min,min+self.maxitems) offset = 0 color = ['green','red','blue','magenta','cyan'] markerPeaks = ['v','<','1','3','s'] markerSamples = ['^','>','2','4','p'] self.plots=[[],[]] for i in range(len(self.showBands)): self.plots[0] += self.subplot.plot(list_t1[i],list_peaks[i],color=color[i],marker=markerPeaks[i], linestyle='None') self.plots[1] += self.subplot.plot(t2,list_samples[i]+offset,color=color[i], marker=markerSamples[i],linestyle='None') offset +=1 self.subplot.set_xlim(t2[0]-np.abs(t2[-1]-t2[0])/100,t2[-1]+np.abs(t2[-1]-t2[0])/100) ymax = np.amax(list_samples) ymin = np.amin(list_samples) self.subplot.set_ylim([ymin-np.abs(ymin)*0.1, ymax*1.2 + 2]) self.subplot.set_ylabel("abs(Sample(t)) und abs(Peak(t)+Offset)-->",fontsize = 12) self.subplot.set_xlabel("Zeit in Sek. -->",fontsize = 12) Any ideas how to avoid the slow down of my cpu ? regards Markus |
From: Jae-Joon L. <lee...@gm...> - 2009-06-30 17:21:48
|
Hi Fabrice, Good to hear that you were able to get it work. Here is some tweak on transforms. This way, the plot is shown correctly even if you change the y-limits of axes. trans0 = blended_transform_factory(ax0.transData, ax0.transAxes) trans1 = blended_transform_factory(ax1.transData, ax1.transAxes) bbox = Bbox.from_extents(xmin, 0, xmax, 1) mybbox1 = TransformedBbox(bbox, trans0) mybbox2 = TransformedBbox(bbox, trans1) I think the code is worth to be included as an mpl example. I'll push this into the svn if you don't mind. Regards, -JJ On Tue, Jun 30, 2009 at 8:12 AM, Fabrice Silva<si...@lm...> wrote: > Le lundi 29 juin 2009 à 16:11 -0400, Jae-Joon Lee a écrit : >> I think the issue here is to connect points in two different axes, >> which is possible but can be a bit difficult. > That was my problem > >> In the svn version of matplotlib, there are some helper classes to >> ease this job a bit. > Thanks for your pointer. Sadly the mpl.toolkits.axes_grid is not shipped > by debian package, and downloading it requires other stuff. So I adapted > from the inset_locator.py the attached file. > > Finally I can "zoom" with the mere script : > import matplotlib.pyplot as plt > from mpl_axes_grid_inset_locator import zoom_effect > S1 = plt.subplot(211) > S1.plot(... # xlim (0.,1.2) > S2 = plt.subplot(223) > S2.plot(... # xlim (0.0095,.012) > S3 = plt.subplot(224) > S3.plot(... # xlim (0.84,1.) > # Labels stuff > # [...] > > patch_props=dict(ec="r", alpha=0.5, fc="r") > zoom_effect(S1,S2, 0.01, 0.011, **patch_props) > zoom_effect(S1,S3, 0.90, 0.95, **patch_props) > > It produces two zoom subplots with the wanted patch. > > ------------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: C L. <ch...@na...> - 2009-06-30 16:57:19
|
Try calling legend() again once you've changed the lines; in ipython - pylab, this x = linspace(-10, 10, 101) sub = subplot(111) plot(x, x**2, label="x^2") plot(x, x**3, label="x^3") legend() #Two lines, two legend entries sub.lines[0].remove() #One line, two legend entries sub.get_lines() legend() #One line, one legend entry works for me. &C On Jun 30, 2009, at 2:39 AM, Magnus Benjes wrote: > Hello, > > I know how to remove a line from an axes. But a I also want to > remove the label of the line from the legend of the axes. > > In the sample code you can see two labels in the legend, while there > is only one line in the axes left. > > > import numpy as N > from matplotlib.pyplot import * > > x = N.linspace(-10,10,201) > ax = figure().add_subplot(111) > ax.plot(x, x**2, label="$x^2$") > ax.plot(x, x**3, label="$x^3$") > ax.legend() > ax.lines[0].remove() > show() > > > Regards > Magnus > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users Chloe Lewis Graduate student, Amundson Lab Division of Ecosystem Sciences, ESPM University of California, Berkeley 137 Mulford Hall - #3114 Berkeley, CA 94720-3114 ch...@na... |
From: Ryan W. <rw...@vn...> - 2009-06-30 16:51:15
|
Thanks Reinier, For posterity ended up just doing the following: matplotlib.interactive(True) ... s = ax.scatter(data1, data2, data3) draw() s.remove() s = ax.scatter(data4, data5, data6) draw() >Hi Ryan, > >This is currently not supported. Since also the 2D PatchCollection does not support it I >don't see how to easily add it either... > >Cheers, >Reinier |
From: Alexandar H. <vio...@gm...> - 2009-06-30 16:33:34
|
Hello, I've been struggling with this for a while now and have effectively two issues. One, how can I define the range over which hexbin ... bins? And two, how do I change the background color of a plot? The latter I thought would be trivial, but nothing I've tried has worked. Let's take the example: import numpy as np import matplotlib.cm as cm import matplotlib.pyplot as plt n = 100000 x = np.random.standard_normal(n) y = 2.0 + 3.0 * x + 4.0 * np.random.standard_normal(n) #xmin = x.min() #xmax = x.max() #ymin = y.min() #ymax = y.max() xmin = 0 xmax = 10 ymin = 0 ymax = 30 plt.hexbin(x,y, cmap=cm.jet) #plt.hexbin(x,y, cmap=cm.jet, extent=[xmin, xmax, ymin, ymax]) plt.axis([xmin, xmax, ymin, ymax]) plt.title("Hexagon binning") cb = plt.colorbar() cb.set_label('counts') plt.show() Let's say i'm only interested in the positive quadrant of the data, so I only want to bin data in the range of 0-10 in x and 0-30 in y. The first thing I tried was to use the extent option to only bin the specified range of data, but that gives these errors: [tesla:~/NMR/500-Tupp/IM7][349] HexBin.py Traceback (most recent call last): File "HexBin.py", line 28, in <module> plt.hexbin(x,y, cmap=cm.jet, extent=[xmin, xmax, ymin, ymax]) File "/usr/lib64/python2.5/site-packages/matplotlib/pyplot.py", line 1920, in hexbin ret = gca().hexbin(*args, **kwargs) File "/usr/lib64/python2.5/site-packages/matplotlib/axes.py", line 5447, in hexbin collection.update(kwargs) File "/usr/lib64/python2.5/site-packages/matplotlib/artist.py", line 548, in update raise AttributeError('Unknown property %s'%k) AttributeError: Unknown property extent After that, I just set the plt.axis range to what I'm interested in. However, the range not binned by hexbin shows up as white, instead of the 0-count blue. I've tried adding facecolor, edgecolor, axisbg, and who knows what else as part of plt.hexbin, plt.axis, and plt.savefig, But most have no consequence on the plot. plt.savefig(myname, facecolor='blue') successfully changed everything blue except the white region within the plot. So, where am I going wrong? I'm finding myself out of options and would ideally not like to trim or add false points to my data just to get the axis and colors correct. Best, Alex |
From: Rick M. <rpm...@gm...> - 2009-06-30 15:51:18
|
On Tue, Jun 30, 2009 at 9:14 AM, Michael Droettboom <md...@st...> wrote: > What does > > pkg-config libpng --modversion --libs --cflags > > give? > > The pkg-config error may actually be a red herring, since matplotlib will > look in /usr/local even if pkg-config fails, and it obviously found the > headers or it wouldn't have gotten to the linking stage. As the author of > the pkg-config support I would like to rule that out as the problem though. > > I think it's more likely that the libpng isn't being built correctly to > match the kind of binary matplotlib is building. I'm afraid that's where I > hit the end of my knowledge as a non-Mac user, but I'm sure another Mac > developer will chime in. > Okay, I just installed pkg-config, and it now finds the proper libpng... libpng: 1.2.37 However, I still get exactly the same compile problem: g++ -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -u ndefined dynamic_lookup build/temp.macosx-10.3-fat-2.6/src/ft2font.o build/temp. macosx-10.3-fat-2.6/src/mplutils.o build/temp.macosx-10.3-fat-2.6/CXX/cxx_extens ions.o build/temp.macosx-10.3-fat-2.6/CXX/cxxsupport.o build/temp.macosx-10.3-fa t-2.6/CXX/IndirectPythonInterface.o build/temp.macosx-10.3-fat-2.6/CXX/cxxextens ions.o -L/usr/local/lib -L/usr/lib -L/usr/X11R6/lib -lfreetype -lz -lstdc++ -lm -o build/lib.macosx-10.3-fat-2.6/matplotlib/ft2font.so ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libPng.dylib, file is not o f required architecture for architecture ppc collect2: ld returned 1 exit status lipo: can't open input file: /var/folders/tu/tuLdYMqlEm00c5EVXrMQ+U+++TQ/-Tmp-// ccU5pNn1.out (No such file or directory) error: command 'g++' failed with exit status 1 -- Rick Muller rpm...@gm... |
From: Rick M. <rpm...@gm...> - 2009-06-30 15:32:35
|
On Tue, Jun 30, 2009 at 9:14 AM, Michael Droettboom <md...@st...> wrote: > What does > > pkg-config libpng --modversion --libs --cflags > > give? I guess I don't have pkg-config installed. Is this a requirement? I haven't had it installed before? > > > The pkg-config error may actually be a red herring, since matplotlib will > look in /usr/local even if pkg-config fails, and it obviously found the > headers or it wouldn't have gotten to the linking stage. As the author of > the pkg-config support I would like to rule that out as the problem though. > > I think it's more likely that the libpng isn't being built correctly to > match the kind of binary matplotlib is building. I'm afraid that's where I > hit the end of my knowledge as a non-Mac user, but I'm sure another Mac > developer will chime in. I think it's just finding the wrong version of libpng. For whatever reason, it has decided that an old version in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libPng.dylib is the proper version, despite there being a newer version in /usr/local/lib. Is there any way I can rearrange the search path so that it finds the /usr/local/lib version? Rick -- Rick Muller rpm...@gm... |
From: Michael D. <md...@st...> - 2009-06-30 15:14:16
|
What does pkg-config libpng --modversion --libs --cflags give? The pkg-config error may actually be a red herring, since matplotlib will look in /usr/local even if pkg-config fails, and it obviously found the headers or it wouldn't have gotten to the linking stage. As the author of the pkg-config support I would like to rule that out as the problem though. I think it's more likely that the libpng isn't being built correctly to match the kind of binary matplotlib is building. I'm afraid that's where I hit the end of my knowledge as a non-Mac user, but I'm sure another Mac developer will chime in. Cheers, Mike Rick Muller wrote: > I've been a long time, happy user of MPL, but I'm having some problems > building the latest version (0.98.5.3) on the Mac (python 2.6.2). > > The bottom line is that when I build, I get the error message: > > ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libPng.dylib, > file is not o > f required architecture for architecture ppc > collect2: ld returned 1 exit status > lipo: can't open input file: > /var/folders/tu/tuLdYMqlEm00c5EVXrMQ+U+++TQ/-Tmp-// > cci4zDq4.out (No such file or directory) > error: command 'g++' failed with exit status 1 > > However, I have a freshly-built version of libpng installed from > source in /usr/local/lib. I don't think MPL is finding it, though, > since during config I see: > > libpng: found, but unknown version (no pkg-config) > > (However, when I install libpng, I do install the pc file, viz: > cd /usr/local/lib/pkgconfig; rm -f libpng.pc > cd /usr/local/lib/pkgconfig; ln -s libpng12.pc libpng.pc) > > I'm probably doing something dumb. Is there a workaround to this? > > Thanks in advance, > > Rick > > -- > Rick Muller > rpm...@gm... <mailto:rpm...@gm...> > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > 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 |
From: Rick M. <rpm...@gm...> - 2009-06-30 15:02:05
|
I've been a long time, happy user of MPL, but I'm having some problems building the latest version (0.98.5.3) on the Mac (python 2.6.2). The bottom line is that when I build, I get the error message: ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libPng.dylib, file is not o f required architecture for architecture ppc collect2: ld returned 1 exit status lipo: can't open input file: /var/folders/tu/tuLdYMqlEm00c5EVXrMQ+U+++TQ/-Tmp-// cci4zDq4.out (No such file or directory) error: command 'g++' failed with exit status 1 However, I have a freshly-built version of libpng installed from source in /usr/local/lib. I don't think MPL is finding it, though, since during config I see: libpng: found, but unknown version (no pkg-config) (However, when I install libpng, I do install the pc file, viz: cd /usr/local/lib/pkgconfig; rm -f libpng.pc cd /usr/local/lib/pkgconfig; ln -s libpng12.pc libpng.pc) I'm probably doing something dumb. Is there a workaround to this? Thanks in advance, Rick -- Rick Muller rpm...@gm... |
From: Reinier H. <re...@he...> - 2009-06-30 13:29:13
|
Hi Ryan, This is currently not supported. Since also the 2D PatchCollection does not support it I don't see how to easily add it either... Cheers, Reinier On Mon, Jun 29, 2009 at 11:40 PM, Ryan Wagner<rw...@vn...> wrote: > Can anyone help me out? I’m trying to do the following equivalent in a > scatter3d call… > > > > line, = ax.plot(data1, data2) > > line.set_data(data3, data4) > > line.axes.figure.canvas.draw() > > > > So I’m looking to do: > > > > ax = axes3d.Axes3D(fig) > > s = ax.scatter(data1, data2, data3) > > s.set_data(data2,data3,data4) ß but this function doesn’t exist… what is > the equivalent that I’m missing? > > s.axes.figure.canvas.draw() > > > > > > TIA > > -Ryan > -- Reinier Heeres Tel: +31 6 10852639 |
From: Fabrice S. <si...@lm...> - 2009-06-30 12:10:01
|
Le lundi 29 juin 2009 à 16:11 -0400, Jae-Joon Lee a écrit : > I think the issue here is to connect points in two different axes, > which is possible but can be a bit difficult. That was my problem > In the svn version of matplotlib, there are some helper classes to > ease this job a bit. Thanks for your pointer. Sadly the mpl.toolkits.axes_grid is not shipped by debian package, and downloading it requires other stuff. So I adapted from the inset_locator.py the attached file. Finally I can "zoom" with the mere script : import matplotlib.pyplot as plt from mpl_axes_grid_inset_locator import zoom_effect S1 = plt.subplot(211) S1.plot(... # xlim (0.,1.2) S2 = plt.subplot(223) S2.plot(... # xlim (0.0095,.012) S3 = plt.subplot(224) S3.plot(... # xlim (0.84,1.) # Labels stuff # [...] patch_props=dict(ec="r", alpha=0.5, fc="r") zoom_effect(S1,S2, 0.01, 0.011, **patch_props) zoom_effect(S1,S3, 0.90, 0.95, **patch_props) It produces two zoom subplots with the wanted patch. |
From: Magnus B. <mag...@go...> - 2009-06-30 10:39:11
|
Hello, I know how to remove a line from an axes. But a I also want to remove the label of the line from the legend of the axes. In the sample code you can see two labels in the legend, while there is only one line in the axes left. import numpy as N from matplotlib.pyplot import * x = N.linspace(-10,10,201) ax = figure().add_subplot(111) ax.plot(x, x**2, label="$x^2$") ax.plot(x, x**3, label="$x^3$") ax.legend() ax.lines[0].remove() show() Regards Magnus |
From: Jouni K. S. <jk...@ik...> - 2009-06-30 05:24:21
|
per freem <per...@gm...> writes: > rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) > rc('pdf', use14corefonts=True) > > then when i open the generated pdf in adobe illustrator i get the error: > "The font "Helvetica-Narrow" contains a bad /BBox." Helvetica-Narrow is not one of the pdf core fonts. I suspect that the matplotlib font selection system is matching your specification of Helvetica with Helvetica-Narrow because it is available on your system and its name begins with "Helvetica". This must be a bug. I don't have time to investigate now, so unless someone else has any comments, I suggest filing this on the sourceforge tracker. -- Jouni K. Seppänen http://www.iki.fi/jks |
From: Abiel R. <ab...@gm...> - 2009-06-30 02:32:11
|
I am developing an application in which I would like the user to be able to click on a chart and have the application detect whether the click has occurred over a specific piece of text. For example, I have multiple lines on a chart with two y-axes, and I have the titles of the series stacked up at the top of the chart. I would like the user to be able to click one of the titles which would then cause the corresponding series to switch to the other axis. Unfortunately I still cannot figure how to retrieve the area that a piece of text fills on the chart. (in case it makes a difference, note that the chart can be resized at any time, so the pixel coordinates of the text could change at any time). Thanks very much Abiel |
From: per f. <per...@gm...> - 2009-06-29 23:41:10
|
more information on this. if i try to use pdf.use14corefonts, like was suggested by Jouni, as follows: from scipy import * import matplotlib matplotlib.use('PDF') from matplotlib import rc import matplotlib.pyplot as plt rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) rc('pdf', use14corefonts=True) then when i open the generated pdf in adobe illustrator i get the error: "The font "Helvetica-Narrow" contains a bad /BBox." -- then no labels are shown in the graph, only the nontextual elements. On Mon, Jun 29, 2009 at 4:46 PM, per freem <per...@gm...> wrote: > hi all, > > I am not sure if I have helvetica installed as a TTF -- how can i install > it if i don't? > > i followed the debug suggestion and here are the results. when i set the > font to arial, using: > > from matplotlib import rc > rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) > > then the relevant output i get using --verbose-debug is: > > matplotlib version 0.98.5.2 > Using fontManager instance from /Users/perf/.matplotlib/fontList.cache > backend pdf version unknown > findfont: Matching > :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium > to Arial (/Library/Fonts/Arial.ttf) with score of 0.000000 > findfont: Matching > :family=STIXGeneral:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to STIXGeneral > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneral.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXNonUnicode:style=normal:variant=normal:weight=bold:stretch=normal:size=12.0 > to STIXNonUnicode > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniBol.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXGeneral:style=normal:variant=normal:weight=bold:stretch=normal:size=12.0 > to STIXGeneral > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneralBol.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXSize3:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to STIXSize3 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz3Sym.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXSize4:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to STIXSize4 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz4Sym.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXSize5:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to STIXSize5 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz5Sym.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXSize1:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to STIXSize1 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz1Sym.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXSize2:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to STIXSize2 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz2Sym.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXGeneral:style=italic:variant=normal:weight=normal:stretch=normal:size=12.0 > to STIXGeneral > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneralItalic.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXNonUnicode:style=italic:variant=normal:weight=normal:stretch=normal:size=12.0 > to STIXNonUnicode > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniIta.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXNonUnicode:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to STIXNonUnicode > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUni.ttf) > with score of 0.000000 > findfont: Matching > :family=cmb10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to cmb10 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmb10.ttf) > with score of 0.000000 > findfont: Matching > :family=cmtt10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to cmtt10 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmtt10.ttf) > with score of 0.000000 > findfont: Matching > :family=cmmi10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to cmmi10 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmmi10.ttf) > with score of 0.000000 > findfont: Matching > :family=cmex10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to cmex10 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmex10.ttf) > with score of 0.000000 > findfont: Matching > :family=cmsy10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to cmsy10 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmsy10.ttf) > with score of 0.000000 > findfont: Matching > :family=cmr10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to cmr10 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmr10.ttf) > with score of 0.000000 > findfont: Matching > :family=cmss10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to cmss10 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmss10.ttf) > with score of 0.000000 > > with the same line but this time setting the font to 'Helvetica', I get: > > matplotlib version 0.98.5.2 > Using fontManager instance from /Users/perf/.matplotlib/fontList.cache > backend pdf version unknown > findfont: Could not match > :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium. > Returning > /Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf > findfont: Matching > :family=STIXGeneral:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to STIXGeneral > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneral.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXNonUnicode:style=normal:variant=normal:weight=bold:stretch=normal:size=12.0 > to STIXNonUnicode > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniBol.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXGeneral:style=normal:variant=normal:weight=bold:stretch=normal:size=12.0 > to STIXGeneral > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneralBol.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXSize3:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to STIXSize3 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz3Sym.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXSize4:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to STIXSize4 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz4Sym.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXSize5:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to STIXSize5 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz5Sym.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXSize1:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to STIXSize1 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz1Sym.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXSize2:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to STIXSize2 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz2Sym.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXGeneral:style=italic:variant=normal:weight=normal:stretch=normal:size=12.0 > to STIXGeneral > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneralItalic.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXNonUnicode:style=italic:variant=normal:weight=normal:stretch=normal:size=12.0 > to STIXNonUnicode > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniIta.ttf) > with score of 0.000000 > findfont: Matching > :family=STIXNonUnicode:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to STIXNonUnicode > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUni.ttf) > with score of 0.000000 > findfont: Matching > :family=cmb10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to cmb10 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmb10.ttf) > with score of 0.000000 > findfont: Matching > :family=cmtt10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to cmtt10 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmtt10.ttf) > with score of 0.000000 > findfont: Matching > :family=cmmi10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to cmmi10 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmmi10.ttf) > with score of 0.000000 > findfont: Matching > :family=cmex10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to cmex10 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmex10.ttf) > with score of 0.000000 > findfont: Matching > :family=cmsy10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to cmsy10 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmsy10.ttf) > with score of 0.000000 > findfont: Matching > :family=cmr10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to cmr10 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmr10.ttf) > with score of 0.000000 > findfont: Matching > :family=cmss10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 > to cmss10 > (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmss10.ttf) > with score of 0.000000 > > any idea what might be wrong here? > > > On Mon, Jun 29, 2009 at 8:47 AM, Michael Droettboom <md...@st...>wrote: > >> Are you certain you have Helvetica installed as a TrueType font? If you >> don't, the only way to get the Postscript Helvetica is to set "ps.useafm" to >> True. >> >> Cheers, >> Mike >> >> per freem wrote: >> >>> I just wanted to add: if i simply set the font to Arial, using >>> >>> rc('font',**{'family':'sans-serif','sans-serif':['Arial']}) >>> >>> then it works. But the same call with Helvetica still defaults to that >>> Bitstream/default font of matplotlib. any idea why this might be? could >>> matplotlib be confusing helvetica with bitstream? >>> >>> On Sun, Jun 28, 2009 at 11:28 AM, per freem <per...@gm... <mailto: >>> per...@gm...>> wrote: >>> >>> hi, >>> >>> i am trying to use the Helvetica font on matplotlib. i am using >>> mac os x (so i definitely have helvetica installed) with version >>> 0.98.5.2 of matplotlib. my code is: >>> >>> from scipy import * >>> import matplotlib >>> matplotlib.use('PDF') >>> from matplotlib import rc >>> import matplotlib.pyplot as plt >>> rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) >>> plt.hist(rand(100)) >>> xlabel(r"My x axis $\alpha$") >>> ylabel(r"My y axis $\beta$") >>> >>> i verified that plt.rcParams gets modified to use 'Helvetica' as >>> the value for font.family, etc. but i still get the default font >>> used in all of these figures. i tried using the PS backend using >>> matplotlib.use('PS') but the problem persists. i am interested in >>> getting out PDFs that use helvetica everywhere. >>> >>> does anyone know how to fix this? thank you. >>> >>> >>> ------------------------------------------------------------------------ >>> >>> >>> ------------------------------------------------------------------------------ >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> 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 >> >> > > |
From: Ryan W. <rw...@vn...> - 2009-06-29 21:41:00
|
Can anyone help me out? I'm trying to do the following equivalent in a scatter3d call... line, = ax.plot(data1, data2) line.set_data(data3, data4) line.axes.figure.canvas.draw() So I'm looking to do: ax = axes3d.Axes3D(fig) s = ax.scatter(data1, data2, data3) s.set_data(data2,data3,data4) <-- but this function doesn't exist... what is the equivalent that I'm missing? s.axes.figure.canvas.draw() TIA -Ryan |
From: per f. <per...@gm...> - 2009-06-29 20:47:04
|
hi all, I am not sure if I have helvetica installed as a TTF -- how can i install it if i don't? i followed the debug suggestion and here are the results. when i set the font to arial, using: from matplotlib import rc rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) then the relevant output i get using --verbose-debug is: matplotlib version 0.98.5.2 Using fontManager instance from /Users/perf/.matplotlib/fontList.cache backend pdf version unknown findfont: Matching :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium to Arial (/Library/Fonts/Arial.ttf) with score of 0.000000 findfont: Matching :family=STIXGeneral:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to STIXGeneral (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneral.ttf) with score of 0.000000 findfont: Matching :family=STIXNonUnicode:style=normal:variant=normal:weight=bold:stretch=normal:size=12.0 to STIXNonUnicode (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniBol.ttf) with score of 0.000000 findfont: Matching :family=STIXGeneral:style=normal:variant=normal:weight=bold:stretch=normal:size=12.0 to STIXGeneral (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneralBol.ttf) with score of 0.000000 findfont: Matching :family=STIXSize3:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to STIXSize3 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz3Sym.ttf) with score of 0.000000 findfont: Matching :family=STIXSize4:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to STIXSize4 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz4Sym.ttf) with score of 0.000000 findfont: Matching :family=STIXSize5:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to STIXSize5 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz5Sym.ttf) with score of 0.000000 findfont: Matching :family=STIXSize1:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to STIXSize1 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz1Sym.ttf) with score of 0.000000 findfont: Matching :family=STIXSize2:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to STIXSize2 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz2Sym.ttf) with score of 0.000000 findfont: Matching :family=STIXGeneral:style=italic:variant=normal:weight=normal:stretch=normal:size=12.0 to STIXGeneral (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneralItalic.ttf) with score of 0.000000 findfont: Matching :family=STIXNonUnicode:style=italic:variant=normal:weight=normal:stretch=normal:size=12.0 to STIXNonUnicode (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniIta.ttf) with score of 0.000000 findfont: Matching :family=STIXNonUnicode:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to STIXNonUnicode (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUni.ttf) with score of 0.000000 findfont: Matching :family=cmb10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to cmb10 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmb10.ttf) with score of 0.000000 findfont: Matching :family=cmtt10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to cmtt10 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmtt10.ttf) with score of 0.000000 findfont: Matching :family=cmmi10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to cmmi10 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmmi10.ttf) with score of 0.000000 findfont: Matching :family=cmex10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to cmex10 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmex10.ttf) with score of 0.000000 findfont: Matching :family=cmsy10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to cmsy10 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmsy10.ttf) with score of 0.000000 findfont: Matching :family=cmr10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to cmr10 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmr10.ttf) with score of 0.000000 findfont: Matching :family=cmss10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to cmss10 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmss10.ttf) with score of 0.000000 with the same line but this time setting the font to 'Helvetica', I get: matplotlib version 0.98.5.2 Using fontManager instance from /Users/perf/.matplotlib/fontList.cache backend pdf version unknown findfont: Could not match :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium. Returning /Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont: Matching :family=STIXGeneral:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to STIXGeneral (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneral.ttf) with score of 0.000000 findfont: Matching :family=STIXNonUnicode:style=normal:variant=normal:weight=bold:stretch=normal:size=12.0 to STIXNonUnicode (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniBol.ttf) with score of 0.000000 findfont: Matching :family=STIXGeneral:style=normal:variant=normal:weight=bold:stretch=normal:size=12.0 to STIXGeneral (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneralBol.ttf) with score of 0.000000 findfont: Matching :family=STIXSize3:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to STIXSize3 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz3Sym.ttf) with score of 0.000000 findfont: Matching :family=STIXSize4:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to STIXSize4 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz4Sym.ttf) with score of 0.000000 findfont: Matching :family=STIXSize5:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to STIXSize5 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz5Sym.ttf) with score of 0.000000 findfont: Matching :family=STIXSize1:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to STIXSize1 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz1Sym.ttf) with score of 0.000000 findfont: Matching :family=STIXSize2:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to STIXSize2 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSiz2Sym.ttf) with score of 0.000000 findfont: Matching :family=STIXGeneral:style=italic:variant=normal:weight=normal:stretch=normal:size=12.0 to STIXGeneral (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneralItalic.ttf) with score of 0.000000 findfont: Matching :family=STIXNonUnicode:style=italic:variant=normal:weight=normal:stretch=normal:size=12.0 to STIXNonUnicode (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniIta.ttf) with score of 0.000000 findfont: Matching :family=STIXNonUnicode:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to STIXNonUnicode (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUni.ttf) with score of 0.000000 findfont: Matching :family=cmb10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to cmb10 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmb10.ttf) with score of 0.000000 findfont: Matching :family=cmtt10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to cmtt10 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmtt10.ttf) with score of 0.000000 findfont: Matching :family=cmmi10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to cmmi10 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmmi10.ttf) with score of 0.000000 findfont: Matching :family=cmex10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to cmex10 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmex10.ttf) with score of 0.000000 findfont: Matching :family=cmsy10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to cmsy10 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmsy10.ttf) with score of 0.000000 findfont: Matching :family=cmr10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to cmr10 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmr10.ttf) with score of 0.000000 findfont: Matching :family=cmss10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to cmss10 (/Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmss10.ttf) with score of 0.000000 any idea what might be wrong here? On Mon, Jun 29, 2009 at 8:47 AM, Michael Droettboom <md...@st...> wrote: > Are you certain you have Helvetica installed as a TrueType font? If you > don't, the only way to get the Postscript Helvetica is to set "ps.useafm" to > True. > > Cheers, > Mike > > per freem wrote: > >> I just wanted to add: if i simply set the font to Arial, using >> >> rc('font',**{'family':'sans-serif','sans-serif':['Arial']}) >> >> then it works. But the same call with Helvetica still defaults to that >> Bitstream/default font of matplotlib. any idea why this might be? could >> matplotlib be confusing helvetica with bitstream? >> >> On Sun, Jun 28, 2009 at 11:28 AM, per freem <per...@gm... <mailto: >> per...@gm...>> wrote: >> >> hi, >> >> i am trying to use the Helvetica font on matplotlib. i am using >> mac os x (so i definitely have helvetica installed) with version >> 0.98.5.2 of matplotlib. my code is: >> >> from scipy import * >> import matplotlib >> matplotlib.use('PDF') >> from matplotlib import rc >> import matplotlib.pyplot as plt >> rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) >> plt.hist(rand(100)) >> xlabel(r"My x axis $\alpha$") >> ylabel(r"My y axis $\beta$") >> >> i verified that plt.rcParams gets modified to use 'Helvetica' as >> the value for font.family, etc. but i still get the default font >> used in all of these figures. i tried using the PS backend using >> matplotlib.use('PS') but the problem persists. i am interested in >> getting out PDFs that use helvetica everywhere. >> >> does anyone know how to fix this? thank you. >> >> >> ------------------------------------------------------------------------ >> >> >> ------------------------------------------------------------------------------ >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> 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 > > |
From: Jae-Joon L. <lee...@gm...> - 2009-06-29 20:11:42
|
I think the issue here is to connect points in two different axes, which is possible but can be a bit difficult. In the svn version of matplotlib, there are some helper classes to ease this job a bit. I'm attaching the example. I think you can also run the example with 0.98.5.3. Just download inset_locator.py and modify your import statement. http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/mpl_toolkits/axes_grid/inset_locator.py?revision=7084&view=markup Regards, -JJ On Mon, Jun 29, 2009 at 1:22 PM, Fabrice Silva<si...@lm...> wrote: > Le lundi 29 juin 2009 à 14:39 +0200, Fabrice Silva a écrit : >> I merely wanted to add a Polygon patch between the upper and the lower >> subplots, but using data coordinates from these axes. > > One more precision : my intent is to draw a figure 'statically', I do > not need event handling, ie handling manual zoom through an interactive > backend. The figure is generated from a script and directly saved > without human interaction. > -- > Fabrice Silva <si...@lm...> > LMA UPR CNRS 7051 > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |