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
|
From: Bogdan M. <bog...@gm...> - 2004-07-22 13:18:16
|
Ok, I tested the toolbar again and this time everything is fine. I guess that I was distracted by the fact that the "Pan" and "Zoom to rectangle" buttons don't look as they are pressed when I press them :) I mean, they don't change their visual appearance. They look like normal buttons, but they should probably be toggle buttons. Apart from that, everything else is fine. I don't need a recipe for JPG, i also prefer PNG, i just signaled this because I thought it was a problem. For printing ... I don't know :( I'll try to post a question to the wx list and come back to you all if I receive a solution. Thank you very much for your support. Yes, again :) Bogdan On Thu, 22 Jul 2004 07:24:21 -0500, John Hunter <jdh...@ac...> wrote: > >>>>> "Marinescu" == Marinescu Bogdan-bmarine1 <bog...@fr...> writes: > > Marinescu> Hi John, Thanks for the quick reply, I was really > Marinescu> happy to download the snapshot and see that it works. I > Marinescu> tested in on wxPython 2.5.1.5 without problems, it > Marinescu> would probably work the same on 2.4.2.4. I'm not quite > Marinescu> familiar with the toolbar functions, so I don't know if > Marinescu> the results I'm getting are right. The "home" button > Marinescu> seems to do something, I can see a visual indication of > Marinescu> the repaint when I press it. On the other hand, the > Marinescu> "pan" button seems to be disabled; even if I can press > Marinescu> it, I'm unable to select it (or it isn't supposed to be > Marinescu> selectable?) Maybe this is normal for the example that > Marinescu> you sent in your e-mail? Because of this, I can't test > Marinescu> the functionality of the back/forward buttons. The > Marinescu> "zoom to rect" button also seems to be disable, > Marinescu> probably because I didn't use the zoom function, which > Marinescu> is also related to the "pan" button, if I understand it > Marinescu> correctly. The "save" button worked when trying to save > Marinescu> a PNG image, but the program exited with a "Do not know > Marinescu> know to handle extension *.jpg" message printed on the > Marinescu> console when trying to save a JPG image. Again, I don't > Marinescu> know if this behavior is correct or not, I'm just > Marinescu> posting my results. > > These buttons don't do what you think they do because they all work > very differently from the classic matplotlib toolbar (else why > introduce a new one!) > > The Forward and Back buttons are akin to the web browser forward and > back buttons. They are used to navigate back and forth between > previously defined views. They have no meaning unless you have > already navigated somewhere else using the pan and zoom buttons. This > is analogous to trying to click 'back' on your web browser before > visiting a new page. Nothing happens. 'Home' always takes you to the > first view. For Home, Forward and Back, think web browser where data > views are web pages. Use the pan and zoom to rectangle to define new > views. > > The "Pan" button has two modes: pan and zoom. Click this toolbar > button to activate this mode. Then put your mouse somewhere over an > axes. Mode 1: Press the left mouse button and hold it, dragging it to > a new position. When you release it, the data under the point where > you pressed will be moved to the point where you released. Mode 2: > Press the right mouse button, dragging it to a new position. The x > axis will be zoomed in proportionate to the rightward movement and > zoomed out proportionate to the leftward movement. Ditto for the > yaxis and up/down motions. > > The Zoom to rectangle button: Click this toolbar button to activate > this mode. Put your mouse somewhere over and axes and press the left > mouse button. Drag the mouse while holding the button to a new > location and release. The axes view limits will be zoomed to the > rectangle you have defined. > > Save: click this button to launch a file save dialog. All the *Agg > backends know how to save the following image types: PNG, PS, EPS, > SVG. There is no support currently in Agg for writing to JPEG, TIFF > (the regular wx and gtk backends handle these types). It is possible > to use matplotlib/agg + PIL to convert agg images to one of these > other formats if required. I can provide a recipe for you. I prefer > PNG over JPG and TIFF, which is why I haven't worked too hard to > include these other image formats in agg. > > Marinescu> I don't plan on using the toolbar > Marinescu> in my application, I have another (specialized) toolbar > Marinescu> and I'll be using its functions. > > OK, perhaps you could give it one more time just to make sure my > instructions above are clear and that it is working fine on your > system? > > Marinescu> The new event handling mechanism is great and it's > Marinescu> exactly what I needed. However, I have a couple of > Marinescu> fresh new questions for you :) The first one was also > Marinescu> present in my previous e-mail. When I create the plot > Marinescu> it has very large margins to the parent frame. This is > Marinescu> not convenient to me, as I'd like to have a plot that > Marinescu> is as large as possible and margins as small as > Marinescu> possible. Is there a way to modify these margins? > > Yes, you can position axes anywhere you want in any size using the > axes command. See > http://matplotlib.sf.net/matplotlib.matlab.html#-axes and the example > http://matplotlib.sf.net/examples/axes_demo.py. > > Marinescu> The other one is really new and it is related to > Marinescu> printing. Is there a way to print directly from the > Marinescu> library? I'm aware of the image save/image print combo > Marinescu> and I can use it if I have no other option. However, at > Marinescu> this point my application (which is quite critical) > Marinescu> blocks every task switching combination (ctrl+atl+del > Marinescu> included, together with alt+tab and all the others) in > Marinescu> order to force the user to use this application and > Marinescu> ONLY this application. If I choose the "image save" > Marinescu> option I'll be forced to give up this feature, and I > Marinescu> don't want that, as I _KNOW_ that they'll start to play > Marinescu> starcraft in a flash :) Unless there is some Python > Marinescu> source somewhere that can send an image to the > Marinescu> printer. I've been searching for it, but never found > Marinescu> it. I also had this problem with PyPlot, that offers > Marinescu> printing functions, but they don't seem to work :( > Marinescu> (this was tested on two different printers). Then > Marinescu> again, the "Print framework" sample from the wxPython > Marinescu> 2.5.1.5 demo also crashed when trying to print, so I > Marinescu> imagine that the printing support in wxPython is not at > Marinescu> its best at this point :( If anybody has a solution for > Marinescu> this, please let me know. Thank you all for your help. > > cross platform printing is pretty hard, and cross-gui/cross-platform > printing is event harder. If you get wx printing figured out and want > to submit some code, I'd be happy to include it. When I was initially > trying to decide on a GUI for my own application work, poor printing > support in wx the thing that initially steered me to GTK. > > JDH > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Bogdan |
From: John H. <jdh...@ac...> - 2004-07-22 12:48:24
|
>>>>> "Marinescu" == Marinescu Bogdan-bmarine1 <bog...@fr...> writes: Marinescu> Hi John, Thanks for the quick reply, I was really Marinescu> happy to download the snapshot and see that it works. I Marinescu> tested in on wxPython 2.5.1.5 without problems, it Marinescu> would probably work the same on 2.4.2.4. I'm not quite Marinescu> familiar with the toolbar functions, so I don't know if Marinescu> the results I'm getting are right. The "home" button Marinescu> seems to do something, I can see a visual indication of Marinescu> the repaint when I press it. On the other hand, the Marinescu> "pan" button seems to be disabled; even if I can press Marinescu> it, I'm unable to select it (or it isn't supposed to be Marinescu> selectable?) Maybe this is normal for the example that Marinescu> you sent in your e-mail? Because of this, I can't test Marinescu> the functionality of the back/forward buttons. The Marinescu> "zoom to rect" button also seems to be disable, Marinescu> probably because I didn't use the zoom function, which Marinescu> is also related to the "pan" button, if I understand it Marinescu> correctly. The "save" button worked when trying to save Marinescu> a PNG image, but the program exited with a "Do not know Marinescu> know to handle extension *.jpg" message printed on the Marinescu> console when trying to save a JPG image. Again, I don't Marinescu> know if this behavior is correct or not, I'm just Marinescu> posting my results. These buttons don't do what you think they do because they all work very differently from the classic matplotlib toolbar (else why introduce a new one!) The Forward and Back buttons are akin to the web browser forward and back buttons. They are used to navigate back and forth between previously defined views. They have no meaning unless you have already navigated somewhere else using the pan and zoom buttons. This is analogous to trying to click 'back' on your web browser before visiting a new page. Nothing happens. 'Home' always takes you to the first view. For Home, Forward and Back, think web browser where data views are web pages. Use the pan and zoom to rectangle to define new views. The "Pan" button has two modes: pan and zoom. Click this toolbar button to activate this mode. Then put your mouse somewhere over an axes. Mode 1: Press the left mouse button and hold it, dragging it to a new position. When you release it, the data under the point where you pressed will be moved to the point where you released. Mode 2: Press the right mouse button, dragging it to a new position. The x axis will be zoomed in proportionate to the rightward movement and zoomed out proportionate to the leftward movement. Ditto for the yaxis and up/down motions. The Zoom to rectangle button: Click this toolbar button to activate this mode. Put your mouse somewhere over and axes and press the left mouse button. Drag the mouse while holding the button to a new location and release. The axes view limits will be zoomed to the rectangle you have defined. Save: click this button to launch a file save dialog. All the *Agg backends know how to save the following image types: PNG, PS, EPS, SVG. There is no support currently in Agg for writing to JPEG, TIFF (the regular wx and gtk backends handle these types). It is possible to use matplotlib/agg + PIL to convert agg images to one of these other formats if required. I can provide a recipe for you. I prefer PNG over JPG and TIFF, which is why I haven't worked too hard to include these other image formats in agg. Marinescu> I don't plan on using the toolbar Marinescu> in my application, I have another (specialized) toolbar Marinescu> and I'll be using its functions. OK, perhaps you could give it one more time just to make sure my instructions above are clear and that it is working fine on your system? Marinescu> The new event handling mechanism is great and it's Marinescu> exactly what I needed. However, I have a couple of Marinescu> fresh new questions for you :) The first one was also Marinescu> present in my previous e-mail. When I create the plot Marinescu> it has very large margins to the parent frame. This is Marinescu> not convenient to me, as I'd like to have a plot that Marinescu> is as large as possible and margins as small as Marinescu> possible. Is there a way to modify these margins? Yes, you can position axes anywhere you want in any size using the axes command. See http://matplotlib.sf.net/matplotlib.matlab.html#-axes and the example http://matplotlib.sf.net/examples/axes_demo.py. Marinescu> The other one is really new and it is related to Marinescu> printing. Is there a way to print directly from the Marinescu> library? I'm aware of the image save/image print combo Marinescu> and I can use it if I have no other option. However, at Marinescu> this point my application (which is quite critical) Marinescu> blocks every task switching combination (ctrl+atl+del Marinescu> included, together with alt+tab and all the others) in Marinescu> order to force the user to use this application and Marinescu> ONLY this application. If I choose the "image save" Marinescu> option I'll be forced to give up this feature, and I Marinescu> don't want that, as I _KNOW_ that they'll start to play Marinescu> starcraft in a flash :) Unless there is some Python Marinescu> source somewhere that can send an image to the Marinescu> printer. I've been searching for it, but never found Marinescu> it. I also had this problem with PyPlot, that offers Marinescu> printing functions, but they don't seem to work :( Marinescu> (this was tested on two different printers). Then Marinescu> again, the "Print framework" sample from the wxPython Marinescu> 2.5.1.5 demo also crashed when trying to print, so I Marinescu> imagine that the printing support in wxPython is not at Marinescu> its best at this point :( If anybody has a solution for Marinescu> this, please let me know. Thank you all for your help. cross platform printing is pretty hard, and cross-gui/cross-platform printing is event harder. If you get wx printing figured out and want to submit some code, I'd be happy to include it. When I was initially trying to decide on a GUI for my own application work, poor printing support in wx the thing that initially steered me to GTK. JDH |
From: Michael O. <mic...@tu...> - 2004-07-22 11:39:21
|
Thanks a lot for the fast reply and the solution! of the problem!!! Regards from Berlin, Michael On Wed, 21 Jul 2004 08:53:31 -0400 Paul Barrett <ba...@st...> wrote: > Michael Oevermann wrote: > > I am having the same problem as reported by Serge Barrel on 2004-07-16. > > Mathtext works fine on the GUI and e.g. PNG format, but the PS and EPS > > backend > > brings out the raw LaTeX string. > > > > I am using matplotlib 0.60.2 on Mac Os X 10.3.4. > > > > Any ideas how to fix the problem? > > Yes. Use the updated files in CVS. Or use the two attached python files. > > -- Paul > > -- > Paul Barrett, PhD Space Telescope Science Institute > Phone: 410-338-4475 ESS/Science Software Branch > FAX: 410-338-4767 Baltimore, MD 21218 > |
From: Marinescu Bogdan-b. <bog...@fr...> - 2004-07-22 10:22:56
|
Have you installed the freetype2 library (freetype.sourceforge.net)? I had the same problem last night while trying to build the wxagg backend, I had to download the library, install it and then play quite a bit with the settings in order to make it compile. It's not in the CVS layout. HTH. Bogdan -----Original Message----- From: mat...@li... [mailto:mat...@li...]On Behalf Of Nils Wagner Sent: Thursday, July 22, 2004 10:17 AM To: mat...@li... Subject: [Matplotlib-users] build the matplotlib users guide failed Hi all, I am going to build the matplotlib users guide. However python setup.py install failed with the follwoing message gcc -pthread -fno-strict-aliasing -DNDEBUG -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -fPIC -IlibImaging -I/usr/include/python2.3 -c Tk/tkImaging.c -o build/temp.linux-i686-2.3/Tk/tkImaging.o Tk/tkImaging.c: In function `TkImaging_Init': Tk/tkImaging.c:198: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible pointer type gcc -pthread -fno-strict-aliasing -DNDEBUG -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -fPIC -IlibImaging -I/usr/include/python2.3 -c _imagingtk.c -o build/temp.linux-i686-2.3/_imagingtk.o gcc -pthread -shared build/temp.linux-i686-2.3/_imagingtk.o build/temp.linux-i686-2.3/Tk/tkImaging.o -LlibImaging -lImaging -ltk8.4 -ltcl8.4 -o build/lib.linux-i686-2.3/_imagingtk.so building '_imagingft' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -fPIC -IlibImaging -I/usr/include/freetype2 -I/usr/include/python2.3 -c _imagingft.c -o build/temp.linux-i686-2.3/_imagingft.o In file included from _imagingft.c:18: /usr/include/freetype2/freetype/freetype.h:20:2: #error "`ft2build.h' hasn't been included yet!" /usr/include/freetype2/freetype/freetype.h:21:2: #error "Please always use macros to include FreeType header files." /usr/include/freetype2/freetype/freetype.h:22:2: #error "Example:" /usr/include/freetype2/freetype/freetype.h:23:2: #error " #include <ft2build.h>" /usr/include/freetype2/freetype/freetype.h:24:2: #error " #include FT_FREETYPE_H" error: command 'gcc' failed with exit status 1 Any pointer would be appreciated. Nils ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Nils W. <nw...@me...> - 2004-07-22 08:17:21
|
Hi all, I am going to build the matplotlib users guide. However python setup.py install failed with the follwoing message gcc -pthread -fno-strict-aliasing -DNDEBUG -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -fPIC -IlibImaging -I/usr/include/python2.3 -c Tk/tkImaging.c -o build/temp.linux-i686-2.3/Tk/tkImaging.o Tk/tkImaging.c: In function `TkImaging_Init': Tk/tkImaging.c:198: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible pointer type gcc -pthread -fno-strict-aliasing -DNDEBUG -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -fPIC -IlibImaging -I/usr/include/python2.3 -c _imagingtk.c -o build/temp.linux-i686-2.3/_imagingtk.o gcc -pthread -shared build/temp.linux-i686-2.3/_imagingtk.o build/temp.linux-i686-2.3/Tk/tkImaging.o -LlibImaging -lImaging -ltk8.4 -ltcl8.4 -o build/lib.linux-i686-2.3/_imagingtk.so building '_imagingft' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -fPIC -IlibImaging -I/usr/include/freetype2 -I/usr/include/python2.3 -c _imagingft.c -o build/temp.linux-i686-2.3/_imagingft.o In file included from _imagingft.c:18: /usr/include/freetype2/freetype/freetype.h:20:2: #error "`ft2build.h' hasn't been included yet!" /usr/include/freetype2/freetype/freetype.h:21:2: #error "Please always use macros to include FreeType header files." /usr/include/freetype2/freetype/freetype.h:22:2: #error "Example:" /usr/include/freetype2/freetype/freetype.h:23:2: #error " #include <ft2build.h>" /usr/include/freetype2/freetype/freetype.h:24:2: #error " #include FT_FREETYPE_H" error: command 'gcc' failed with exit status 1 Any pointer would be appreciated. Nils |
From: Marinescu Bogdan-b. <bog...@fr...> - 2004-07-22 07:02:03
|
Hi John, Thanks for the quick reply, I was really happy to download the snapshot and see that it works. I tested in on wxPython 2.5.1.5 without problems, it would probably work the same on 2.4.2.4. I'm not quite familiar with the toolbar functions, so I don't know if the results I'm getting are right. The "home" button seems to do something, I can see a visual indication of the repaint when I press it. On the other hand, the "pan" button seems to be disabled; even if I can press it, I'm unable to select it (or it isn't supposed to be selectable?) Maybe this is normal for the example that you sent in your e-mail? Because of this, I can't test the functionality of the back/forward buttons. The "zoom to rect" button also seems to be disable, probably because I didn't use the zoom function, which is also related to the "pan" button, if I understand it correctly. The "save" button worked when trying to save a PNG image, but the program exited with a "Do not know know to handle extension *.jpg" message printed on the console when trying to save a JPG image. Again, I don't know if this behavior is correct or not, I'm just posting my results. I don't plan on using the toolbar in my application, I have another (specialized) toolbar and I'll be using its functions. The new event handling mechanism is great and it's exactly what I needed. However, I have a couple of fresh new questions for you :) The first one was also present in my previous e-mail. When I create the plot it has very large margins to the parent frame. This is not convenient to me, as I'd like to have a plot that is as large as possible and margins as small as possible. Is there a way to modify these margins? The other one is really new and it is related to printing. Is there a way to print directly from the library? I'm aware of the image save/image print combo and I can use it if I have no other option. However, at this point my application (which is quite critical) blocks every task switching combination (ctrl+atl+del included, together with alt+tab and all the others) in order to force the user to use this application and ONLY this application. If I choose the "image save" option I'll be forced to give up this feature, and I don't want that, as I _KNOW_ that they'll start to play starcraft in a flash :) Unless there is some Python source somewhere that can send an image to the printer. I've been searching for it, but never found it. I also had this problem with PyPlot, that offers printing functions, but they don't seem to work :( (this was tested on two different printers). Then again, the "Print framework" sample from the wxPython 2.5.1.5 demo also crashed when trying to print, so I imagine that the printing support in wxPython is not at its best at this point :( If anybody has a solution for this, please let me know. Thank you all for your help. Bogdan >>>>> "Bogdan" == Bogdan Marinescu <bogdanal@b.astral.ro> writes: Bogdan> Hello all, First I want to apologize for sending this Bogdan> message to both lists, but I couldn't decide which one is Bogdan> more appropriate and I would like to have an answer as Bogdan> soon as possible. Hi Bogdan, Either list is appropriate for this kind of post. I think the users is slightly better because then other users who may have seen the error will get the benefit of the post and response. cross-posting will not speed up the response, but may delay it :-) Bogdan> I discovered matplotlib some while ago, but it wasn't Bogdan> until recently when I decided to integrate it into one of Bogdan> my programs, trying to replace PyPlot that doesn't have Bogdan> enough features for me. I downloaded and installed version Bogdan> 0.60.2. Your library seemed perfect, until I discovered Bogdan> some strange problems that prevented me from using it as Bogdan> this point :( Specifically, I'm reffering to the Bogdan> embedding_in_wx2.py example that I found in the 'examples' Bogdan> directory. I modified it as follows (sorry for inlining, Bogdan> but I don't know if the listserver accepts any Bogdan> attachements at all, I didn't use it before): Thanks for your example. I was able to trace the segfault (exposed on win32 but not linux in my tests) to agg.tostring_rgb, as you noted. On window maximizing, there was an uncaught memory allocation error because I was allocating on the stack rather than the heap. This is fixed, and your (modified) example now runs fine for me on win32. I've built a snapshot of matplotlib-0.61 for you and uploaded it to http://nitace.bsd.uchicago.edu:8080/files/share/matplotlib-0.61.0a.win32-py2 .3.exe You'll notice a few changes: a new navigation toolbar - see http://sourceforge.net/mailarchive/forum.php?thread_id=5173059&forum_id=3618 7 for a discussion of the new icons, what they do, and how to get the old toolbar if you want it. As before, you can also just comment out the set_toolbar line to remove the toolbar completely. Also, the event handling mechanism has been changed as part of the process of making this more generic and useful. You now call mpl_connect rather than connect and your callback takes a single argument. For example, if you want to know where the user clicks a mouse on your figure, you define a function def click(event): print 'you clicked', event.x, event.y and register this function with the event handler canvas.mpl_connect('button_press_event', click) Then whenever the user clicks anywhere on the figure canvas, your function will be called and passed a matplotlib.backend_bases.MplEvent instance. The event instance has the following attributes defined. name # the event name canvas # the FigureCanvas instance generating the event x # x position - pixels from left of canvas y # y position - pixels from bottom of canvas button # button pressed None, 1, 2, 3 inaxes # the Axes instance if mouse us over axes xdata # x coord of mouse in data coords ydata # y coord of mouse in data coords You can currently connect to the following events: 'button_press_event', button_release_event', 'motion_notify_event' and I plan to add key press. Below is your example, modified to work with 0.61. I fixed the event handling and took out the onpaint connection from init (this did some funky things in my win32 tests) Let me know how it goes: you're the first 0.61 crash test dummy. Anyone else who wants to try this please feel free - the new toolbar only works with GTK* and WX* in this snapshot. #!/usr/bin/env python """ An example of how to use wx or wxagg in an application w. or w/o the toolbar """ import matplotlib matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.backends.backend_wx import NavigationToolbar2Wx from matplotlib.figure import Figure from matplotlib.numerix import arange, sin, pi from wxPython.wx import * class Cursor: def __init__(self, canvas, ax): self.canvas = canvas self.ax = ax def mouse_move(self, event): x, y = event.x, event.y if event.inaxes: ax = event.inaxes minx, maxx = ax.get_xlim() miny, maxy = ax.get_ylim() print 'x=%1.2f, y=%1.2f'%(event.xdata, event.ydata) class CanvasFrame(wxFrame): def __init__(self): wxFrame.__init__(self,None,-1, 'CanvasFrame',size=( 900,900 ) ) self.SetBackgroundColour(wxNamedColor("WHITE")) self.figure = Figure( ) self.axes = self.figure.add_subplot(111) t = arange(0.0,3.0,0.01) s = sin(2*pi*t) c = sin(4*pi*t) p = self.axes.fill(t,s,'b',t,c,'g') p[ 0 ].set_alpha( 0.2 ) p[ 1 ].set_alpha( 0.2 ) #p = self.axes.fill(t,s,'b') #p[ 0 ].set_alpha( 0.2 ) #p[ 1 ].set_alpha( 0.2 ) #self.axes.plot(t,c,'g') self.axes.vlines( [1.5], -1.0, 1.0 ) self.canvas = FigureCanvas(self, -1, self.figure) self.sizer = wxBoxSizer(wxVERTICAL) self.sizer.Add(self.canvas, 1, wxTOP | wxLEFT | wxEXPAND) self.SetSizer(self.sizer) self.SetAutoLayout( True ) self.sizer.Fit( self ) cursor = Cursor(self.canvas, self.axes) #cursor = SnaptoCursor(canvas, ax, t, s) self.canvas.mpl_connect('motion_notify_event', cursor.mouse_move) self.add_toolbar() # comment this out for no toolbar # Capture the paint message #EVT_PAINT(self, self.OnPaint) EVT_SIZE( self, self.OnSize) def add_toolbar(self): self.toolbar = NavigationToolbar2Wx(self.canvas) self.toolbar.Realize() if wxPlatform == '__WXMAC__': # Mac platform (OSX 10.3, MacPython) does not seem to cope with # having a toolbar in a sizer. This work-around gets the buttons # back, but at the expense of having the toolbar at the top self.SetToolBar(self.toolbar) else: # On Windows platform, default window size is incorrect, so set # toolbar width to figure width. tw, th = self.toolbar.GetSizeTuple() fw, fh = self.canvas.GetSizeTuple() # By adding toolbar in sizer, we are able to put it at the bottom # of the frame - so appearance is closer to GTK version. # As noted above, doesn't work for Mac. self.toolbar.SetSize(wxSize(fw, th)) self.sizer.Add(self.toolbar, 0, wxLEFT | wxEXPAND) # update the axes menu on the toolbar self.toolbar.update() def OnSize( self, event ): print "OnSize" print event.GetSize() event.Skip() # event.Skip() class App(wxApp): def OnInit(self): 'Create the main window and insert the custom frame' frame = CanvasFrame() frame.Show(true) return true app = App(0) app.MainLoop() |
From: John H. <jdh...@ac...> - 2004-07-21 22:47:45
|
>>>>> "Bogdan" == Bogdan Marinescu <bogdanal@b.astral.ro> writes: Bogdan> Hello all, First I want to apologize for sending this Bogdan> message to both lists, but I couldn't decide which one is Bogdan> more appropriate and I would like to have an answer as Bogdan> soon as possible. Hi Bogdan, Either list is appropriate for this kind of post. I think the users is slightly better because then other users who may have seen the error will get the benefit of the post and response. cross-posting will not speed up the response, but may delay it :-) Bogdan> I discovered matplotlib some while ago, but it wasn't Bogdan> until recently when I decided to integrate it into one of Bogdan> my programs, trying to replace PyPlot that doesn't have Bogdan> enough features for me. I downloaded and installed version Bogdan> 0.60.2. Your library seemed perfect, until I discovered Bogdan> some strange problems that prevented me from using it as Bogdan> this point :( Specifically, I'm reffering to the Bogdan> embedding_in_wx2.py example that I found in the 'examples' Bogdan> directory. I modified it as follows (sorry for inlining, Bogdan> but I don't know if the listserver accepts any Bogdan> attachements at all, I didn't use it before): Thanks for your example. I was able to trace the segfault (exposed on win32 but not linux in my tests) to agg.tostring_rgb, as you noted. On window maximizing, there was an uncaught memory allocation error because I was allocating on the stack rather than the heap. This is fixed, and your (modified) example now runs fine for me on win32. I've built a snapshot of matplotlib-0.61 for you and uploaded it to http://nitace.bsd.uchicago.edu:8080/files/share/matplotlib-0.61.0a.win32-py2.3.exe You'll notice a few changes: a new navigation toolbar - see http://sourceforge.net/mailarchive/forum.php?thread_id=5173059&forum_id=36187 for a discussion of the new icons, what they do, and how to get the old toolbar if you want it. As before, you can also just comment out the set_toolbar line to remove the toolbar completely. Also, the event handling mechanism has been changed as part of the process of making this more generic and useful. You now call mpl_connect rather than connect and your callback takes a single argument. For example, if you want to know where the user clicks a mouse on your figure, you define a function def click(event): print 'you clicked', event.x, event.y and register this function with the event handler canvas.mpl_connect('button_press_event', click) Then whenever the user clicks anywhere on the figure canvas, your function will be called and passed a matplotlib.backend_bases.MplEvent instance. The event instance has the following attributes defined. name # the event name canvas # the FigureCanvas instance generating the event x # x position - pixels from left of canvas y # y position - pixels from bottom of canvas button # button pressed None, 1, 2, 3 inaxes # the Axes instance if mouse us over axes xdata # x coord of mouse in data coords ydata # y coord of mouse in data coords You can currently connect to the following events: 'button_press_event', button_release_event', 'motion_notify_event' and I plan to add key press. Below is your example, modified to work with 0.61. I fixed the event handling and took out the onpaint connection from init (this did some funky things in my win32 tests) Let me know how it goes: you're the first 0.61 crash test dummy. Anyone else who wants to try this please feel free - the new toolbar only works with GTK* and WX* in this snapshot. #!/usr/bin/env python """ An example of how to use wx or wxagg in an application w. or w/o the toolbar """ import matplotlib matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.backends.backend_wx import NavigationToolbar2Wx from matplotlib.figure import Figure from matplotlib.numerix import arange, sin, pi from wxPython.wx import * class Cursor: def __init__(self, canvas, ax): self.canvas = canvas self.ax = ax def mouse_move(self, event): x, y = event.x, event.y if event.inaxes: ax = event.inaxes minx, maxx = ax.get_xlim() miny, maxy = ax.get_ylim() print 'x=%1.2f, y=%1.2f'%(event.xdata, event.ydata) class CanvasFrame(wxFrame): def __init__(self): wxFrame.__init__(self,None,-1, 'CanvasFrame',size=( 900,900 ) ) self.SetBackgroundColour(wxNamedColor("WHITE")) self.figure = Figure( ) self.axes = self.figure.add_subplot(111) t = arange(0.0,3.0,0.01) s = sin(2*pi*t) c = sin(4*pi*t) p = self.axes.fill(t,s,'b',t,c,'g') p[ 0 ].set_alpha( 0.2 ) p[ 1 ].set_alpha( 0.2 ) #p = self.axes.fill(t,s,'b') #p[ 0 ].set_alpha( 0.2 ) #p[ 1 ].set_alpha( 0.2 ) #self.axes.plot(t,c,'g') self.axes.vlines( [1.5], -1.0, 1.0 ) self.canvas = FigureCanvas(self, -1, self.figure) self.sizer = wxBoxSizer(wxVERTICAL) self.sizer.Add(self.canvas, 1, wxTOP | wxLEFT | wxEXPAND) self.SetSizer(self.sizer) self.SetAutoLayout( True ) self.sizer.Fit( self ) cursor = Cursor(self.canvas, self.axes) #cursor = SnaptoCursor(canvas, ax, t, s) self.canvas.mpl_connect('motion_notify_event', cursor.mouse_move) self.add_toolbar() # comment this out for no toolbar # Capture the paint message #EVT_PAINT(self, self.OnPaint) EVT_SIZE( self, self.OnSize) def add_toolbar(self): self.toolbar = NavigationToolbar2Wx(self.canvas) self.toolbar.Realize() if wxPlatform == '__WXMAC__': # Mac platform (OSX 10.3, MacPython) does not seem to cope with # having a toolbar in a sizer. This work-around gets the buttons # back, but at the expense of having the toolbar at the top self.SetToolBar(self.toolbar) else: # On Windows platform, default window size is incorrect, so set # toolbar width to figure width. tw, th = self.toolbar.GetSizeTuple() fw, fh = self.canvas.GetSizeTuple() # By adding toolbar in sizer, we are able to put it at the bottom # of the frame - so appearance is closer to GTK version. # As noted above, doesn't work for Mac. self.toolbar.SetSize(wxSize(fw, th)) self.sizer.Add(self.toolbar, 0, wxLEFT | wxEXPAND) # update the axes menu on the toolbar self.toolbar.update() def OnSize( self, event ): print "OnSize" print event.GetSize() event.Skip() # event.Skip() class App(wxApp): def OnInit(self): 'Create the main window and insert the custom frame' frame = CanvasFrame() frame.Show(true) return true app = App(0) app.MainLoop() |
From: John H. <jdh...@ac...> - 2004-07-21 21:24:15
|
>>>>> "Gregory" == Gregory Lielens <gre...@ff...> writes: Gregory> I am sure there is better solutions, but Gregory> title(r"$\delta^{15}N \ and \ Trophic \ Level \ for \ %s Gregory> \ Food \ Web$"%name) should already be close to what you Gregory> want: "\ " add a space and the name is inserted in the You may want to consider also using the roman font for the non-math text from matplotlib.matlab import * plot([1,2,3]) name = 'John' title(r"$\delta^{15}N\ \rm{and\ Trophic\ Level\ for\ %s\ Food\ Web}$"%name) show() FYI: There are other spacing commands '\ ' : normal space, 30% of fontsize '\/' : small space, 10% of fontsize \hspace{frac} : user specified fraction of fontsize See http://matplotlib.sourceforge.net/matplotlib.mathtext.html for more info. Gregory> classic python way (replace %s in the string by the Gregory> string appearing after the % operator...) Now I wonder Gregory> if mixing Tex math expression and normal text expression Gregory> is possible, something like: title(r"$\delta^{15}N$ and Gregory> Trophic Level for %s Food Web"%name) Advantange would be Gregory> to use classic font for non-math part, as done in Tex... Gregory> This does not seems to work in matplotlib 0.54.2, but Gregory> maybe in 0.60.2? Or in future version? ;-) It doesn't work now (see link above). It may be included in a future version. Wouldn't be too hard.... One problem with the approach above is that mathtext doesn't currently use kerning data, so roman strings like \rm{and \ Trophic \ Level \ for \ %s \ Food\ Web} have nonideal interletter spacing. Kerning is on the list of things to do, which would make the solution above pretty good. I agree that allowing nested "some string $subexpr$" would be better. JDH |
From: Gregory L. <gre...@ff...> - 2004-07-21 20:32:40
|
I am sure there is better solutions, but title(r"$\delta^{15}N \ and \ Trophic \ Level \ for \ %s \ Food \ Web$"%name) should already be close to what you want: "\ " add a space and the name is inserted in the classic python way (replace %s in the string by the string appearing after the % operator...) Now I wonder if mixing Tex math expression and normal text expression is possible, something like: title(r"$\delta^{15}N$ and Trophic Level for %s Food Web"%name) Advantange would be to use classic font for non-math part, as done in Tex... This does not seems to work in matplotlib 0.54.2, but maybe in 0.60.2? Or in future version? ;-) Regards, Greg. |
From: Jim B. <jb...@se...> - 2004-07-21 20:05:16
|
On Wed, 21 Jul 2004, Carla A. Ng wrote: > > Anyone out there know a command to manually add a space? Is there > something equivalent to \t or \n? > The tex equivalent is a \ (backslash with a space after it) Jim |
From: Carla A. N. <c-...@no...> - 2004-07-21 19:47:07
|
Hi, I'm having the worst time formatting my plot title in Python using matplotlib. I want the title to read "delta^15N and TL for" name "food web" where delta should be the greek symbol, 15 should be superscript, and the title takes the user-supplied string variable, name, and adds it in to the string. From what I've tried, I can either get the symbol/superscript formatting correct and lose all the rest of the text (or have it squished together with no whitespace) or no math formatting at all. This is the best I've been able to do: title(r'$\delta^{15}N and Trophic Level for Food Web$') which gives me a good result, but no whitespace and no way to add in the file name on the fly. (This is a program that processes a file you give it and gives you a plot of the results) Anyone out there know a command to manually add a space? Is there something equivalent to \t or \n? Thanks! Carla A. Ng =================================== Northwestern University Department of Chemical and Biological Engineering 2145 North Sheridan Road Evanston, IL 60208 Phone: (847)467-4980 Fax: (847)491-4011 =================================== "When one tugs at a single thing in nature, he finds it attached to the rest of the world." -- John Muir |
From: Bogdan M. <bogdanal@b.astral.ro> - 2004-07-21 18:17:13
|
Hello all, First I want to apologize for sending this message to both lists, but I couldn't decide which one is more appropriate and I would like to have an answer as soon as possible. I discovered matplotlib some while ago, but it wasn't until recently when I decided to integrate it into one of my programs, trying to replace PyPlot that doesn't have enough features for me. I downloaded and installed version 0.60.2. Your library seemed perfect, until I discovered some strange problems that prevented me from using it as this point :( Specifically, I'm reffering to the embedding_in_wx2.py example that I found in the 'examples' directory. I modified it as follows (sorry for inlining, but I don't know if the listserver accepts any attachements at all, I didn't use it before): ================================================================= #!/usr/bin/env python """ An example of how to use wx or wxagg in an application w. or w/o the toolbar """ from matplotlib.numerix import arange, sin, pi import matplotlib # uncomment the following to use wx rather than wxagg #matplotlib.use('WX') #from matplotlib.backends.backend_wx import FigureCanvasWx as FigureCanvas # comment out the following to use wx rather than wxagg matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.figure import Figure from wxPython.wx import * class Cursor: def __init__(self, canvas, ax): self.canvas = canvas self.ax = ax def mouse_move(self, widget, event): height = self.ax.figure.bbox.height() x, y = event.x, height-event.y if self.ax.in_axes(x, y): # transData transforms data coords to display coords. Use # the inverse method to transform back to data coords then # update the line # the cursor position x, y = self.ax.transData.inverse_xy_tup( (x,y) ) # the view limits minx, maxx = self.ax.viewLim.intervalx().get_bounds() miny, maxy = self.ax.viewLim.intervaly().get_bounds() print 'x=%1.2f, y=%1.2f'%(x,y) class CanvasFrame(wxFrame): def __init__(self): wxFrame.__init__(self,None,-1, 'CanvasFrame',size=( 900,900 ) ) self.SetBackgroundColour(wxNamedColor("WHITE")) self.figure = Figure( ) self.axes = self.figure.add_subplot(111) t = arange(0.0,3.0,0.01) s = sin(2*pi*t) c = sin(4*pi*t) p = self.axes.fill(t,s,'b',t,c,'g') p[ 0 ].set_alpha( 0.2 ) p[ 1 ].set_alpha( 0.2 ) #p = self.axes.fill(t,s,'b') #p[ 0 ].set_alpha( 0.2 ) #p[ 1 ].set_alpha( 0.2 ) #self.axes.plot(t,c,'g') self.axes.vlines( [1.5], -1.0, 1.0 ) self.canvas = FigureCanvas(self, -1, self.figure) self.sizer = wxBoxSizer(wxVERTICAL) self.sizer.Add(self.canvas, 1, wxTOP | wxLEFT | wxEXPAND) self.SetSizer(self.sizer) self.SetAutoLayout( True ) # self.Fit() self.sizer.Fit( self ) cursor = Cursor(self.canvas, self.axes) #cursor = SnaptoCursor(canvas, ax, t, s) self.canvas.connect('motion_notify_event', cursor.mouse_move) #self.add_toolbar() # comment this out for no toolbar # Capture the paint message EVT_PAINT(self, self.OnPaint) EVT_SIZE( self, self.OnSize) def add_toolbar(self): self.toolbar = NavigationToolbar(self.canvas, True) self.toolbar.Realize() if wxPlatform == '__WXMAC__': # Mac platform (OSX 10.3, MacPython) does not seem to cope with # having a toolbar in a sizer. This work-around gets the buttons # back, but at the expense of having the toolbar at the top self.SetToolBar(self.toolbar) else: # On Windows platform, default window size is incorrect, so set # toolbar width to figure width. tw, th = self.toolbar.GetSizeTuple() fw, fh = self.canvas.GetSizeTuple() # By adding toolbar in sizer, we are able to put it at the bottom # of the frame - so appearance is closer to GTK version. # As noted above, doesn't work for Mac. self.toolbar.SetSize(wxSize(fw, th)) self.sizer.Add(self.toolbar, 0, wxLEFT | wxEXPAND) # update the axes menu on the toolbar self.toolbar.update() def OnPaint(self, event): # self.canvas.draw() print "OnPaint" # if type( event ) == type( wxEvent ): event.Skip() def OnSize( self, event ): print "OnSize" print event.GetSize() event.Skip() # event.Skip() class App(wxApp): def OnInit(self): 'Create the main window and insert the custom frame' frame = CanvasFrame() frame.Show(true) return true app = App(0) app.MainLoop() ================================================================= The example shows just fine at first, but when I try to resize the windows it crashes (note that the original example also crashed under the same conditions). By "crashes" I mean that it exits with an unhandled exception, and Windows shows that the error is in _backend_agg.pyd. It also crashes if I change the initial figure size in .matplotlibrc (when changing figure.figsize from 8, 6 to 10, 10). I tried running in with Python 2.3.2 and Python 2.3.4, with wxPython 2.4.2.4 and wxPython 2.5.1.5, but the result was the same. I inserted some debug statements in backend_wxagg.py and it seems that the crash is in 's = agg.tostring_rgb()', the program doesn't reach the line after this call. I modified the above code in a number of ways (including changing the code for OnPaint and OnSize as the documentation is not clear at all about their role and I don't know what I should do in these handlers), but I was unable to solve the problem. Note that the same example works fine with the simple WX backend, but this is no option for me, as I would really need alpha blending, and antialiasing wouldn't hurt too. Also, I need help with the initial plot size. When I create the plot it has very large margins to the parent frame. This is not convenient to me, as I'd like to have a plot that is as large as possible and margins as small as possible. Is there a way to modify these margins? Thank you for your patience in reading this e-mail and please help me if you can. I'm not subscribed to either matplotlib-users or matplotlib-devel, so please send your replies with a copy to bogdanal@b.astral.ro, or at least let me know if I need to be subscribed to the list in order to receive your answers regarding this issue. Thank you very much for your help. Bogdan Marinescu |
From: John H. <jdh...@ac...> - 2004-07-21 17:32:09
|
>>>>> "Vineet" == Vineet Jain <vi...@al...> writes: Vineet> is there a formula which will always convert a image Vineet> resolution (x pixels by y pixles) to inches, dpi I'm Vineet> assuming that there are some contraints to how high and Vineet> low dpi can go. How and what are those contraints. There are no formal constraints. If you set the dpi too high you eill eventually run out of memory. I suppose dpi<1 is undefined :-). Typical screen dpis are 72 and 96. If you want the screen size the be accurate in inches, you need to make the dpi setting correspond to the actual pixels per inch on the monitor. matplotlib does not currently support different horizontal and vertical dpis (many monitors have different resolutions in the horizontal and vertical dimensions). It wouldn't be hard to add, but last time I suggested it on the list noone was interested. Here is an example to set the figure size in inches given pixel dimensions and dpi from __future__import division # do float division pixw, pixh = 640, 680 dpi = 96 winch = pixw/dpi # width in inches is pixel width / dpi hinch = pixh/dpi # height in inches is pixel height / dpi fig = figure(figsize=(winch, hinch), dpi=dpi) This is what backend_gtk does after a figure resize - I have to conver the pixel dimensions to inches. You can change an existing figure's size, if necessary, with fig.set_figsize_inches(winch, hinch) Hope this helps, JDH |
From: John H. <jdh...@ac...> - 2004-07-21 17:26:13
|
>>>>> "Vineet" == Vineet Jain <vi...@al...> writes: Vineet> Thanks for the information. It has been very Vineet> helpful. Matplotlib seems to be ignoring the use Vineet> command. When I change the value in .matplotlibrc it works Vineet> however adding the use('Agg') does not change the Vineet> backed. Do I need to do anything else? You must use the use command before importing matplotlib.matlab, as described on http://matplotlib.sourceforge.net/backends.html >>> import matplotlib >>> matplotlib.use('Agg') >>> from matplotlib.matlab import * Note that if you are using an IDE like pycrust, pythonwin, or IDLE, matplotlib.matlab may have already been loaded, and subsequent calls to use or 'from matplotlib.matlab import *' will have no effect unless you explicitly force a module reload. JDH |
From: Paul B. <ba...@st...> - 2004-07-21 12:53:39
|
Michael Oevermann wrote: > I am having the same problem as reported by Serge Barrel on 2004-07-16. > Mathtext works fine on the GUI and e.g. PNG format, but the PS and EPS > backend > brings out the raw LaTeX string. > > I am using matplotlib 0.60.2 on Mac Os X 10.3.4. > > Any ideas how to fix the problem? Yes. Use the updated files in CVS. Or use the two attached python files. -- Paul -- Paul Barrett, PhD Space Telescope Science Institute Phone: 410-338-4475 ESS/Science Software Branch FAX: 410-338-4767 Baltimore, MD 21218 |
From: Vineet J. <vi...@al...> - 2004-07-21 11:02:50
|
is there a formula which will always convert a image resolution (x pixels by y pixles) to inches, dpi I'm assuming that there are some contraints to how high and low dpi can go. How and what are those contraints. This is needed since the charting package, that I'm migrating from, used pixels to detemine the size of the chart. Vineet |
From: Michael O. <mic...@tu...> - 2004-07-21 09:45:02
|
I am having the same problem as reported by Serge Barrel on 2004-07-16. Mathtext works fine on the GUI and e.g. PNG format, but the PS and EPS=20= backend brings out the raw LaTeX string. I am using matplotlib 0.60.2 on Mac Os X 10.3.4. Any ideas how to fix the problem? ------------------------------------------------------- Michael Oevermann Technische Universit=E4t Berlin Institut f=FCr Energietechnik Fasanenstr. 89, 10623 Berlin, Germany Phone: +49 (0) 30 314 22452 Fax: +49 (0) 30 314 22157 mailto: mic...@tu... -------------------------------------------------------= |
From: Vineet J. <vi...@al...> - 2004-07-21 04:20:44
|
I'm adding a moving average to a finance chart. I currently am doing the following: ma20 = movavg_function(open_price_bars, 20) axMiddle.plot(vind, ma5, 'b', linewidth=1) The problem is that because there are missing data elelments for the underlying time series data the moving average for some days is also missing values. I have a special moving average function which allows for gaps (or missing) values. Is there any way (by modifying) plot that if axMiddle.plot comes across a missing value (in my case market by -1, but could be anythin) then it does not plot that particular data point. One solution would obviously be to scan the moving average and construct a new index list for all points which have valid data. Is there another option by modifying the underlying axes.plot function? Vineet |
From: Vineet J. <vi...@al...> - 2004-07-21 04:15:37
|
Thanks for the information. It has been very helpful. Matplotlib seems to be ignoring the use command. When I change the value in .matplotlibrc it works however adding the use('Agg') does not change the backed. Do I need to do anything else? Thanks, Vineet -----Original Message----- From: mat...@li... [mailto:mat...@li...]On Behalf Of John Hunter Sent: Tuesday, July 20, 2004 9:15 AM To: Vineet Jain Cc: mat...@li... Subject: Re: [Matplotlib-users] How to run matplotlib in batch mode to generate plot image files >>>>> "Vineet" == Vineet Jain <vi...@al...> writes: Vineet> 1. I added the following at the end of the script just Vineet> before show savefig("filename") Vineet> It works however the intereactive mode still comes up. How Vineet> can I generate the image file without having the Vineet> interactive window come up. Hi Vineet, This is because you are using the TkAgg backend. This is the default backend for win32 users. You set the default backend in your .matplotlibrc file, which is located in C:\python23\share\matplotlib\.matplotlibrc for a standard win32 install. For pure image generation, you probably want to choose Agg as the default backend. There are a number of ways of setting the backend at runtime, as described at http://matplotlib.sourceforge.net/backends.html Vineet> 2. figure(1, facecolor=figBG) What is this used for? Is it Vineet> for the interactive charting? I can still generate charts Vineet> to file with this commented. Here is a little background. You can use the functions figure, subplot, and axes to explicitly control this figure and axes creation. If you don't use them, defaults will be issued for you. Let's take a look at what happens under the hood when you issue the commands >>> from matplotlib.matlab import * >>> plot([1,2,3]) When plot is called, the matlab interface makes a call to gca() "get current axes" to get a reference to the current axes. gca in turn, makes a call to gcf() to get a reference to the current figure. gcf, finding that no figure has been created, creates the default figure with figure() and returns it. gca will then return the current axes of that figure if it exists, or create the default axes subplot(111) if it does not. Thus the code above is equivalent to >>> from matplotlib.matlab import * >>> figure() >>> subplot(111) >>> plot([1,2,3]) The only time you need to manually call figure, subplot and axes are when 1) you want to manage multiple figures and axes, or 2) you want to change the default parameters (sizes, locations, colors, etc). Vineet> 3. Where and how do you set the overall size of the chart Vineet> ( in inches or pixels) The figsize kwarg to figure sets the figure size in inches. The dpi specifies the dots per inch. The figure width in pixels is thus the figsize width component time the dpi. You can set these as kwargs to the figure command - see http://matplotlib.sf.net/matplotlib.matlab.html#-figure or by setting the defaults in your rc file in the section ### FIGURE figure.figsize : 8, 6 # figure size in inches figure.dpi : 80 # figure dots per inch figure.facecolor : 0.75 # figure facecolor; 0.75 is scalar gray figure.edgecolor : w # figure edgecolor; w is white Note that the rc allows different defaults for savefig, which are given by savefig.dpi : 100 # figure dots per inch savefig.facecolor : w # figure facecolor; 0.75 is scalar gray savefig.edgecolor : w # figure edgecolor; w is white Cheers, JDH ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Curtis C. <cu...@hi...> - 2004-07-20 18:58:48
|
Hi all, I have a fix for the problem mentioned. In the latest release, subdir matploblib-0.60.2/matplotlib/matlab.py line 542 there is a bug. It should read: cax.set_yticklabels([tickfmt%tick for tick in cticks]) instead of cax.set_yticklabels(['%1.1f'%tick for tick in cticks]) so as to take advantage of the optional input parameter tickfmt (format specifier) for the colorbar labels. With this change, the colorbar labels come out fine and adjust properly according to the input format specifier. Thanks, Curtis |
From: John H. <jdh...@ac...> - 2004-07-20 14:49:18
|
>>>>> "Malte" =3D=3D Malte Marquarding <Mal...@cs...> write= s: Malte> Hi, I am trying to use a script interacively. It basically Malte> needs to do the following. Malte> * do some work * plot() * Ask whether to keep the data Malte> plotted or not etc. Malte> This should be done (initially) at the command line using Malte> raw_read(). I don't want to close the plot window to get Malte> back to the prompt. In terms of a GUI this would be easy Malte> as the dialog would run in the same thread as the plot Malte> window. But interactive.py doesn't seem to be the Malte> solution. The best solution for interactive plots is to use the tkagg backend with interactive set to True in your rc file. Use a standard python shell or better yet, ipython. Ie, your rc file should have the settings backend : TkAgg # the default backend interactive : True =20 You can then plot interactively from the shell, and get your prompt back after each command. Fernando Perez has made some preliminary extensions for ipython to support interactive use of matplotlib for TkAgg and may be making an extension for GTKAgg. Very nice for interactive use. Available from http://ipython.scipy.org/ For the 'pylab' extensiosn, save the two files included at the end of this email to your ~/.ipython dir and start ipython with > ipython -p pylab Malte> BTW, I am running 0.54.2 as I can't get 0.60.2 to compile Malte> under debian stable. Please build with=20 > python setup.py build > build.out=20 and post the results to the matplotlib-devel list. Cheers, JDH ### begin pylab # -*- Mode: Shell-Script -*- Not really, but it shows comments correctly #************************************************************************= *** # Configuration file for ipython -- ipythonrc format # # The format of this file is one of 'key value' lines. # Lines containing only whitespace at the beginning and then a # are igno= red # as comments. But comments can NOT be put on lines with data. #************************************************************************= *** # If this file is found in the user's ~/.ipython directory as ipythonrc-p= ylab, # it can be loaded by calling passing the '-profile pylab' (or '-p pylab'= ) # option to IPython. # This profile load modules which turn IPython into a very capable enviro= nment # for numerical work, as compatible with Matlab as possible. # Load the user's basic configuration include ipythonrc # Load all additional matlab-like functionality from Numeric and matplotl= ib execfile matplotlib_load.py ### end pylab ### begin matplotlib_load.py # -*- coding: iso-8859-1 -*- """matlab-like functionality based on matplotlib and Numeric's MLab. Load these modules and configure them for interactive use""" #************************************************************************= ***** # Copyright (C) 2004 Fernando P=C3=A9rez. <fp...@co...> # # Distributed under the terms of the GNU Lesser General Public License (= LGPL) # # This code is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # The full text of the LGPL is available at: # # http://www.gnu.org/copyleft/lesser.html #************************************************************************= ***** __author__ =3D 'Fernando P=C3=A9rez. <fp...@co...>' __license__=3D 'LGPL' # Set matplotlib in interactive mode with the TkAgg backend # THESE MUST BE THE FIRST MATPLOTLIB COMMANDS CALLED! import matplotlib matplotlib.use('TkAgg') matplotlib.interactive(True) # Now we can continue... # Load these by themselves so that 'help MODULE' works import matplotlib.matlab as matlab # MA (MaskedArray) modifies the Numeric printing mechanism so that huge a= rrays # are only summarized and not printed (which could freeze the machine for= a # _long_ time). import MA # Bring all of the numeric and plotting commands to the toplevel namespac= e from IPython.numutils import * from matplotlib.matlab import * print """Welcome to pylab, a matlab-like python environment. help(Numeric) -> help on NumPy, Python's basic numerical library. help(matlab) -> help on matlab compatible commands from matplotlib. help(plotting) -> help on plotting commands. """ ### end matplotlib_load.py |
From: John H. <jdh...@ac...> - 2004-07-20 14:38:54
|
>>>>> "Vineet" == Vineet Jain <vi...@al...> writes: Vineet> 1. I added the following at the end of the script just Vineet> before show savefig("filename") Vineet> It works however the intereactive mode still comes up. How Vineet> can I generate the image file without having the Vineet> interactive window come up. Hi Vineet, This is because you are using the TkAgg backend. This is the default backend for win32 users. You set the default backend in your .matplotlibrc file, which is located in C:\python23\share\matplotlib\.matplotlibrc for a standard win32 install. For pure image generation, you probably want to choose Agg as the default backend. There are a number of ways of setting the backend at runtime, as described at http://matplotlib.sourceforge.net/backends.html Vineet> 2. figure(1, facecolor=figBG) What is this used for? Is it Vineet> for the interactive charting? I can still generate charts Vineet> to file with this commented. Here is a little background. You can use the functions figure, subplot, and axes to explicitly control this figure and axes creation. If you don't use them, defaults will be issued for you. Let's take a look at what happens under the hood when you issue the commands >>> from matplotlib.matlab import * >>> plot([1,2,3]) When plot is called, the matlab interface makes a call to gca() "get current axes" to get a reference to the current axes. gca in turn, makes a call to gcf() to get a reference to the current figure. gcf, finding that no figure has been created, creates the default figure with figure() and returns it. gca will then return the current axes of that figure if it exists, or create the default axes subplot(111) if it does not. Thus the code above is equivalent to >>> from matplotlib.matlab import * >>> figure() >>> subplot(111) >>> plot([1,2,3]) The only time you need to manually call figure, subplot and axes are when 1) you want to manage multiple figures and axes, or 2) you want to change the default parameters (sizes, locations, colors, etc). Vineet> 3. Where and how do you set the overall size of the chart Vineet> ( in inches or pixels) The figsize kwarg to figure sets the figure size in inches. The dpi specifies the dots per inch. The figure width in pixels is thus the figsize width component time the dpi. You can set these as kwargs to the figure command - see http://matplotlib.sf.net/matplotlib.matlab.html#-figure or by setting the defaults in your rc file in the section ### FIGURE figure.figsize : 8, 6 # figure size in inches figure.dpi : 80 # figure dots per inch figure.facecolor : 0.75 # figure facecolor; 0.75 is scalar gray figure.edgecolor : w # figure edgecolor; w is white Note that the rc allows different defaults for savefig, which are given by savefig.dpi : 100 # figure dots per inch savefig.facecolor : w # figure facecolor; 0.75 is scalar gray savefig.edgecolor : w # figure edgecolor; w is white Cheers, JDH |
From: John H. <jdh...@ac...> - 2004-07-20 14:27:55
|
>>>>> "Darren" == Darren Dale <dd...@co...> writes: Darren> Hi everyone, Now that I have become an intermediate python Darren> programmer, I want to learn how to build some GUIs. I am Darren> trying to decide between WX and GTK, and was hoping to get Darren> input from this list specifically. There is some information here - http://matplotlib.sourceforge.net/faq.html#WHICHBACKEND Here's my 2c Use a *Agg backend, either TkAgg, WXAgg or GTKAgg. This way you'll always be assured of having the most complete feature set. All produce identical figures since they use Agg. Of those three, there are tradeoffs. GTK A great choice if your deploying on linux and win32 only. A word of caution thought: win32 support is becoming more problematic now that dropline gtk runtime installers are no longer supported. OS X is more difficult unless your users use fink. Steve Chaplin maintains the GTK backend and is very active keeping the code consistent with different pygtk releases etc. The application I develop with matplotlib uses GTKAgg, so yes, developer support is good. I primarily develop this application on linux and deploy on win32 (all my users only know windows) and it has been quite successful and non-problematic. GTKAgg is also currently the fastest backend for dynamic (animated) images. Tk A good choice if you want the greatest likelihood of it working across all platforms with minimal extra dependencies. Excellent support from Todd Miller and stsci. The only two downsides, in my opinion, are 1) that the widgets aren't so nice and 2) TkAgg is a bit slow (1.5-3x slower than GTKAgg) for dynamic images because the transfer from agg to the tk canvas is slow - this is mostly out of our control. WX As you noted a very popular platform, native widgets, etc. Can be a tough install on OS X and linux, but works great for win32 (eg enthought edition). Support is a problem with no active maintainer, though I do what I can. If you use WXAgg, support is less of a problem since the widget interface is fairly stable. If you need dynamic images, this will currently be slower than GTKAgg since I use string methods to transfer the agg image buffer to the wx canvas, but at some point I would like to write some wx extension code for this purpose. A number of people with good knowledge of matplotlib internals use wx for application development and I think are fairly satisfied. FLTK Gregory Lielens has developed a FLTK backend, though it is not yet in CVS. Early reports are that it is quite fast, as we would hope, from the name. JDH |
From: John H. <jdh...@ac...> - 2004-07-20 14:08:19
|
>>>>> "Stephen" == Stephen Walton <ste...@cs...> writes: Stephen> On Mon, 2004-07-19 at 10:28, John Hunter wrote: >> As for resetting the axes to the original view, redraw would >> not have done that. In the next generation toolbar, I might be >> able to add a button to support that. It already has a forward >> / back button to navigate between previous views. Stephen> Er, it does? I don't see them, at least not with either Stephen> the default backend on FC1, which I'm guessing is GTK, Stephen> nor with the TkAgg one. Sorry for the confusion - when I sat "it already has...", I'm referring to the next generation toolbar that is under development in CVS. Only GTK and GTKAgg have a prototype version of the new toolbar in CVS. For the record, the default backend in the src distributions (*.tar.gz and *.zip) is GTKAgg. For win32, the default backend in TkAgg. Stephen> Incidentally, the on line .matplotlibrc example file Stephen> still has the "toolbar" keyword, which is gone, and is Stephen> missing the "datapath" one. Which rc file are you referring to? There is no reference to the toolbar option in the 0.60.2 release, though it is in CVS and on the web (should fix that one, though it is listed as experimental). The datapath was intentionally omitted - it exists for those who want use it to set the data path but for most users the default is OK. I just changed this in my dev tree to include a commented out reference to it to alert users that it is there. Thanks, JDH |
From: Wilson, G. <gre...@hp...> - 2004-07-20 13:59:09
|
Hi everyone. Hope you don't mind mail out of the blue, but I've just discovered matplotlib, and am hoping to use it to plot some time series data (progress of our project over time). One thing I can't seem to find is a way to control the format and content of the tick labels on the X and Y axes. The data I have is monthly from 1999 to the present, so I'd like to set X tick labels to be "1999-Jan", "-Feb", and so on. I tried following the link in the tutorial to "figure.html#Axes", but it 404'd, and my experiments using "set(gca(), 'xticklabels', [...stuff...])" are not doing what I'd hoped. Similarly, the Y data runs from -600 to about +24,000 (yes, some months we go backward ;-). Right now, matplotlib is switching to scientific notation when it hits 1.000e+04 (10,000). Any hints? Thanks, Greg Wilson Hewlett-Packard=20 |