[Matplotlib-users] AXES properties
BTW: I tried to use set_position to change the position of the axes label as suggested by previous posting. No effect. - Original Message Hello, I am creating a plot with multiple y-axis (up to 6) and twinx works pretty well. The problem is that there are too much wasted spaces used up by the axes. Since I have multiple axes, it cuts into the amount of space available for the plot area. I need to know how I can squeeze some spaces out of the standard axes. First thing I discovered was that I can rotate the tick labels to vertical by: plt.setp(ax.major_ticklabels, rotation=vertical) where ax is my y-axis. But then: (1) How to reduce the space between the tick and the axes label? First I tried to place the label on top but couldn't get that to work. Then I tried to change the position property of the axis label object and that have no effect. So, can somebody please tell me how I can do these 2 things? (2) How to avoid overlapping tick labels? With the way the standard x and y axis are drawn, after I do a vertical rotate of the y tick labels, the first y tick label overlaps with the last x tick label since they are both center aligned. Is there any way to change the alignment of only the first and last tick labels of an axes (while keeping the rest center aligned)? Thanks, -- John Henry -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] AXES properties
Hello, I am creating a plot with multiple y-axis (up to 6) and twinx works pretty well. The problem is that there are too much wasted spaces used up by the axes. Since I have multiple axes, it cuts into the amount of space available for the plot area. I need to know how I can squeeze some spaces out of the standard axes. First thing I discovered was that I can rotate the tick labels to vertical by: plt.setp(ax.major_ticklabels, rotation=vertical) where ax is my y-axis. But then: (1) How to reduce the space between the tick and the axes label? First I tried to place the label on top but couldn't get that to work. Then I tried to change the position property of the axis label object and that have no effect. So, can somebody please tell me how I can do these 2 things? (2) How to avoid overlapping tick labels? With the way the standard x and y axis are drawn, after I do a vertical rotate of the y tick labels, the first y tick label overlaps with the last x tick label since they are both center aligned. Is there any way to change the alignment of only the first and last tick labels of an axes (while keeping the rest center aligned)? Thanks, -- John Henry -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] MatPlotLib + Py2exe, backend problems ...
I *finally* got this to work!!! Thanks to Werner's message, I found the culpit: the matplotlibrc file copied to the dist directory contains the TkAgg backend. All I had to do is to change *that* file to say: backend : WXAgg Note that it's not the matplotlibrc in the installed copy - but the one in the resulting dist directory. In addition, I have to do a: set MATPLOTLIBDATA=.\mpl-data before I start the exe file. I don't know why this is necessary because the code for _get_data_path appears to look at that directory by default but if I don't set this, it can't find the data files. In any event, it works now - after bumping head for 2 weeks! Thanks everybody. -Original Message- From: Werner F. Bruhin [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 20, 2008 1:45 AM To: [EMAIL PROTECTED] Cc: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] MatPlotLib + Py2exe, backend problems ... Hi, [EMAIL PROTECTED] wrote: So, do I understand this correctly: In order to get rid of the Tkinter problem when building a matplotlib application using py2exe, I need 0.91.2 ver of matplotlib and use the setup.cfg file to select the backend I want (wxpython in my case). Then run py2exe to build the ap. Correct? I haven't tried it with 0.91.x but with 0.90 I used a matplotlib exe installer for Windows and I can create a distribution of my application with py2exe which does NOT contain tkinter. But then, as I posted earlier, this create a new problem for me in that py2exe says it can't find wxmsw26uh_vc.dll - even though the file exists. That dll should no longer be needed by matplotlib. Obviously if you use a wxPython build you will get the it, i.e. I am on 2.8 so I have a bunch of wxmsw26uh???.dll files in my dist folder. What I need is a version of 0.91.2 ver of matplotlib that works with Python 2.3 to see if that works, or I guess I would include Tkinter with my exe? There was another message from Stef which might be the explanation, the default matplotlibrc file is defining TKAgg as the default backend, so change it to the following: backend : WXAgg numerix : numpy # numpy, Numeric or numarray Werner -- John Henry - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] MatPlotLib + Py2exe, backend problems ...
Ok, I know what the problem is. I was using a sample setup.py posted by Stef and in his setup, he created a mpl-data subdirectory under dist to store all of the data files use by matplotlib. That's why matplotlib couldn't find it without a set statement. After changing the name to matplotlibdata, everything works. I also made changes to every one of the matplotlibrc file I found in the installed copy of matplotlib to invoke WXAgg - instead of TkAgg. So for completeless, may be this will benefit other matplotlib users, here's my py2exe script - tested using python 2.3, latest wxpython and so forth. Let say you wish to create an exe of the sample multicolor.py program. Place multicolor.py in a test\multicolor directory, and a copy of the following script, have py2exe installed, and then just run it. You will end up with a dist subdirectory under test\multicolor and that's where you'll find multicolor.exe. # Kill_Distro = True MatPlotLib_Wanted = True def File_Exists( path ): res=os.path.isdir(path) if res==True: return res return os.path.isfile(path) from distutils.core import setup import py2exe import sys import os import shutil import glob homedir= rE:\test\Matplotlib\multicolor python = rc:\Python25 # Name of python directory if File_Exists(python)==False: python = rc:\Python23 # Name of python directory # *** # Some suggests that old build/dist should be cleared # *** dist_paths = [ homedir+'\\build', homedir+'\\dist' ] for path in dist_paths : if File_Exists ( path ) : shutil.rmtree ( path ) # *** # *** # *** data_files = [] packages = [] includes = [] excludes = [] dll_excludes = [] data_files.append ( ( '', glob.glob ( 'templates_*.*' ) ) ) # *** # For MatPlotLib # *** if MatPlotLib_Wanted : import matplotlib includes.append ( 'matplotlib.numerix.random_array' ) packages.append ( 'matplotlib' ) packages.append ( 'pytz' ) def mpl_data_files(destpath, path): mpl_data=[] for x in glob.glob (path+'\\*.*' ): if os.path.isdir(x): mpl_data_files(destpath+'\\'+os.path.split(x)[1], x) elif os.path.isfile(x): mpl_data.append(x) data_files.append ( ( destpath, mpl_data)) mpl_data_files(r'matplotlibdata', python+r'\Lib\site-packages\matplotlib\mpl-data') data_files.append ( ( r'matplotlibdata', glob.glob ( python+r'\Lib\site-packages\matplotlib\mpl-data\matplotlibrc' ))) data_files.append ( ( r'matplotlibdata\images', glob.glob ( python+r'\Lib\site-packages\matplotlib\mpl-data\images\*.*' ))) data_files.append ( ( r'matplotlibdata\fonts\afm', glob.glob ( python+r'\Lib\site-packages\matplotlib\mpl-data\fonts\afm\*.*' ))) data_files.append ( ( r'matplotlibdata\fonts\pdfcorefonts', glob.glob ( python+r'\Lib\site-packages\matplotlib\mpl-data\fonts\pdfcorefonts\*.*'))) data_files.append ( ( r'matplotlibdata\fonts\ttf', glob.glob ( python+r'\Lib\site-packages\matplotlib\mpl-data\fonts\ttf\*.*' ))) excludes.append ( '_gtkagg') excludes.append ( '_tkagg' ) excludes.append ( '_agg2' ) excludes.append ( '_cairo' ) excludes.append ( '_cocoaagg' ) excludes.append ( '_fltkagg' ) excludes.append ( '_gtk' ) excludes.append ( '_gtkcairo') excludes.append ( 'backend_qt' ) excludes.append ( 'backend_qt4') excludes.append ( 'backend_qt4agg' ) excludes.append ( 'backend_qtagg' ) excludes.append ( 'backend_cairo' ) excludes.append ( 'backend_cocoaagg' ) excludes.append ( 'Tkconstants' ) excludes.append ( 'Tkinter' ) excludes.append ( 'tcl' ) excludes.append ( _imagingtk ) excludes.append ( PIL._imagingtk ) excludes.append ( ImageTk ) excludes.append ( PIL.ImageTk ) excludes.append ( FixTk ) dll_excludes.append ( 'libgdk-win32-2.0-0.dll' ) dll_excludes.append ( 'libgdk_pixbuf-2.0-0.dll' ) dll_excludes.append ( 'libgobject-2.0-0.dll') dll_excludes.append ( 'tcl84.dll' ) dll_excludes.append ( 'tk84.dll' ) dll_excludes.append ( 'tclpip84.dll' ) # *** #
Re: [Matplotlib-users] MatPlotLib + Py2exe, backend problems ...
With Stef's help, I was able to get pass the Matplotlib datafile not found problem in using py2exe and Matplotlib under Python 2.3 - but then ran into the same Tkinter not loaded problem like he did. After reading Stef's messages from this list, I downloaded the latest version of Matplotlib - only to find that Python 2.3 is no longer supported. So, I loaded up Python 2.5 and ran the setup script for Py2exe. Now, py2exe is unable to find wxmsw26uh_vc.dll - eventhough I have wxPython 2.8 installed. So, I dug up a copy of wxPython 2.6 and have that installed. The file is now there but py2exe still can't find it. This is very fustrating! Date: Mon, 18 Feb 2008 21:09:07 -0600 From: John Hunter [EMAIL PROTECTED] Subject: Re: [Matplotlib-users] [wxPython-users] Re: MatPlotLib + Py2exe, backend problems ... To: Stef Mientki [EMAIL PROTECTED] Cc: matplotlib-users@lists.sourceforge.net Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=ISO-8859-1 On Feb 18, 2008 1:11 PM, Stef Mientki [EMAIL PROTECTED] wrote: What is setup.cfg, where can I find it and where can I get information about it ? Let's keep this on matplotlib-users so we don't annoy the good folks at the wxpython and distutils lists... setup.cfg is a build/configure file that ships w/ matplotlib in recent versions (0.91.x). If it is not in your source distribution, let us know which distro you are using, where you got it from, what you have already, etc Among other things, it lets you conditionally turn of/off builds of certain GUI backends and other optional features. JDH -- -- John Henry - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] MatPlotLib + Py2exe, backend problems ...
So, do I understand this correctly: In order to get rid of the Tkinter problem when building a matplotlib application using py2exe, I need 0.91.2 ver of matplotlib and use the setup.cfg file to select the backend I want (wxpython in my case). Then run py2exe to build the ap. Correct? But then, as I posted earlier, this create a new problem for me in that py2exe says it can't find wxmsw26uh_vc.dll - even though the file exists. What I need is a version of 0.91.2 ver of matplotlib that works with Python 2.3 to see if that works, or I guess I would include Tkinter with my exe? Do I understand all these correctly? -Original Message- Here was the solution: Ok I updated MatPlot from version from 0.87.7 to 0.91.2 cheers, Stef -- John Henry - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] MatPlotLib + Py2exe, backend problems ...
Michael, I am referring to the fact that there are no Windows binaries provided for Python 2.3. If I simply copy the matplotlib directory over to Python23, py2exe will get confused. I have no clue how to build it for Python23. I don't even have any C compiler. -Original Message- From: Michael Droettboom [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 19, 2008 12:19 PM To: [EMAIL PROTECTED] Cc: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] MatPlotLib + Py2exe, backend problems ... [EMAIL PROTECTED] wrote: What I need is a version of 0.91.2 ver of matplotlib that works with Python 2.3 to see if that works... I might be misremembering, but I thought 0.91.2 worked with Python 2.3. I don't use 2.3 every day, however. Can you send the errors that are produced when you build or run matplotlib 0.91.2 with Python 2.3? Or are you just referring to the fact that there are no Windows binaries provided for Python 2.3? Cheers, Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA -- John Henry - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] pyinstall and matplotlib
Well, looks like nobody has an answer to this question. How'bout py2exe or other ways of creating exe files out of matplotlib projects? Has anybody been able to do that? --- [EMAIL PROTECTED] wrote: Has anybody been able to create an exe of their python applications involving matplotlib using pyinstall (ver 1.3)? I am getting a: RuntimeError: Could not find the matplotlib data files when I attempt to run the exe created. In searching the web, it appears this is an issue when others tried to use py2exe as well. Unfortunately, the few hits I saw doesn't include enough details to inspire me as to what I should be doing in my pyinstall .spec file. Does anybody has an example or information about this? Thanks, -- John Henry -- John Henry - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] pyinstall and matplotlib
Has anybody been able to create an exe of their python applications involving matplotlib using pyinstall (ver 1.3)? I am getting a: RuntimeError: Could not find the matplotlib data files when I attempt to run the exe created. In searching the web, it appears this is an issue when others tried to use py2exe as well. Unfortunately, the few hits I saw doesn't include enough details to inspire me as to what I should be doing in my pyinstall .spec file. Does anybody has an example or information about this? Thanks, -- John Henry - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] SVG vs PNG
This SVG format gets better everyday. For those of you unfortunate enough not to have the choice of freedom from the M$ Monopoly, I discovered that Visio supports SVG file directly. In fact, the rendering is better then Inscape and get this: you can copy and paste *directly* over to PowerPoint and Word and you can even embed it as a Visio object. The quality is superb! Even the browser can read SVG file (somewhat - the quality isn't very good). -Original Message- From: Derek Hohls Sent: Tuesday, May 15, 2007 12:19 AM Subject: Re: [Matplotlib-users] SVG vs PNG For those of you fortunate enough to have the choice be free from the M$ Monopoly, you can use the Open Office Impress package to do something similar to the steps below. However, if you want to work directly with SVG files, then you should install the SVG import filter, available from: http://www.ipd.uka.de/~hauma/svg-import/ (Installation and use are described very clearly). If you have saved an SVG file from MPL, you can now open it in Open Office Draw, ungroup it (you will need to repeat this command a number of times) and edit the elements. Save the file as an Open Office drawing (.odg) for use in other Open Office applications. One strange thing I encountered was that the default background for fonts was blue? This seems to be a problem with the import filter, and has been reported on the wiki support page: http://wiki.services.openoffice.org/wiki/SVG_User_Experiences# Blue_background_for_all_text_elements but not fixed. To change this manually: left-click to select a text element, then right-click and choosing Edit Style... and then select White or None from the Area menu. *** As a footnote, I see that an integrated SVG filter, designed to be shipped as part of Open Office, is scheduled to be developed as part of the Google 2007 Summer of Code - see: http://wiki.services.openoffice.org/wiki/Summer_of_Code_2007/p roposals#Draw.2FImpress:_SVG_Import_Filter [EMAIL PROTECTED] 2007/05/15 01:08 AM Not exactly OT. I would not recommend using .eps format in order to export MPL graphs for Inkscape. I've been playing around with Inkscape for a few days now and I've been using .svg exclusively and don't have any problem. As I said before, I like the fact that once I am inside Inscape, I can do an ungroup of the graph, and work with all of the plotting elements individually. In fact, I just discover a nice way to cut and paste a particular subplot over to PowerPoint. This gives me very high quality graphs in Power Point (I can scale all I want). No more fuzzy, ugly-looking Power Point charts. Here's how: a) Create MPL plots in .svg format b) From Inscape, read in .svg c) Select subplot and ungroup d) Copy and paste to a new page e) Shrink the page down to the size of the object f) Save as emf file g) Import into PowerPoint In addition, I am also using Inscape to get around the problem with the PDF backend in MPL. I reported previously that I am unable to save more then 8 PDF files per execuation. Now, I save the files in .svg format, then invoke Inscape in command line mode and export the file in pdf format. Works great. Regards, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fernando Perez Sent: Saturday, May 12, 2007 9:57 AM To: Steve Schmerler Cc: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] SVG vs PNG On 5/12/07, Steve Schmerler wrote: Fernando Perez wrote: Did you install pstoedit? If you do, you'll see that inkscape will then be able to load .eps/.ps files in a fully editable format. I've used it to fix decade-old plots for which the only thing around was the eps file. I tried to export an .svg from MPL (0.90.0rev3131) with rcParams['text.usetex']=True and got a NotImplementedError (same for the pdf backend with usetex, see attached log). I was wondering: Is it (technically) possible to have .svg export capabilities with usetex-support and if so, has there been no need for this feature so far (not that I need it urgently, just curious..)? There's actually a real MPL bug in there (not just the NotImplementedError) but I'll report it separately in a minute. Anyway, to work with MPL-images (.ps/.eps) in Inkscape, I installed pstoedit but loading these files doesn't work (seems not to recognize them as images). Sorry if I'm driving the Inkscape-stuff a bit OT here, but: What version of Inkscape friends are you using? I'm using pstoedit 3.44, Inkscape 0.44.1. The Latex-formula-feature of Inkscape is also not working and the error seems related to pstoedit. Maybe someone had similar experiences ... Thanks for any hint! Well, unfortunately it seems that
Re: [Matplotlib-users] SVG vs PNG
Not exactly OT. I would not recommend using .eps format in order to export MPL graphs for Inkscape. I've been playing around with Inkscape for a few days now and I've been using .svg exclusively and don't have any problem. As I said before, I like the fact that once I am inside Inscape, I can do an ungroup of the graph, and work with all of the plotting elements individually. In fact, I just discover a nice way to cut and paste a particular subplot over to PowerPoint. This gives me very high quality graphs in Power Point (I can scale all I want). No more fuzzy, ugly-looking Power Point charts. Here's how: a) Create MPL plots in .svg format b) From Inscape, read in .svg c) Select subplot and ungroup d) Copy and paste to a new page e) Shrink the page down to the size of the object f) Save as emf file g) Import into PowerPoint In addition, I am also using Inscape to get around the problem with the PDF backend in MPL. I reported previously that I am unable to save more then 8 PDF files per execuation. Now, I save the files in .svg format, then invoke Inscape in command line mode and export the file in pdf format. Works great. Regards, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fernando Perez Sent: Saturday, May 12, 2007 9:57 AM To: Steve Schmerler Cc: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] SVG vs PNG On 5/12/07, Steve Schmerler wrote: Fernando Perez wrote: Did you install pstoedit? If you do, you'll see that inkscape will then be able to load .eps/.ps files in a fully editable format. I've used it to fix decade-old plots for which the only thing around was the eps file. I tried to export an .svg from MPL (0.90.0rev3131) with rcParams['text.usetex']=True and got a NotImplementedError (same for the pdf backend with usetex, see attached log). I was wondering: Is it (technically) possible to have .svg export capabilities with usetex-support and if so, has there been no need for this feature so far (not that I need it urgently, just curious..)? There's actually a real MPL bug in there (not just the NotImplementedError) but I'll report it separately in a minute. Anyway, to work with MPL-images (.ps/.eps) in Inkscape, I installed pstoedit but loading these files doesn't work (seems not to recognize them as images). Sorry if I'm driving the Inkscape-stuff a bit OT here, but: What version of Inkscape friends are you using? I'm using pstoedit 3.44, Inkscape 0.44.1. The Latex-formula-feature of Inkscape is also not working and the error seems related to pstoedit. Maybe someone had similar experiences ... Thanks for any hint! Well, unfortunately it seems that inkscape is crashing python itself... I made a trivial .eps in mpl with: In [1]: plot(range(10)) Out[1]: [matplotlib.lines.Line2D instance at 0x8f45a8c] In [2]: title(r'Some \LaTeX $\int_0^\infty f(\gamma) d\gamma = 1$') Out[2]: matplotlib.text.Text instance at 0x8f4590c In [3]: savefig('foo.eps') and when I tried to load it into inkscape, I got this very nasty traceback: *** glibc detected *** /usr/bin/python: free(): invalid pointer: 0x4081e4e0 *** === Backtrace: = /lib/tls/i686/cmov/libc.so.6[0x400ee7cd] /lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0x400f1e30] /usr/lib/skencil/Sketch/../Lib/streamfilter.so[0x404e7ce5] /usr/lib/skencil/Sketch/../Lib/streamfilter.so[0x404e7cd2] /usr/bin/python[0x8110e6a] /usr/bin/python(PyEval_EvalCodeEx+0x313)[0x80c9903] etc. At this point, this is really becoming OT for the mpl list, so I'll stop. But if anyone has the time, it might be worth sending this example to the inkscape list so they work on it and hopefully fix it. Cheers, f -- John Henry - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] SVG vs PNG
Chris, All I want is to: a) Insert all of the plots I create with MPL onto a Word document. As I said before, my version of Word does not recognize the EPS or PS format created by MPL. I am not blaiming MPL. I am just not willing to send Redmond money to see if their later version does the job properly. The version of Word I have does not import PDF files neither. Besides, the PDF backend of MPL fails when the total number of figures is more then 8. b) Be able to cut and paste part of a MPL figure and insert that to Word. I can do it now via the Gimp path but as I explained previously, the quality is not the greatest. I'll look up the cookbook you cited and try that. Thanks, -Original Message- From: Christopher Barker [mailto:[EMAIL PROTECTED] Sent: Friday, May 11, 2007 11:10 AM To: [EMAIL PROTECTED] Subject: Re: [Matplotlib-users] SVG vs PNG [EMAIL PROTECTED] wrote: Thanks everybody for the explanation of svg in Gimp. That makes sense. Is there any vector based program that does what Gimp does? By definition, No. GIMP is a raster editor, it is similar to other raster editors, and fundamentally different than vector graphics programs. There is a little overlap, what do you want to do? It sound like what you really need is a way to put MPL plots in a Word doc. Ideally, you'd use a vector format like EPS, because that's exactly what EPS is for. However, MS has never been good at supporting open formats like that. I'd try PDF. Recent versions of Word may do OK with that. Otherwise, you're back to a lowest common denominator. I've ended up just using PNG. If you set the ppi right, it works just fine. See this Wiki page for how to do that: http://www.scipy.org/Cookbook/Matplotlib/AdjustingImageSize -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] -- John Henry - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] SVG vs PNG
On Fri, 11 May 2007, [EMAIL PROTECTED] apparently wrote: All I want is to: a) Insert all of the plots I create with MPL onto a Word document. This part should be achievable with PNG. Just set the figsize. I have not had problems... Correct. I am doing that right now. However, because it's not vector based, if I start chaning the figure size, the quality suffers. b) Be able to cut and paste part of a MPL figure and insert that to Word You can select part of a PDF for copying to the clipboard in Acrobat. Been there, done that. Doesn't work. It selects the titles, and anotations. Doesn't select the graphs. fwiw, Alan Isaac -- John Henry - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] SVG vs PNG
Bingo! My prayer appears to have been answered. inkscape has no trouble reading the .svg files created by MPL, and Word has no trouble reading the .eps files created by inkscape. So, at least I can use it to preserve the vectors. Too bad inkscape doesn't read .eps directly (complaining...complaining) :=) inkscape treats everything as objects and allows you to ungroup the plots into elements and then you can play with each of the elements individually. When I am done, I can then insert into Word. Too bad it doesn't allow me to paste the objects directly over to Windows but I am not complaining. Thanks, Fernando. -Original Message- From: Fernando Perez [mailto:[EMAIL PROTECTED] Sent: Friday, May 11, 2007 11:05 AM To: [EMAIL PROTECTED] Cc: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] SVG vs PNG On 5/11/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks everybody for the explanation of svg in Gimp. That makes sense. Is there any vector based program that does what Gimp does? Try inkscape. I've used it successfully for simple things, though I've never tried to handle a MPL SVG file with it. cheers, f -- John Henry - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] SVG vs PNG
inkscape has no trouble reading the .svg files created by MPL, and Word has no trouble reading the .eps files created by inkscape. hmm. I wonder what it is about MPL's .eps files that Word doesn't like. Bug in MPL or Word?? Most likely Word. It's very picky. I have .eps files created by other programs where Word would simply tell you that it's not a supported format. Doesn't say why. -- John Henry - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] SVG vs PNG
Actually, Gimp is the problem. It's obvious they don't have a very good rendering engine. The plots looks very good under Inkscape. The quality of the svg plot depends in large plot on the svg renderer -- perhaps word doesn't do a good job rendering SVG? The matplotlib PNG files look good because agg is a good rendering engine. JDH -- John Henry - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] This is just so perfect! (was: Re: SVG vs PNG)
This is simply too good to be true. I played with manupulating MPL plots using Inkscape and man, somebody ought to include this in the MPL FAQ. I can move everything around by elements, touch-up or remove things I don't want, scale it, rotate it, you name it. And then I can save the file in .eps and include into Office - and I don't loose any quality. Perfect! Here's what I learned: a) Create the plot under MPL, saving the file in .svg format, and use the figsize argument to figure to create a plot of the proper size b) Use Inkscape to open the .svg file and manupulate it. Save in .eps format. c) Import the .eps file into Office. d) Be happy and become famous and rich. (not) Thanks again for all of the suggestions and tips. Regards, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Friday, May 11, 2007 12:23 PM To: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] SVG vs PNG Bingo! My prayer appears to have been answered. inkscape has no trouble reading the .svg files created by MPL, and Word has no trouble reading the .eps files created by inkscape. So, at least I can use it to preserve the vectors. Too bad inkscape doesn't read .eps directly (complaining...complaining) :=) inkscape treats everything as objects and allows you to ungroup the plots into elements and then you can play with each of the elements individually. When I am done, I can then insert into Word. Too bad it doesn't allow me to paste the objects directly over to Windows but I am not complaining. Thanks, Fernando. -Original Message- From: Fernando Perez [mailto:[EMAIL PROTECTED] Sent: Friday, May 11, 2007 11:05 AM To: [EMAIL PROTECTED] Cc: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] SVG vs PNG On 5/11/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks everybody for the explanation of svg in Gimp. That makes sense. Is there any vector based program that does what Gimp does? Try inkscape. I've used it successfully for simple things, though I've never tried to handle a MPL SVG file with it. cheers, f -- John Henry -- John Henry - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plotting wind-speed time series
Thanks for the message, Lionel. I am now able to run windrose.py using Derek's sample data. I was having trouble at first but after updating scipy to the latest version, the problem went away. Now, I am trying to convert my data into a format acceptable to windrose. As indicated before, my data is of the form: time-stamp (dd/mm/yy hh:mm), wind speed, wind direction and so I need to do some kind of conversion. Thanks again. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lionel Roubeyrie Sent: Wednesday, May 09, 2007 12:13 AM To: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] plotting wind-speed time series Hi John, sorry for the latency, 08 may is a special day in France. Derek gives you a good example of how to use windrose, in addition I just say you can directly modify the font size of the legend with the legendsize option (have a look at all the options with help(windplot)). Except is what you want. Cordialy PS: I'm working on a graphical interface for windrose, don't know when I can finalyse it, maybe for the next month. I set a screenshot here. Le Lundi 07 Mai 2007 23:47, [EMAIL PROTECTED] a écrit : Thanks to everybody that responded to my question. After looking at the different options, I do agree that windrose.py fits my need the best. Unfortunately, there is insufficient information embedded in the code to the point where I can use it. I sent the author a email requesting more info and hopefully he would respond. Just in case, have anybody used this code successfully? If so, could you please share a sample dataset to use windrose.py? Thanks, grab windrose.py at the end of this thread http://www.nabble.com/windrose-t1392107.html I've not used it but I think it is what you are looking for: a windrose module for python. JDH -- John Henry -- --- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Lionel Roubeyrie - [EMAIL PROTECTED] Chagé d'études et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr -- John Henry - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plotting wind-speed time series
Thanks to everybody that responded to my question. After looking at the different options, I do agree that windrose.py fits my need the best. Unfortunately, there is insufficient information embedded in the code to the point where I can use it. I sent the author a email requesting more info and hopefully he would respond. Just in case, have anybody used this code successfully? If so, could you please share a sample dataset to use windrose.py? Thanks, grab windrose.py at the end of this thread http://www.nabble.com/windrose-t1392107.html I've not used it but I think it is what you are looking for: a windrose module for python. JDH -- John Henry - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] What kind of chart should I use?
Hi list, I have a set of time series data which is year's worth of wind speed at a particular place (one data point per minute). I want to see how wind speed spreads throughout the day. I can do a scatter char with 24 hours of the day vs wind speed but then I end up with something that's not too useful (too many data points). What's more interesting is to present the data as a time / wind speed / frequency plot. The kind of plot shown in image_interp.py looks interesting. Is there a way to combine the capability of plot_date and imshow? If so, may be I can have hour of the day vs wind-speed with the color be a function of the data frequency. Thanks, -- John Henry - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plotting wind-speed time series (was: What kind of chart should I use?)
Saw this: http://www.originlab.com/www/products/GraphGallery.aspx?GID=26s=8lm=215 Since I am not interested in wind direction, may be I can use stacked bar-chart. Still, how would I tie plot_data with it though? Regards, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Friday, May 04, 2007 9:41 AM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] What kind of chart should I use? Hi list, I have a set of time series data which is year's worth of wind speed at a particular place (one data point per minute). I want to see how wind speed spreads throughout the day. I can do a scatter char with 24 hours of the day vs wind speed but then I end up with something that's not too useful (too many data points). What's more interesting is to present the data as a time / wind speed / frequency plot. The kind of plot shown in image_interp.py looks interesting. Is there a way to combine the capability of plot_date and imshow? If so, may be I can have hour of the day vs wind-speed with the color be a function of the data frequency. Thanks, -- John Henry -- John Henry - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] PDF Backend problem still unresolved
Thanks for the reply, Jouni. I am running Python 2.3 on Windows XP, latest version of MPL. I'll see if I can reproduce the problem using standard examples. Regards, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jouni K Seppänen Sent: Saturday, March 17, 2007 1:06 PM To: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] PDF Backend problem still unresolved [EMAIL PROTECTED] writes: Starting with the 9th page, MPL chokes at line 1084 in backend_pdf.py Jouni posted a couple of responses witih suggestions in CVS syntax but I was unable to use that information. I had to take my laptop to be to be repaired, so I can't do much work on Matplotlib right now. In the meantime, please post some more information: what version of Python and Matplotlib is this, on which platform, can you reduce your code to a small example that exhibits the bug, what output do you get with verbose.level: debug? -- Jouni -- --- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforge CID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] PDF Backend problem still unresolved
Just in case my message got buried, I like to repost my message: Now, I am running into another problem. Everything works fine up to 8 page plots. Starting with the 9th page, MPL chokes at line 1084 in backend_pdf.py and couldn't find the cooresponding ttf file (VeraSe.ttf) but it had no problem reading that file for the first 8 plots. Jouni posted a couple of responses witih suggestions in CVS syntax but I was unable to use that information. Regards, -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] PDF backend problem
Jouni, Are you certain the version you sent me is correct? It didn't make any difference - I get the same error messages. Regards, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jouni K. Seppänen Sent: Monday, March 12, 2007 11:20 PM To: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] PDF backend problem I fixed another filehandle leak in the pdf backend, so here's a more complete patch. There are also several cases of file(...) being passed to pickle.dump or pickle.load in font_manager.py. I was going to take care of these by writing some utility functions, but I started wondering why the import of cPickle or pickle is done only within methods of FontManager and not at the top level. Are there some platforms where neither is available, or what is the rationale? Index: backend_pdf.py === --- backend_pdf.py (revision 3044) +++ backend_pdf.py (revision 3046) @@ -457,7 +457,9 @@ self.writeObject(self.fontObject, fonts) def _write_afm_font(self, filename): -font = AFM(file(filename)) +fh = file(filename) +font = AFM(fh) +fh.close() fontname = font.get_fontname() fontdict = { 'Type': Name('Font'), 'Subtype': Name('Type1'), @@ -1081,7 +1083,9 @@ font = self.afm_font_cache.get(key) if font is None: filename = fontManager.findfont(prop, fontext='afm') -font = AFM(file(filename)) +fh = file(filename) +font = AFM(fh) +fh.close() self.afm_font_cache[key] = font return font -- Jouni K. Seppänen http://www.iki.fi/jks -- --- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforge CID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] PDF backend problem
Hi list, First of all, thanks to Bill Dandreta and Jouni Seppanen for helping with my combining single page pdf into multipage pdf question. I tried both method and went with pdftex because it's very simple (and fits my need). Now, I am running into another problem. Everything works fine up to 8 page plots. Starting with the 9th page, MPL chokes at line 1084 in backend_pdf.py and couldn't find the cooresponding ttf file (VeraSe.ttf) but it had no problem reading that file for the first 8 plots. ??? Regards, -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] plots into multi-page pdf
Hi list, I am using matplotlib to create single page plots and the whole process works fine. However, when I am done, I end up with lots of single page pdf files. Is there a way to get matplotlib to combine them all into a single PDF file? I tried using another package PyPDF but ended up with either file I/O problems or too many file opened problem. I am hoping that this can be done within matplotlib and not require yet another package. Thanks, -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to draw a straight line?
Thanks for the answer, John and Jouni. Okay, Line2D works. However, it appears to work in point (or is it pixels?) only. It doesn't accept xycoords=figure fraction as an option. How can I specify xy as a fraction of the figure size? I read the transform cookbook cited by Jouni. I am afraid I am lost what that does Regards, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Hunter Sent: Wednesday, March 07, 2007 6:48 AM To: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] How to draw a straight line? On 3/6/07, Jouni K. Seppänen [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] writes: How do I draw a line going from point A to point B on a figure (not It probably makes more sense not to use Axes.plot at all, since the line is not associated with an Axes from matplotlib.lines import Line2D from pylab import figure, show, nx fig = figure() line = Line2D([100,200,300,400,500], [100,400, 350, 200, 500], linewidth=4, color='green') fig.lines.append(line) show() But this feature isn't used very much, and one thing that we are not currently supporting (but should) is the zorder for Artists in the Figure. So if you have an Axes in your plot and you want the line to go over it, you'll need to do something like Jouni suggested so the line will be drawn above the Axes. -- --- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforge CID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to draw a straight line?
Upon working with this a little further, I discover that it works only in full-view screen mode. May be that's because xy is in pixel mode then? When I save it to a png file and then view it, the lines are wrong. -- John Henry - Original Message From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: matplotlib-users@lists.sourceforge.net Sent: Wednesday, March 7, 2007 9:40:45 AM Subject: Re: [Matplotlib-users] How to draw a straight line? Thanks for the answer, John and Jouni. Okay, Line2D works. However, it appears to work in point (or is it pixels?) only. It doesn't accept xycoords=figure fraction as an option. How can I specify xy as a fraction of the figure size? I read the transform cookbook cited by Jouni. I am afraid I am lost what that does Regards, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Hunter Sent: Wednesday, March 07, 2007 6:48 AM To: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] How to draw a straight line? On 3/6/07, Jouni K. Seppänen [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] writes: How do I draw a line going from point A to point B on a figure (not It probably makes more sense not to use Axes.plot at all, since the line is not associated with an Axes from matplotlib.lines import Line2D from pylab import figure, show, nx fig = figure() line = Line2D([100,200,300,400,500], [100,400, 350, 200, 500], linewidth=4, color='green') fig.lines.append(line) show() But this feature isn't used very much, and one thing that we are not currently supporting (but should) is the zorder for Artists in the Figure. So if you have an Axes in your plot and you want the line to go over it, you'll need to do something like Jouni suggested so the line will be drawn above the Axes. -- --- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforge CID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] How to draw a straight line?
Hi list, Must be a dumb question: How do I draw a line going from point A to point B on a figure (not plot reference frame), with a particular color and style? I scan through the manual and nothing jumped out - closest is Rectangle but that doesn't accept style parameter. Thanks, -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Axes label
Thanks to the reply, John (Hunter). That's it. The method proposed by Jouni appears to work too: gca().yaxis.set_major_locator(LinearLocator()) but it created too many labels. The set_ytinks call is the key. The set_ylim doesn't seem to be necessary. Now I have to study and see how I can implement it as a custom locators. Thanks, BTW: John, many thinks to an excellant package. How do I force the first label to appear at the origin for all plots? How about ax.set_ylim(-1.1,1.1) ax.set_yticks([-1.1, 0, 1.1]) etc... You can use custom locators as above to automate this, but if you know the ticks you want, just set them. -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Axes label
I found an example on the web that illustrates the question I posted earlier about axes. See: http://www.scipy.org/Cookbook/Matplotlib/MulticoloredLine Notice that the y-axis goes from (-1.1, 1.1) but the first label is at -1.0. I really don't like that because when I read values off the graph, I have to keep reminding myself that the origin is at -1.1. This may seem trivial but if you have to think, walk, chew gums at the same time you're reading the graph, it gets annoying - particularly if you have to read lots of these graphs. Is there a way to force the label to start at -1.1 instead of -1.0? Thanks, -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] invalidrestore
Thanks for the answer, John. Up to this point, the other software package we use produces EPS files only and so I've been using it this way for a while. May not be the best way but I've tried other EPS viewers and so far Word actually is the best way since I have to embedd the plots into Word reports. Back to the subject at hand. Using PNG files works but brings with it other problems and so I would really appreciate a resolution to this invalidrestore issue. I can't use PDF because I have to embedd the plots in a Word document. Not sure what SVG is (I'll look it up). Regards, Using PS/EPS in Word or any office product is a pretty unusual combination. My experience is that they are not supported s well as other image formats. Will PNG work for you? That is what I usually use for Office. You may also consider PDF or SVG if you need vector graphics. JDH -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] invalidrestore - PDF
Switching to PDF works (eventually - see below) but bring with it yet another set of problems. First of all, I had to fix backend_pdf.py for MPL to work (w Python 2.3, anyway). Two problems: a) 2.3 doesn't have the sorted function - it uses a .sort() function. So, I had to change line 487 from: chars=sorted(charmap.keys()) to: chars = charmap.keys() chars.sort() b) No update() function (line 396) So, instead of: xobjects.update([(name, value[0]) for (name, value) in self.markers.items()]) Had to do: for (name, value) in self.markers.items(): xobjects[name]=value[0] After that, I got my pdf file. However, if I print the PDF directly, works fine but when I create an object link to the PDF and print from inside Word, the printout is degraded (kind of fuzzy with texts). So, for a temporary work around, I can use PDF instead of EPS and hopefully that problem will get fixed someday. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jouni K. Seppänen Sent: Monday, February 26, 2007 9:56 AM To: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] invalidrestore [EMAIL PROTECTED] writes: Back to the subject at hand. Using PNG files works but brings with it other problems and so I would really appreciate a resolution to this invalidrestore issue. I can't use PDF because I have to embedd the plots in a Word document. Not sure what SVG is (I'll look it up). In my (admittedly limited) experience Word handles pdf files much better than eps files. I just tried (in MS Word 2004 for Mac) Insert / Picture / From File and selected a file produced by Matplotlib's pdf backend, and Word seems to embed it just fine. (I can't test printing right now, though.) -- Jouni K. Seppänen http://www.iki.fi/jks -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] invalidrestore - EPS file
I installed gsview and gs and tried it. AFAIK, gs didn't seen to complain. I also tried GIMP. While it didn't complain, the picture displayed is horribly bad. An invalidrestore error signals an improper restore. E.g., a string, dictionary, or procedure is left on the stack that needs to be discarded before restore. Probably a dictionary with no 'end'. Two obvious possibilities: - there is an invalid restore. This should be fixed. - something is wrong with the Word interpreter (quite possible given its history, but perhaps surprising for this particular problem) Does GhostScript report the same error? fwiw, Alan Isaac -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] invalidrestore
Hi list, I am getting an invalidrestore from the printer when I print a figure created with MPL. The page prints fine but for each plot, I am getting an error page. I didn't have this problem until I started making a number of font related changes. Before I go through a bunch of painful regression steps to see what causes this, does anybody has experience in this? Don't know if it matters but I am using Word to print the .eps file by imported it into a word doc file and then print from there. I am using Word because I don't have any other software that would allow me to print .eps file. Regards, -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] invalidrestore
I installed gsview and gscript and tried it. The good news is that when I print from inside gsview, the error page is gone. The bad news is that the oritentation is wrong. My plot is designed for landscape. From word, I set the page setup to landscape, import the picture, and print. But with gsview, it imports my plot 90 degree wrong. Changing orientation flips the whole page 90 degree but the plot gets rotated as well and so it still prints wrong. I guess I have no choice but to regress step by step and see which MPL feature aggrevated this condition. -Original Message- From: Eric Firing [mailto:[EMAIL PROTECTED] Sent: Friday, February 23, 2007 12:06 PM To: [EMAIL PROTECTED] Cc: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] invalidrestore [EMAIL PROTECTED] wrote: Hi list, I am getting an invalidrestore from the printer when I print a figure created with MPL. The page prints fine but for each plot, I am getting an error page. I didn't have this problem until I started making a number of font related changes. Before I go through a bunch of painful regression steps to see what causes this, does anybody has experience in this? Don't know if it matters but I am using Word to print the .eps file by imported it into a word doc file and then print from there. I am using Word because I don't have any other software that would allow me to print .eps file. Maybe this will help; certainly you should have it if you are going to work with ps or eps files. http://www.cs.wisc.edu/~ghost/gsview/ Eric Regards, -- John Henry -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] invalidrestore
Thanks for pointing that out, Eric. I try that and it did turn my plot 90 degree. The bad news is that GSview imports it upside down and if I want to view the plot on the screen, I have to rotate it downside up first. (Hey, I shouldn't complain. At least I can print without wasting a piece of paper for each plot). So, looks like it's true that something MPL did to the eps file is causing Word to spit out that error page. I wish I know what it is. The problem of not finding out is that I need to send these plots to clients. I don't want to require that they have an .eps viewer in order to see my plots... Regards -Original Message- From: Eric Firing [mailto:[EMAIL PROTECTED] Sent: Friday, February 23, 2007 3:07 PM To: [EMAIL PROTECTED] Cc: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] invalidrestore [EMAIL PROTECTED] wrote: I installed gsview and gscript and tried it. The good news is that when I print from inside gsview, the error page is gone. The bad news is that the oritentation is wrong. My plot is designed for landscape. From word, I set the page setup to landscape, import the picture, and print. But with gsview, it imports my plot 90 degree wrong. Changing orientation flips the whole page 90 degree but the plot gets rotated as well and so it still prints wrong. I guess I have no choice but to regress step by step and see which MPL feature aggrevated this condition. Did you try saving the figure using the orientation kwarg? This is intended for postscript output. e.g. from pylab import figure, show, close fig = figure() ax = fig.add_subplot(1,1,1) ax.plot([0,1], [0,1]) fig.savefig('myplot.ps', orientation='landscape') close(fig) Eric -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Controlling vertical space between subplots
Hi list, I have a figure of 3 rows by 2 col of plots. I have a need to use 2 line xlabels for each of the subplots. So I did something like: xlabel(Label 1\nLine 2) for each of the subplots. However when I do that, the 2nd line is lost for the top 4 subplots because I don't have enough vertical spaces between them. I tried something like: subplots_adjust(hspace=0.4) but it didn't seem to have any effect (I also tried different values for hspace - no effect at all). What am I doing wrong? I also have too much white space on the left and right side of the page and I tried to reduce that using the subplots_adjust function but it didn't seem to be doing what I want. I am sure I am not understanding something about subplots_adjust. Could some one please clarify it (or point me to the right direction)? Thanks, -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Controlling vertical space between subplots
Please ignore this message. I discovered the subplot_toolbar.py example which helped me figure out what I did wrong. Thanks -- John Henry - Original Message From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: matplotlib-users@lists.sourceforge.net Sent: Thursday, February 22, 2007 3:15:02 PM Subject: Controlling vertical space between subplots Hi list, I have a figure of 3 rows by 2 col of plots. I have a need to use 2 line xlabels for each of the subplots. So I did something like: xlabel(Label 1\nLine 2) for each of the subplots. However when I do that, the 2nd line is lost for the top 4 subplots because I don't have enough vertical spaces between them. I tried something like: subplots_adjust(hspace=0.4) but it didn't seem to have any effect (I also tried different values for hspace - no effect at all). What am I doing wrong? I also have too much white space on the left and right side of the page and I tried to reduce that using the subplots_adjust function but it didn't seem to be doing what I want. I am sure I am not understanding something about subplots_adjust. Could some one please clarify it (or point me to the right direction)? Thanks, -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Maximized vs non-maximized output
Okay, I tried saving using the postscript format, and I end up with the ugly plot also. In fact, if I maximize the plot and then save as .ps file, I get ugly plot as well. So, saving it in PS made no difference - that part is correct but it means I end up with the same font, and dimension as the non-maximized version. Somehow, if I maximize the plot using the show() command, maximize it first, then save it (in png format), I end up with a very nice looking plot. I just wish there is a simple way to accomplish that in batch mode. Regards, -- John Henry - Original Message From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: matplotlib-users@lists.sourceforge.net Sent: Wednesday, February 21, 2007 11:17:18 AM Subject: Re: [Matplotlib-users] Maximized vs non-maximized output Thanks for the reply, Darren. I didn't post the plot because I don't know if the list accept email attachments, and I don't have any space on the web for file sharing. I'll try to figure out a way to post the plots. BTW: I called savefig with the filename, and a dpi of 600 and nothing else. May be that was the problem. Regards, -Original Message- From: Darren Dale [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 21, 2007 10:54 AM To: matplotlib-users@lists.sourceforge.net Cc: [EMAIL PROTECTED] Subject: Re: [Matplotlib-users] Maximized vs non-maximized output On Wednesday 21 February 2007 01:40:59 pm [EMAIL PROTECTED] wrote: Hi list, I am still fairly new to Matplotlib. If I use the default settings, after creating a plot, and save the file, I get a .png file that looks really ugly. However, if I view the plot at the screen first (using the show() command), maximized the plot, and then save the file, I get a very nice looking .png file. If I am doing lots of plots, obviously I don't want to have to sit there and view each and every plots, maximize, save, ... How can I accomplish this in batch mode? We could probably be of more help if you posted examples of your ugly and nice pngs. For now I'll take a guess: maybe what you are seeing is an effect of the resolution and figure size? You can pass a dpi kwarg to the savefig command, or you can set it in your rc settings. Also, you can set the figure size by doing figure(figsize=(x,y)), or you can change the default figure size in your rc settings. How does your postscript output look? That format would not be influenced by resolution. Darren -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Maximized vs non-maximized output
Okay, I posted the ugly vs pretty plots at: http://new.photos.yahoo.com/kimwaic106/album I stripped out most of the titles and subtitles but I think you can still see the difference between the two. (Don't worry about the middle unintelligble part). Regards, -- John Henry - Original Message From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: matplotlib-users@lists.sourceforge.net Sent: Wednesday, February 21, 2007 11:37:54 AM Subject: Re: [Matplotlib-users] Maximized vs non-maximized output Okay, I tried saving using the postscript format, and I end up with the ugly plot also. In fact, if I maximize the plot and then save as .ps file, I get ugly plot as well. So, saving it in PS made no difference - that part is correct but it means I end up with the same font, and dimension as the non-maximized version. Somehow, if I maximize the plot using the show() command, maximize it first, then save it (in png format), I end up with a very nice looking plot. I just wish there is a simple way to accomplish that in batch mode. Regards, -- John Henry - Original Message From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: matplotlib-users@lists.sourceforge.net Sent: Wednesday, February 21, 2007 11:17:18 AM Subject: Re: [Matplotlib-users] Maximized vs non-maximized output Thanks for the reply, Darren. I didn't post the plot because I don't know if the list accept email attachments, and I don't have any space on the web for file sharing. I'll try to figure out a way to post the plots. BTW: I called savefig with the filename, and a dpi of 600 and nothing else. May be that was the problem. Regards, -Original Message- From: Darren Dale [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 21, 2007 10:54 AM To: matplotlib-users@lists.sourceforge.net Cc: [EMAIL PROTECTED] Subject: Re: [Matplotlib-users] Maximized vs non-maximized output On Wednesday 21 February 2007 01:40:59 pm [EMAIL PROTECTED] wrote: Hi list, I am still fairly new to Matplotlib. If I use the default settings, after creating a plot, and save the file, I get a .png file that looks really ugly. However, if I view the plot at the screen first (using the show() command), maximized the plot, and then save the file, I get a very nice looking .png file. If I am doing lots of plots, obviously I don't want to have to sit there and view each and every plots, maximize, save, ... How can I accomplish this in batch mode? We could probably be of more help if you posted examples of your ugly and nice pngs. For now I'll take a guess: maybe what you are seeing is an effect of the resolution and figure size? You can pass a dpi kwarg to the savefig command, or you can set it in your rc settings. Also, you can set the figure size by doing figure(figsize=(x,y)), or you can change the default figure size in your rc settings. How does your postscript output look? That format would not be influenced by resolution. Darren -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] get_gridlines
Hi list, The tutorial indicated that I can use gca to get at the grid by doing a: glines = getp(gca(), 'gridlines') but when I do that, I get a Subplot instance has no attribute get_gridlines. How do I get to the grid object? Thanks, -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] get_xgridlines (was get_gridlines)
Okay, I'll answer my own question. After looking through the code, it appears I have to do a xgridlines - not gridlines, like: glines = getp(gca(), 'xgridlines') Hi list, The tutorial indicated that I can use gca to get at the grid by doing a: glines = getp(gca(), 'gridlines') but when I do that, I get a Subplot instance has no attribute get_gridlines. How do I get to the grid object? Thanks, -- John Henry -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Controlling number of grid lines
I am having trouble with axes and grids in the y-direction. I have a 3 rows x 2 colums figure and I like to have 5 major Y divisions or 4 grid lines for each of the graphs. 5 of the 6 graphs came out properly. For instance, for a Ymin=12, Ymax=17, I get grid lines at y=13, 14, 15, and 16. However, the 6th one isn't right. For a Ymin=-5 and Ymax=5, I get grid lines at y=-4, -2, 0, 2, 4 (but the origin does starts with y=-5). I want to have only 4 grid lines (at y=-3, -1, +1, 3). I tried many settings but the result is the same. What should I do to get only 4 grid lines in the y-direction? Regards, -- John Henry - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Multiple y-axis
Hi all, I am new to matplotlib. I like to know how to create a plot that contains several y-axis (up to say, 6) with only 1 x-axis (similar to the two_scales.py type plot but with all of the y-axis on one side). I know you can create multiple single curve plots on the same page but that's not what I want: I want one plot with multiple curves and one y-axis for each of the curves. Any help is greatly appreciated. Regards, -- John Henry - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users