[Matplotlib-users] two axes on top of one another with one rotated
Sorry if this ultimately goes through more than once. I am having some issues with submitting it I need to teach coordinate systems and transformations to a college robotics class. I have used Tikz in the past to generate some graphics, but I want to switch to doing everything in matplotlib if possible. (Tikz is super powerful and makes beautiful graphics, but it always takes me a long time to generate a figure). One of my initial problems is drawing two axes on top of one another, but with one of them rotated by an arbitrary angle. I am attaching the Tikz result that I want to recreate in matplotlib. Other than drawing lines "by hand", I don't really know where to start. Any help would be appreciated. In case the mailing list doesn't allow attached graphics, here is a link to the image on my google drive: https://drive.google.com/open?id=1XVKcZEK76SQL2cW5yASbQCMvR0GZKgz- Thanks! Ryan -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] show() blocks script execution for TkAgg from ipython -pylab
Thanks. I need to role out a python install for my students. Classes start in a week and a half. What should I do? The installation for most of them needs to be fairly simple. Thanks, Ryan On Wed, Aug 11, 2010 at 2:25 AM, Eric Firing efir...@hawaii.edu wrote: On 08/10/2010 05:43 PM, Ryan Krauss wrote: I just upgraded my windows machine to matplotlib 1.0.0 and a simple script such as from pylab import * from scipy import * t = arange(0,1,0.01) y = sin(2*pi*t) figure(1) clf() plot(t,y) show() Now halts execution when run from the ipython -pylab prompt. The same commands typed at the commandline do not lead to show() halting execution. Is this expected behavior? This was fixed three weeks ago in svn, both the maintenance branch and the trunk. I made some changes in show() shortly before 1.0, trying to get uniform and reasonable behavior in all backends, and I didn't quite succeed. I think I got it all straightened out--but only after the release, unfortunately. I hope it won't be too long before a 1.0.1 bugfix release can be made, but I am aware of no schedule. Eric Thanks, Ryan -- This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] show() blocks script execution for TkAgg from ipython -pylab
0.99.3 is more or less fine, but there is an annoying exception window that pops up if you close IPython with a plot window open (using the TkAgg backend). But in my mind this is less bothersome than having to close all the plot windows every time I run a script (I tend to write scripts that generate 5-10 plots at a minimum). If I could easily build an installer from svn, I would try it. I don't have any microsoft compilers installed on my windows computers. Thanks again, Ryan On Wed, Aug 11, 2010 at 9:09 AM, Ryan Krauss ryanli...@gmail.com wrote: Thanks. I need to role out a python install for my students. Classes start in a week and a half. What should I do? The installation for most of them needs to be fairly simple. Thanks, Ryan On Wed, Aug 11, 2010 at 2:25 AM, Eric Firing efir...@hawaii.edu wrote: On 08/10/2010 05:43 PM, Ryan Krauss wrote: I just upgraded my windows machine to matplotlib 1.0.0 and a simple script such as from pylab import * from scipy import * t = arange(0,1,0.01) y = sin(2*pi*t) figure(1) clf() plot(t,y) show() Now halts execution when run from the ipython -pylab prompt. The same commands typed at the commandline do not lead to show() halting execution. Is this expected behavior? This was fixed three weeks ago in svn, both the maintenance branch and the trunk. I made some changes in show() shortly before 1.0, trying to get uniform and reasonable behavior in all backends, and I didn't quite succeed. I think I got it all straightened out--but only after the release, unfortunately. I hope it won't be too long before a 1.0.1 bugfix release can be made, but I am aware of no schedule. Eric Thanks, Ryan -- This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] show() blocks script execution for TkAgg from ipython -pylab
This worked perfectly. Thanks Christoph. Ryan On Wed, Aug 11, 2010 at 11:35 AM, Christoph Gohlke cgoh...@uci.edu wrote: Ryan: you could try matplotlib-1.0.0.svn.win32-py2.6.exe from http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib .It was built this morning from svn. Christoph On 8/11/2010 7:26 AM, Ryan Krauss wrote: 0.99.3 is more or less fine, but there is an annoying exception window that pops up if you close IPython with a plot window open (using the TkAgg backend). But in my mind this is less bothersome than having to close all the plot windows every time I run a script (I tend to write scripts that generate 5-10 plots at a minimum). If I could easily build an installer from svn, I would try it. I don't have any microsoft compilers installed on my windows computers. Thanks again, Ryan On Wed, Aug 11, 2010 at 9:09 AM, Ryan Kraussryanli...@gmail.com wrote: Thanks. I need to role out a python install for my students. Classes start in a week and a half. What should I do? The installation for most of them needs to be fairly simple. Thanks, Ryan On Wed, Aug 11, 2010 at 2:25 AM, Eric Firingefir...@hawaii.edu wrote: On 08/10/2010 05:43 PM, Ryan Krauss wrote: I just upgraded my windows machine to matplotlib 1.0.0 and a simple script such as from pylab import * from scipy import * t = arange(0,1,0.01) y = sin(2*pi*t) figure(1) clf() plot(t,y) show() Now halts execution when run from the ipython -pylab prompt. The same commands typed at the commandline do not lead to show() halting execution. Is this expected behavior? This was fixed three weeks ago in svn, both the maintenance branch and the trunk. I made some changes in show() shortly before 1.0, trying to get uniform and reasonable behavior in all backends, and I didn't quite succeed. I think I got it all straightened out--but only after the release, unfortunately. I hope it won't be too long before a 1.0.1 bugfix release can be made, but I am aware of no schedule. Eric Thanks, Ryan -- This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] show() blocks script execution for TkAgg from ipython -pylab
', 'numpy.lib.index_tricks', 'num py.testing.utils', 'warnings', 'numpy.lib.utils', 'numpy.core.defchararray', 'nu mpy.polynomial.polyutils', 'numpy.lib.shape_base', 'numpy.core.types', 'sys', 'n umpy.core.warnings', 'numpy.compat._inspect', 'numpy.core.__builtin__', 'xml.sax .sys', 'numpy.lib.format', 'numpy.lib.os', 'numpy.__config__', 'types', 'numpy.l ib.shutil', 'matplotlib.datetime', 'matplotlib.fontconfig_pattern', '_weakref', 'distutils.errors', 'urlparse', 'linecache', 'matplotlib.shutil', 'numpy.lib.cSt ringIO', 'time', 'numpy.linalg.linalg', 'numpy.testing.numpy'] Using fontManager instance from D:\.matplotlib\fontList.cache backend TkAgg version 8.5 findfont: Matching :family=serif:style=normal:variant=normal:weight=normal:stret ch=normal:size=medium to Bitstream Vera Serif (C:\Python26\lib\site-packages\mat plotlib\mpl-data\fonts\ttf\VeraSe.ttf) with score of 0.17 IPython 0.10 In [4]: scipy.__version__ Out[4]: '0.8.0' In [5]: import numpy In [6]: numpy.__version__ Out[6]: '1.5.0b1' On Tue, Aug 10, 2010 at 10:43 PM, Ryan Krauss ryanli...@gmail.com wrote: I just upgraded my windows machine to matplotlib 1.0.0 and a simple script such as from pylab import * from scipy import * t = arange(0,1,0.01) y = sin(2*pi*t) figure(1) clf() plot(t,y) show() Now halts execution when run from the ipython -pylab prompt. The same commands typed at the commandline do not lead to show() halting execution. Is this expected behavior? Thanks, Ryan -- This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] saving a PNg jsut as dispalyed
I guess you could read the rcParams value that corresponds to the screen display and set rcParams['savefig.dpi'] to that value (this might work): mydpi = rcParams['figure.dpi'] rcParams['savefig.dpi'] = mydpi But that seems slightly hackish and maybe not much more elegant than what you are currently doing with passing dpi into savefig. FWIW, Ryan On Thu, Mar 27, 2008 at 1:57 PM, Christopher Barker [EMAIL PROTECTED] wrote: Ryan Krauss wrote: I think this line in the rc file is the trick #savefig.dpi : 100 nope. I think all that does is set the default dpi for savefig. I don't want any default, I want it to use the same dpi that is being used for display, and I don't know ahead of time what that is, I expect it is system dependent. Or do you mean that if I comment out that line, it will default to the one already in use? In which case, I need to go figure out how to change that in code, rather than messing with my matplotlibrc. -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] - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] easy way to find and install all dependencies for Ubuntu source install
I need to help a friend install from source on Ubuntu Gutsy. What is the easiest way to determine all dependencies and make sure he has all the right dev packages? I suspect we want to install the WXAgg, GTKAgg, TkAGG, and postscript backends. Thanks, Ryan - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] draw_tex NotImplementedError in backend_bases.py
I think I have correctly installed from source. I checked the dependencies for USETEX and have the right versions for dvipng, gs, latex, and pdftops. When trying to plot with text.usetex=True I get type 'exceptions.NotImplementedError' Traceback (most recent call last) /home/william/svn/matplotlib/ipython console in module() /usr/lib/python2.5/site-packages/matplotlib/pyplot.py in plot(*args, **kwargs) 1827 try: 1828 ret = gca().plot(*args, **kwargs) - 1829 draw_if_interactive() 1830 except: 1831 hold(b) /usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in draw_if_interactive() 1164 figManager = Gcf.get_active() 1165 if figManager is not None: - 1166 figManager.canvas.draw() 1167 1168 /usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in draw(self, repaint) 886 DEBUG_MSG(draw(), 1, self) 887 self.renderer = RendererWx(self.bitmap, self.figure.dpi) -- 888 self.figure.draw(self.renderer) 889 if repaint: 890 self.gui_repaint() /usr/lib/python2.5/site-packages/matplotlib/figure.py in draw(self, renderer) 774 775 # render the axes -- 776 for a in self.axes: a.draw(renderer) 777 778 # render the figure text /usr/lib/python2.5/site-packages/matplotlib/axes.py in draw(self, renderer, inframe) 1399 1400 for zorder, i, a in dsu: - 1401 a.draw(renderer) 1402 1403 renderer.close_group('axes') /usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self, renderer, *args, **kwargs) 678 tick.set_label1(label) 679 tick.set_label2(label) -- 680 tick.draw(renderer) 681 if tick.label1On and tick.label1.get_visible(): 682 extent = tick.label1.get_window_extent(renderer) /usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self, renderer) 177 178 if self.label1On: -- 179 self.label1.draw(renderer) 180 if self.label2On: 181 self.label2.draw(renderer) /usr/lib/python2.5/site-packages/matplotlib/text.py in draw(self, renderer) 759 def draw(self, renderer): 760 self.update_coords(renderer) -- 761 Text.draw(self, renderer) 762 if self.get_dashlength() 0.0: 763 self.dashline.draw(renderer) /usr/lib/python2.5/site-packages/matplotlib/text.py in draw(self, renderer) 307 308 renderer.draw_tex(gc, x, y, line, -- 309 self._fontproperties, angle) 310 return 311 /usr/lib/python2.5/site-packages/matplotlib/backend_bases.py in draw_tex(self, gc, x, y, s, prop, angle, ismath) 264 265 def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!'): -- 266 raise NotImplementedError 267 268 def draw_text(self, gc, x, y, s, prop, angle, ismath=False): type 'exceptions.NotImplementedError': In [4]: --- type 'exceptions.NotImplementedError' Traceback (most recent call last) /usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in _onPaint(self, evt) 1018 self.realize() 1019 # Render to the bitmap - 1020 self.draw(repaint=False) 1021 # Update the display using a PaintDC 1022 self.gui_repaint(drawDC=wx.PaintDC(self)) /usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in draw(self, repaint) 886 DEBUG_MSG(draw(), 1, self) 887 self.renderer = RendererWx(self.bitmap, self.figure.dpi) -- 888 self.figure.draw(self.renderer) 889 if repaint: 890 self.gui_repaint() /usr/lib/python2.5/site-packages/matplotlib/figure.py in draw(self, renderer) 774 775 # render the axes -- 776 for a in self.axes: a.draw(renderer) 777 778 # render the figure text /usr/lib/python2.5/site-packages/matplotlib/axes.py in draw(self, renderer, inframe) 1399 1400 for zorder, i, a in dsu: - 1401 a.draw(renderer) 1402 1403 renderer.close_group('axes') /usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self, renderer, *args, **kwargs) 678 tick.set_label1(label) 679 tick.set_label2(label) -- 680 tick.draw(renderer) 681 if tick.label1On and tick.label1.get_visible(): 682 extent = tick.label1.get_window_extent(renderer) /usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self, renderer) 177 178 if self.label1On: -- 179 self.label1.draw(renderer) 180 if self.label2On: 181 self.label2.draw(renderer) /usr/lib/python2.5/site-packages/matplotlib/text.py in draw(self,
Re: [Matplotlib-users] easy way to find and install all dependencies for Ubuntu source install
Thanks Darren. I think we got this right, but I started a new thread with a usetex problem after we installed. I don't know if this is really a build problem or some other bug. Maybe it should be the same thread. Ryan On 3/26/08, Darren Dale [EMAIL PROTECTED] wrote: On Wednesday 26 March 2008 10:15:13 am Ryan Krauss wrote: I need to help a friend install from source on Ubuntu Gutsy. What is the easiest way to determine all dependencies and make sure he has all the right dev packages? I suspect we want to install the WXAgg, GTKAgg, TkAGG, and postscript backends. You could just try running python setup.py build. That will test for all the required and optional libraries and generate a report at the beginning of the process. Be mindful of missing headers or devel libraries. Darren - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] saving a PNg jsut as dispalyed
I think this line in the rc file is the trick #savefig.dpi : 100 On Wed, Mar 26, 2008 at 6:16 PM, Christopher Barker [EMAIL PROTECTED] wrote: Hi all, I want to save a figure just like it is displayed i.e. the same dpi (wxAgg). However, the default Figure.savefig uses a different dpi setting than the figure as displayed, so I'm doing: dpi = Fig.get_dpi() Fig.savefig(str(path), dpi=dpi) which seems to work, but seems more awkward than it should be. Is there a flag or something I'm missing? -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] - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] installation problem/crash
I am trying to help a student get started with Python/Scipy/Numpy/Matplotlib in windows. On one of his machines, everything seems to install correctly, we can call figure(1) without a problem, and plotting is fine until we try the show() command. Then python crashes without much in the way of useful information. His laptop is completely fine. We have downloaded a current rc file and set the backend to TkAgg. Any thoughts? How do we get more info to track down the problem? Thanks, Ryan - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] installation problem/crash
Pretty sure it's a newer chip, but I will find out. On Dec 11, 2007 2:06 PM, Fernando Perez [EMAIL PROTECTED] wrote: On Dec 11, 2007 12:01 PM, Ryan Krauss [EMAIL PROTECTED] wrote: I am trying to help a student get started with Python/Scipy/Numpy/Matplotlib in windows. On one of his machines, everything seems to install correctly, we can call figure(1) without a problem, and plotting is fine until we try the show() command. Then python crashes without much in the way of useful information. His laptop is completely fine. We have downloaded a current rc file and set the backend to TkAgg. Any thoughts? How do we get more info to track down the problem? Go to the windows information screens and fetch out some CPU details. If it's a Pentium III, chances are the SSE2 instructions in the latest numpy binary are the culprit. If it's a newer chip, we'll need to dig deeper. Cheers, f - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] installation problem/crash
Fernando was right on. Here is his response to me: Laptop - Ok Windows XP Professional, Service Pack 2 AMD Athlon 64 3400+ (ClawHammer) 1.67 GHz, 768 MB of RAM Chipset: SiS 755/755FX Southbridge: SiS LPC Bridge Instructions: MMX (+), 3DNow! (+), SSE, SSE2, x86-64 Machine 1 - Crashes Windows XP Professional, Service Pack 2 AMD Athlon XP 2000+ (Thoroughbred) 1.67 GHz, 768 MB of RAM ASUS A7V8X-X motherboard Chipset: VIA KT400 (VT8377) Southbridge: VIA VT8235 Instructions: MMX (+), 3DNow! (+), SSE Machine 2 - Crashes Windows XP Professional, Service Pack 2 AMD Athlon XP 2600+ (Barton) 1.92 GHz, 2.0 GB of RAM ASUS A7V880 motherboard Chipset: VIA KT880 Southbridge: VIA VT8237 Instructions: MMX (+), 3DNow! (+), SSE I ran the following statements on both machines which caused it to crash: import numpy numpy.test() Here is the output: Numpy is installed in C:\Python25\lib\site-packages\numpy Numpy version 1.0.4 Python version 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Int el)] Found 10/10 tests for numpy.core.defmatrix Found 36/36 tests for numpy.core.ma Found 223/223 tests for numpy.core.multiarray Found 65/65 tests for numpy.core.numeric Found 31/31 tests for numpy.core.numerictypes Found 12/12 tests for numpy.core.records Found 6/6 tests for numpy.core.scalarmath Found 14/14 tests for numpy.core.umath Found 4/4 tests for numpy.ctypeslib Found 5/5 tests for numpy.distutils.misc_util Found 1/1 tests for numpy.fft.fftpack Found 3/3 tests for numpy.fft.helper Found 9/9 tests for numpy.lib.arraysetops Found 46/46 tests for numpy.lib.function_base Found 5/5 tests for numpy.lib.getlimits Found 4/4 tests for numpy.lib.index_tricks Found 3/3 tests for numpy.lib.polynomial Found 49/49 tests for numpy.lib.shape_base Found 15/15 tests for numpy.lib.twodim_base Found 43/43 tests for numpy.lib.type_check Found 1/1 tests for numpy.lib.ufunclike Found 40/40 tests for numpy.linalg Found 2/2 tests for numpy.random Found 0/0 tests for __main__ . Sounds like the problem is the fact that my desktop computers do not support SSE2 instructions which are in the latest numpy binaries. This also explains why it works fine on the laptop which does support SSE2. I piggy-backed onto an existing thread on the numpy list (is that bad listserve etiquette? - probably: I now have the same question on two lists and I tried to high jack a thread.). Unless someone has a better idea, I will try and build from source for him. But my windows building skills are not what they should be. Ryan On Dec 11, 2007 2:06 PM, Fernando Perez [EMAIL PROTECTED] wrote: On Dec 11, 2007 12:01 PM, Ryan Krauss [EMAIL PROTECTED] wrote: I am trying to help a student get started with Python/Scipy/Numpy/Matplotlib in windows. On one of his machines, everything seems to install correctly, we can call figure(1) without a problem, and plotting is fine until we try the show() command. Then python crashes without much in the way of useful information. His laptop is completely fine. We have downloaded a current rc file and set the backend to TkAgg. Any thoughts? How do we get more info to track down the problem? Go to the windows information screens and fetch out some CPU details. If it's a Pentium III, chances are the SSE2 instructions in the latest numpy binary are the culprit. If it's a newer chip, we'll need to dig deeper. Cheers, f - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Wanted: recommendations on embedding matplotlib in a wxPython application
I may be jumping into this conversation way too late, but I really like wxmpl. The one bell and whistle that I love is the click-and-drag box zoom available by default. Attached is my hacked together simple example of putting a wxmpl.PlotPanel on a wx.notebook. Ryan On Nov 27, 2007 11:06 AM, C M [EMAIL PROTECTED] wrote: On Nov 27, 2007 11:27 AM, Rich Shepard [EMAIL PROTECTED] wrote: On Mon, 26 Nov 2007, C M wrote: Basically what I did (sorry if this is too basic, but I'm pretty new to this and this may jog others to correct deficiencies in this simple approach) was to: This is all straightforward and clear. The one statement I've not yet understood is this: self.graph = matplotFrame3.PlotPanel(self.panel1 ,xpoints, ypoints) I assume that matplotFrame3 is the name of the module in which you've written PlotPanel(). Is this assumption correct? Exactly. That is the module which I mention importing in step 4. I'm modifying your approach to suit our application but it seems to be the most parsimonious and elegant solution for simple display of plots in a wxPython panel. Thanks, Glad it will help your application. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. 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 #!/usr/bin/env python import wx from wxmpl import PlotPanel from scipy import * class MyFrame(wx.Frame): def __init__(self, parent, title): wx.Frame.__init__(self, parent, -1, title, pos=(150, 150), size=(650, 700)) # Create the menubar menuBar = wx.MenuBar() # and a menu menu = wx.Menu() # add an item to the menu, using \tKeyName automatically # creates an accelerator, the third param is some help text # that will show up in the statusbar menu.Append(wx.ID_EXIT, Exit\tAlt-X, Exit the application) # bind the menu event to an event handler self.Bind(wx.EVT_MENU, self.OnTimeToClose, id=wx.ID_EXIT) # and put the menu on the menubar menuBar.Append(menu, File) self.SetMenuBar(menuBar) #create the notebook self.notebook = wx.Notebook(self, -1, style=0) #create the first pane for the notebook self.notebook_pane_1 = wx.Panel(self.notebook, -1) #create the sizer for the first pane grid_sizer = wx.FlexGridSizer(2, 1, 0, 0) #create widgets for pane one self.PlotPanel = PlotPanel(self.notebook_pane_1, -1) self.button_1 = wx.Button(self.notebook_pane_1, -1, button_1) #add the widgets to pane one's sizer grid_sizer.Add(self.PlotPanel, 0, 0, 0) grid_sizer.Add(self.button_1, 0, 0, 0) self.notebook_pane_1.SetSizer(grid_sizer) grid_sizer.AddGrowableCol(0) grid_sizer.AddGrowableRow(0) #Add pane one to the notebook self.notebook.AddPage(self.notebook_pane_1, tab1) #create the sizer for the main frame mainsizer = wx.BoxSizer(wx.VERTICAL) #add the notebook to the sizer mainsizer.Add(self.notebook, 1, wx.EXPAND, 0) self.SetSizer(mainsizer) mainsizer.Fit(self) self.Layout() self.InitialPlot() def InitialPlot(self): fig = self.PlotPanel.get_figure() ax = fig.add_subplot(111) ax.cla() t = arange(0,1,0.01) y = sin(2*pi*t) x = cos(4*pi*t) ax.plot(t,y,t,x) ax.set_xlabel('Time (sec)') ax.set_ylabel('$y(t)$') def OnTimeToClose(self, evt): Event handler for the button click. print See ya later! self.Close() class MyApp(wx.App): def OnInit(self): frame = MyFrame(None, Simple wxmpl embedding example) self.SetTopWindow(frame) #print Print statements go to this stdout window by default. frame.Show(True) return True if __name__ == __main__: app = MyApp(redirect=False) app.MainLoop() - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] wxmpl: Can't create printer PDF because the id PDF is already used
I just created a small wxmpl example that I really like (attached), but when I run it, I get these error messages: ** (python:18091): WARNING **: Can't create printer PDF because the id PDF is already used (python:18091): GnomePrintCupsPlugin-WARNING **: The CUPS printer PDF could not be created (python:18091): GnomePrintCupsPlugin-WARNING **: The data for the CUPS printer PDF could not be loaded. I don't know if this is wxmpl specific, caused by wxPython, or caused by matplotlib, but I would like to make it go away. Any thoughts? Thanks, Ryan #!/usr/bin/env python import wx from wxmpl import PlotPanel from scipy import * class MyFrame(wx.Frame): def __init__(self, parent, title): wx.Frame.__init__(self, parent, -1, title, pos=(150, 150), size=(650, 700)) # Create the menubar menuBar = wx.MenuBar() # and a menu menu = wx.Menu() # add an item to the menu, using \tKeyName automatically # creates an accelerator, the third param is some help text # that will show up in the statusbar menu.Append(wx.ID_EXIT, Exit\tAlt-X, Exit the application) # bind the menu event to an event handler self.Bind(wx.EVT_MENU, self.OnTimeToClose, id=wx.ID_EXIT) # and put the menu on the menubar menuBar.Append(menu, File) self.SetMenuBar(menuBar) #create the notebook self.notebook = wx.Notebook(self, -1, style=0) #create the first pane for the notebook self.notebook_pane_1 = wx.Panel(self.notebook, -1) #create the sizer for the first pane grid_sizer = wx.FlexGridSizer(2, 1, 0, 0) #create widgets for pane one self.PlotPanel = PlotPanel(self.notebook_pane_1, -1) self.button_1 = wx.Button(self.notebook_pane_1, -1, button_1) #add the widgets to pane one's sizer grid_sizer.Add(self.PlotPanel, 0, 0, 0) grid_sizer.Add(self.button_1, 0, 0, 0) self.notebook_pane_1.SetSizer(grid_sizer) grid_sizer.AddGrowableCol(0) grid_sizer.AddGrowableRow(0) #Add pane one to the notebook self.notebook.AddPage(self.notebook_pane_1, tab1) #create the sizer for the main frame mainsizer = wx.BoxSizer(wx.VERTICAL) #add the notebook to the sizer mainsizer.Add(self.notebook, 1, wx.EXPAND, 0) self.SetSizer(mainsizer) mainsizer.Fit(self) self.Layout() self.InitialPlot() def InitialPlot(self): fig = self.PlotPanel.get_figure() ax = fig.add_subplot(111) ax.cla() t = arange(0,1,0.01) y = sin(2*pi*t) x = cos(4*pi*t) ax.plot(t,y,t,x) ax.set_xlabel('Time (sec)') ax.set_ylabel('$y(t)$') def OnTimeToClose(self, evt): Event handler for the button click. print See ya later! self.Close() class MyApp(wx.App): def OnInit(self): frame = MyFrame(None, Simple wxmpl embedding example) self.SetTopWindow(frame) #print Print statements go to this stdout window by default. frame.Show(True) return True if __name__ == __main__: app = MyApp(redirect=False) app.MainLoop() - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] zeros and ones difference between pylab and scipy
I have successfully (I think) coerced my students into using Scipy/Numpy for signal processing and dynamic system modeling. They are mechanical engineering coming from a Matlab background. In order to make using Python easy and have it feel like Matlab, I teach them to put from scipy import * from pylab import * at the beginning of every script. One problem with this is that the zeros and ones functions of pylab default to integers while those from scipy default to floating point numbers. I have had several students this week beating there heads against problems that turned out to be trying to put floating point values in an array that was created using pylab.zeros. Can this be changed? Is there a better approach I should take in getting my students started using scipy and pylab together? Thanks, Ryan - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] latex labels on saved plots
usetex=true IS supported for eps. I use epstopdf to get pdf's from there. Ryan On 9/21/07, Jordan Atlas [EMAIL PROTECTED] wrote: Do you have ghostscript installed? If you set verbose.level to debug or debug-annoying, what do you get? I realized that the ghostscript path wasn't set up properly, so that was what was causing part of the problem with EPS files. It works sometimes now (sometimes the EPS is just a blank file, even though the plot shows up properly when I do pylab.show(). I'm still trying to narrow down what ameks the difference here). I guess I mean TeX-like mathtext format parsed by matplotlib. For example, I'm using things like this: rc('text', usetex=True) Plotting.xlabel(r'\textbf{Time (s)}', fontsize=16) usetex=True means that you are trying to use an external TeX program. Ok, so am I to understand that usetex=True is not supported for PDF/EPS output? Can you explain what the Tex-like mathtext format parsed by matplotlib is? Thank you for your assistance, --Jordan - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. 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 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. 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] creating a timeline
I would need to create a timeline for a Latex document (eps output). There may be other tools besides Matplotlib and I am open to suggestions. But I were going to use mpl, what would it take to do something along these lines: http://www.timelinemaker.com/product-samplecharts-constructiontimeline.html Basically, I would need a nicely formatted dates along the x-axis and then lightly colored rectangles with text in them. The width would show when I anticipate some part of the project starting and ending. The y coordinate of the rectangle would used to allow project portions to overlap. It would be nice but not essential if the rectangles had a little fade in and out in their back ground color instead of a solid color, but that is not essential. Is there a clean way to do this with mpl? Thanks, Ryan - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. 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] creating a timeline
bling-bling. I know it is eye candy and in questionable taste, but I think it fits my non-technical audience in this case. I think this is enough to get me going. Thanks John. Ryan On 9/20/07, John Hunter [EMAIL PROTECTED] wrote: On 9/20/07, Ryan Krauss [EMAIL PROTECTED] wrote: I would need to create a timeline for a Latex document (eps output). There may be other tools besides Matplotlib and I am open to suggestions. But I were going to use mpl, what would it take to do something along these lines: http://www.timelinemaker.com/product-samplecharts-constructiontimeline.html Basically, I would need a nicely formatted dates along the x-axis and then lightly colored rectangles with text in them. The width would show when I anticipate some part of the project starting and ending. The y coordinate of the rectangle would used to allow project portions to overlap. It would be nice but not essential if the rectangles had a little fade in and out in their back ground color instead of a solid color, but that is not essential. Is there a clean way to do this with mpl? See examples/broken_barh.py (this also allows breaks in the horizontal bars, eg if an event is interrupted and then resumes). I haven't added gradient fills on bars because I don't think they convey little if any information but just add to the glitz factor (an example of chart junk to use Tufte's phrase) but at some point we should bow to popular pressure and add it. Actually, you can hack gradient filled bars and axes backgrounds -- be careful, viewing the figure below may induce seizures. from pylab import figure, show, nx, cm def gbar(ax, x, y, width=0.5, bottom=0): X = [[.6, .6],[.7,.7]] for left,top in zip(x, y): right = left+width ax.imshow(X, interpolation='bicubic', cmap=cm.Blues, extent=(left, right, bottom, top), alpha=1) fig = figure() xmin, xmax = xlim = 0,10 ymin, ymax = ylim = 0,1 ax = fig.add_subplot(111, xlim=xlim, ylim=ylim, autoscale_on=False) X = [[.6, .6],[.7,.7]] ax.imshow(X, interpolation='bicubic', cmap=cm.copper, extent=(xmin, xmax, ymin, ymax), alpha=1) N = 10 x = nx.arange(N)+0.25 y = nx.mlab.rand(N) gbar(ax, x, y, width=0.7) ax.set_aspect('normal') show() - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. 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 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. 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] creating a timeline
I think I have something I like reasonably well. Is that attached timeline fairly intuitive? I am proposing a project for next summer that has two main parts. Each part has three subsections that are roughly one month long. Thanks, Ryan On 9/20/07, Ryan Krauss [EMAIL PROTECTED] wrote: I am really just getting to mess with this now and ran into an issue. I want to turn off the y axis and 3 sides of the border around the plot area, so that I left with just the bottom x-axis and its tick marks. Turning off the y axis is easy enough, but the only way I found to get rid of the border is with ax.set_frame_on(False) which also gets rid of my bottom x axis and leaves tick marks along the top (see attached). How do I get rid of the top tick marks, keep the bottom ones, and get the bottom x-axis back? Thanks, Ryan On 9/20/07, Ryan Krauss [EMAIL PROTECTED] wrote: bling-bling. I know it is eye candy and in questionable taste, but I think it fits my non-technical audience in this case. I think this is enough to get me going. Thanks John. Ryan On 9/20/07, John Hunter [EMAIL PROTECTED] wrote: On 9/20/07, Ryan Krauss [EMAIL PROTECTED] wrote: I would need to create a timeline for a Latex document (eps output). There may be other tools besides Matplotlib and I am open to suggestions. But I were going to use mpl, what would it take to do something along these lines: http://www.timelinemaker.com/product-samplecharts-constructiontimeline.html Basically, I would need a nicely formatted dates along the x-axis and then lightly colored rectangles with text in them. The width would show when I anticipate some part of the project starting and ending. The y coordinate of the rectangle would used to allow project portions to overlap. It would be nice but not essential if the rectangles had a little fade in and out in their back ground color instead of a solid color, but that is not essential. Is there a clean way to do this with mpl? See examples/broken_barh.py (this also allows breaks in the horizontal bars, eg if an event is interrupted and then resumes). I haven't added gradient fills on bars because I don't think they convey little if any information but just add to the glitz factor (an example of chart junk to use Tufte's phrase) but at some point we should bow to popular pressure and add it. Actually, you can hack gradient filled bars and axes backgrounds -- be careful, viewing the figure below may induce seizures. from pylab import figure, show, nx, cm def gbar(ax, x, y, width=0.5, bottom=0): X = [[.6, .6],[.7,.7]] for left,top in zip(x, y): right = left+width ax.imshow(X, interpolation='bicubic', cmap=cm.Blues, extent=(left, right, bottom, top), alpha=1) fig = figure() xmin, xmax = xlim = 0,10 ymin, ymax = ylim = 0,1 ax = fig.add_subplot(111, xlim=xlim, ylim=ylim, autoscale_on=False) X = [[.6, .6],[.7,.7]] ax.imshow(X, interpolation='bicubic', cmap=cm.copper, extent=(xmin, xmax, ymin, ymax), alpha=1) N = 10 x = nx.arange(N)+0.25 y = nx.mlab.rand(N) gbar(ax, x, y, width=0.7) ax.set_aspect('normal') show() - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. 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 attachment: timeline.png- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. 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] eliminating end labels on axes
I think I was the one who asked a similar question a while back. Here is a link to John's response: http://article.gmane.org/gmane.comp.python.matplotlib.general/5465 I followed his advice and created my own formatter: from matplotlib.ticker import LogFormatterMathtext class MyFormatter(LogFormatterMathtext): def __call__(self, x, pos=None): if pos==0: return '' # pos=0 is the first tick else: return LogFormatterMathtext.__call__(self, x, pos) ax.xaxis.set_major_formatter(MyFormatter()) On 9/14/07, Jouni K. Seppänen [EMAIL PROTECTED] wrote: James Boyle [EMAIL PROTECTED] writes: I have not been able to figure out how to just make the first and last ytick labels vanish. [...] I thought that the following might work but this just makes all the labels disappear - my understanding is incomplete. ytl = a.get_yticklabels() ytl[0]._visible = False ytl[-1]._text = False It is usually a bad idea to manipulate directly anything starting with an underscore -- that's a Pythonic way of indicating a private variable. The set_visible() method should work here: ytl = a.get_yticklabels() ytl[0].set_visible(False) -- Jouni K. Seppänen http://www.iki.fi/jks - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. 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 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. 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] LaTeX fonts
This is admittedly a stupid question, but just to be sure, I don't see usetex: True in your post. Ryan On 8/7/07, Johan Ekh [EMAIL PROTECTED] wrote: Hi all, I'm new to Python in general and Matplotlib in particular. I'm trying to create publication quality plots for inclusion in LaTeX papers and presentations and have some problems to get the fonts right. My matplotlibrc contains the following lines font.family: serif font.serif : Times, Palatino, New Century Schoolbook, Bookman, Computer Modern Roman font.sans-serif: Helvetica, Avant Garde, Computer Modern Sans serif font.cursive: Zapf Chancery font.monospace : Courier, Computer Modern Typewriter and my Python script contains the following lines params = {'backend': 'ps', 'axes.labelsize ': 12, 'text.fontsize': 12, 'xtick.labelsize': 10, 'ytick.labelsize': 10, 'text.usetex': True, 'figure.figsize': fig_size} rcParams.update(params) I run what I believe is a standard openSUSE 10.2 installation of tetex and python, including matplotlib. Still, fonts in my matplotlib plot are different from the ones used in my LaTeX document. Also, strangely psfrag does not seem to work? Nothing ever gets replaced in my plot! Can someone please help me out, what am I doing wrong? Best regards, Johan - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] matplotlib-users@lists.sourceforge.net
Sorry, forgot to copy the list. On 6/27/07, Ryan Krauss [EMAIL PROTECTED] wrote: I think what you are asking is how to make mpl plot different line types in colors and styles that are easily distinguishable when plotted in grayscale. I had tinkered with this a bit in the past and the final suggestion was to write some helper functions so that I could do the following: from mycyclers import colorcycler, linecycler for data in mydata: ax.plot(data, linestyle=linecycler(), color=colorcycler()) so that by writing a linecycler function I could control the line types plotted each time and the same with the color. Color would be specified as a grayscale such as '#808080' for a medium gray or '#00' for black. I didn't actually do it this way or I would post the code (I was in a hurry and did something hackish). I think that linecycler and colorcycler would be helper classes thta increment there own internal count when called and return a linestyle or color. I think what you want in the end is a simple way to do this: t=arange(0,1,0.01) y=sin(2*pi*t) x=cos(2*pi*t) plot(t,x,color='#00',linestyle='-') plot(t,y,color='#808080',linestyle=':') where color and line style would increment pseudo-automatically through lists you have defined and that you like. A slightly better approach might be: t=arange(0,1,0.01) y=sin(2*pi*t) x=cos(2*pi*t) data=[x,y] mycolors=['#00','#808080'] mytypes=['-',':'] def grayscaleplot(data,t): for n,item in enumerate(data): plot(t,item, color=mycolors[n], linestyle=mytypes[n]) FWIW, Ryan On 6/27/07, Emmanuel Favre-Nicolin [EMAIL PROTECTED] wrote: Hi, I didn't find any tip for preparation of simple black and white 2D plot, especially for nice output in eps for publication. Any suggestions are welcome. - 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 - 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] wx apps and matplotlib plots, are they friends?
I would also highly recommend Ken McIvor's wxmpl: http://agni.phys.iit.edu/~kmcivor/wxmpl/ It makes wxPython and mpl play very nicely together. I have been involved in several threads recently about how no to import pylab in data analysis libraries and when embedding in gui's. You may find this thread useful: http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg02732.html Ryan On 6/22/07, John Hunter [EMAIL PROTECTED] wrote: On 6/22/07, Paul Smith [EMAIL PROTECTED] wrote: I've converted an analysis program that does some plotting to use the matplotlib API, then wrote a GUI control program using wxWidgets to call it. I've tried to keep the two parts as separate as possible so there is an analysis class that is instantiated in the GUI part, and then the GUI part just calls the analysis methods. Ok, so under ipython -pylab everything seems to (mostly) go ok. The GUI This appears to be your problem. If you are using mpl in a wx app, you should not be importing pylab or running ipython in pylab mode because you will get mainloop conflicts. Rather, use the matplotlib API directly following the lead of examples/embedding_in_wx*.py and tthen run ipython in -wthread mode rather than pylab mode. JDH - 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 - 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] Documentation for 3D plotting?
There is a nice gnuplot python interface out there. Google for gnuplot.py On 6/22/07, Stephan Bourduas [EMAIL PROTECTED] wrote: On June 20, 2007, Eric Firing wrote: Unfortunately, the 3D plotting capability is incomplete and mostly unmaintained. Orest Kozyar wrote: One thing I would really love to be able to do is generate a surface map that is color-coded. Right now I can generate a single-color surface map, but a color-coded surface map would be much easier to interpret. I needed to make a surface plot last week and I ended up using gnuplot (http://www.gnuplot.info/) instead of matplotlib. As stated above, the 3D plotting capabilities of matplotlib are somewhat limited, so you may need to use an alternative package. gnuplot generates plots which are quite similar to Matlab, check out the 'pm3d' plot style: http://gnuplot.sourceforge.net/demo_4.2/pm3d.html You can also control the color map: http://gnuplot.sourceforge.net/demo_4.2/pm3dcolors.html Stephan - 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 - 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] Python issue of Computing in Science and Engineering available
My CiSE article can be downloaded from here: http://www.siue.edu/~rkrauss/python_stuff.html Ryan On 4/25/07, John Hunter [EMAIL PROTECTED] wrote: On 4/25/07, Fernando Perez [EMAIL PROTECTED] wrote: Since authors are allowed by their publication policy to keep a publicly available copy of their papers on their personal website, here's the ipython one: Didn't know that... here's a link to my matplotlib article http://nitace.bsd.uchicago.edu/misc/c3sci.pdf It might be nice to create a scipy wiki page linking to these PDFs. JDH - 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 - 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] [SciPy-user] plotting with scipy
I am not running Debian and am not on a linux box right now. I can be in a few minutes. I think we should move this to the matplotlib users list. Someone there can help you install on Debian. Ryan On 3/27/07, javi markez bigara [EMAIL PROTECTED] wrote: this is where the folder is /home2/diazdeim/matplotlib-0.90.0 i want to run the setup from the terminal but i dont know how to do it thaks for helping From: javi markez bigara [EMAIL PROTECTED] Reply-To: SciPy Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [SciPy-user] plotting with scipy Date: Tue, 27 Mar 2007 13:48:01 + this is the python i am using, i download the mathplotlib but i think is not working i just save it in the Desktop.. and this is the forder i get: matplotlib-0.90.0 Python 2.3.5 (#2, Sep 4 2005, 22:01:42) [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2 From: Ryan Krauss [EMAIL PROTECTED] Reply-To: SciPy Users List [EMAIL PROTECTED] To: SciPy Users List [EMAIL PROTECTED] Subject: Re: [SciPy-user] plotting with scipy Date: Tue, 27 Mar 2007 08:37:52 -0500 What platform are you running? There should be an executable for windows that puts them in the proper directory. They can go anywhere on your PYTHONPATH, but the right answer is in the directory C:\Python24\Lib\site-packages (or I presume Python25 if you are running the current version of python). So, I have the folders C:\Python24\Lib\site-packages\matplotlib C:\Python24\Lib\site-packages\scipy etc. On linux, you usually want to unzip the tarball and there should be a setup.py file in the top level. Then just run sudo python setup.py install (or similar if you aren't on a debian based sudo distribution). Let me know if you still have trouble. Ryan On 3/27/07, javi markez bigara [EMAIL PROTECTED] wrote: thanks a lot for ur reply i will download it but the thig is that i dont know were to put it them to import it from python. thanks a lot Ryan nowar From: Ryan Krauss [EMAIL PROTECTED] Reply-To: SciPy Users List [EMAIL PROTECTED] To: SciPy Users List [EMAIL PROTECTED] Subject: Re: [SciPy-user] plotting with scipy Date: Tue, 27 Mar 2007 07:30:48 -0500 I think almost all users of scipy use matplotlib instead of scipy's plotting capabilities. It is really a great package especially if you only need 2D plotting. Check out matplotlib.sourceforge.net. Ryan On 3/27/07, javi markez bigara [EMAIL PROTECTED] wrote: hi, i am looking for the easy way to plot some coordinates with scipy.gplt.pyPlot this is how i try it but is not working as i would like to the new list is a list of pair coordinates something like this: [-6.654644,65.5] [-6.645654,65.98798] [-6.987813,65.28951] [-6.645654,65.65987] [-6.634895,65.36985] import scipy.plt from scipy import gplt draw=scipy.gplt.pyPlot.Plot() draw.plot(newlist) draw.title('little map') draw.xtitle('longitude') draw.ytitle('latitude') the thing is that i get in the x axes the number of list and then two strait lines 65_ 50 35 20 5 -10- 0 1 2 3 4 5 this is wat it plots more or less can anybody help me. thanks in advance Nowar00 _ Descarga gratis la Barra de Herramientas de MSN http://www.msn.es/usuario/busqueda/barra?XAPID=2031DI=1055SU=http%3A//www.hotmail.comHL=LINKTAG1OPENINGTEXT_MSNBH ___ SciPy-user mailing list [EMAIL PROTECTED] http://projects.scipy.org/mailman/listinfo/scipy-user ___ SciPy-user mailing list [EMAIL PROTECTED] http://projects.scipy.org/mailman/listinfo/scipy-user _ Acepta el reto MSN Premium: Correos más divertidos con fotos y textos increíbles en MSN Premium. Descárgalo y pruébalo 2 meses gratis. http://join.msn.com?XAPID=1697DI=1055HL=Footer_mailsenviados_correosmasdivertidos ___ SciPy-user mailing list [EMAIL PROTECTED] http://projects.scipy.org/mailman/listinfo/scipy-user ___ SciPy-user mailing list [EMAIL PROTECTED] http://projects.scipy.org/mailman/listinfo/scipy-user _ Grandes éxitos, superhéroes, imitaciones, cine y TV... http://es.msn.kiwee.com/ Lo mejor para tu móvil
[Matplotlib-users] subplots with the OO interface (ax.rowNum, ax.colNum)
I have a figure with 2 subplots (2 rows, 1 column) created using the OO interface like this: ax1=fig.add_subplot(2,1,1) ax2=fig.add_subplot(2,1,2) After I have created these axes and plotted things on them, I want to be able to set their x and y lims. The function that creates the plot returns fig. I can then get to a list of the axes from fig.axes. My question is this: can I know from the list of axes or their individual properties which one is which - i.e. which one is the top one and which one is the bottom one? It looks like ax1.rowNum and colNum should refer to the parameters I want (rowNum in this case, since there is only one column). But there isn't a docstring for them. Is this there intended use (or at least a safe use of them)? 99% of the time, I will create the top one first so topfig=fig.axes[0] and bottomfig=fig.axes[1]. But if I ever screw that up, it could be bad. Thanks, Ryan - 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] subplots with the OO interface (ax.rowNum, ax.colNum)
Thanks John. That will work. Ryan On 3/20/07, John Hunter [EMAIL PROTECTED] wrote: On 3/20/07, Ryan Krauss [EMAIL PROTECTED] wrote: I have a figure with 2 subplots (2 rows, 1 column) created using the OO interface like this: ax1=fig.add_subplot(2,1,1) ax2=fig.add_subplot(2,1,2) After I have created these axes and plotted things on them, I want to be able to set their x and y lims. The function that creates the plot returns fig. I can then get to a list of the axes from fig.axes. My question is this: can I know from the list of axes or their individual properties which one is which - i.e. which one is the top one and which one is the bottom one? It looks like ax1.rowNum and colNum should refer to the parameters I want (rowNum in this case, since there is only one column). But there isn't a docstring for them. Is this there intended use (or at least a safe use of them)? 99% of the time, I will create the top one first so topfig=fig.axes[0] and bottomfig=fig.axes[1]. But if I ever screw that up, it could be bad. If you are creating subplots, you can do rows, cols, num = ax.get_geometry() You can also change the geometry with set_geometry. There are a couple of Subplot helper functions you may find useful, eg to selectively apply x and ylabeling: def is_first_col(self): return self.colNum==0 def is_first_row(self): return self.rowNum==0 def is_last_row(self): return self.rowNum==self.numRows-1 def is_last_col(self): return self.colNum==self.numCols-1 - 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] pylab vs. embedding in wx
I am learning the hard way that I don't know as much about matplotlib as I thought I did except for how to use pylab. I think I have managed to create a figure, add an axis, and plot something on it without pylab, but I don't know how to do the equivalent of show(). draw() needs a renderder and I can't seem to figure out how to create one. Here is what I have done so far: myfig = pylab.Figure() myaxes=myfig.add_axes((0,1,0,1)) t=arange(0,1,0.01) y=sin(2*pi*t) myaxes.plot(t,y) What do I need to do to show the plot from the command line in IPython (i.e. if I actually want to use pylab instead of OO)? I may be going about this the wrong way and it may be easier just to set up some imports of pylab that only trigger inside of functions, but I would like to have functions that are useful either from the IPython command line or in OOP situations. Following the examples for WX, I am doing this at the top of my OOP modules: from matplotlib.backends.backend_wxagg import Toolbar, FigureCanvasWxAgg from matplotlib.figure import Figure . . . class mplpanel(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent, -1) self.fig = Figure((5,5), 75) self.canvas = FigureCanvasWxAgg(self, -1, self.fig) And the my drawing commands operate on self.fig and then the last line of all plotting functions is self.canvas.draw(). So, it would be nice if my utility functions took a figure instance as an input and operated on it. Am I making any sense? Am I going about this revision in a good way? Thanks, Ryan On 3/15/07, Ryan Krauss [EMAIL PROTECTED] wrote: Thanks John. I know I have some clean up to do, I just want to do it right so it isn't an annual (or more often) thing On 3/15/07, John Hunter [EMAIL PROTECTED] wrote: On 3/15/07, Ryan Krauss [EMAIL PROTECTED] wrote: How should I be using matplotlib/pylab in my utility scripts so that they are compatible with embedding in wx? A good rule of thumb is to never import pylab at the top level for modules that need to be imported. In my own code, I often do something like def somefunc(figfunc): fig = figfunc() ax = fig.add_subplot(111) ax.plot([1,2,3]) and then I can call it with somefunc(pylab.figure) or a custom func that generates a GUI embedded figure instance. Eg, in my GTKApps, I have a functor like gtk_figure that returns a function that creates a figure embedded in a GTK window. In basemap, Jeffrey Whitaker does something like the following def somefunc(ax=None): if ax is None: import pylab ax = pylab.gca() Here the pylab import is triggered only when the function is called with default arguments. That way you can use it from GUI code without triggering a pylab import like somefunc(ax) and from other code where you want pylab do do everything with somefunc() I'm afraid you have some cleanup to do. Mixing pylab with embedded GUI code is a recipe for pain and misery. JDH - 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] pylab vs. embedding in wx
Thanks to Ken and John, I think I am off and running. Nice work on wxmpl Ken! I think it fills a significant need. The two attached files show a ridiculously simple example of what I am planning to do. It may be completely obvoius to others. test_plot.py is an example of a module that can be used from the command line with pylab and IPython and it can also be imported into a WX app (as demonstrated by wx_compatible.py). So, I will edit my data processing scripts to use this approach. Thanks again, Ryan On 3/19/07, Ryan Krauss [EMAIL PROTECTED] wrote: Sorry, I just googled wxmpl and found your page and am now downloading it. I may have a more intelligent question momentarily. You may ignore that part of my response. Ryan On 3/19/07, Ryan Krauss [EMAIL PROTECTED] wrote: Thanks for your thoughts Ken. Sorry, I assumed a bit on the context of my comments. I have some data processing utility scripts and I want to now use with a WX application. The problem is that the utility modules were written without any thought of this future use in mind and in all of them I have something like from pylab import figure, cla, clf, plot, semiliogx, show, ... at the top. This makes them completely incompatible with embedding in a WX application. So, I need to re-write them and I want to know how to do that best. John had some suggestions and I had some new questions as I tried to act on his thoughts. So, the actual plotting functions don't have to be re-useable in both contexts, but it would be nice. I can't actually run your code because I don't have the wxmpl.py module. Looking at it, it looks like a really nice set of functions that work cleanly with embedding in a backend. How could I call one of the functions from the command line? Could I do something like: import plotting, pylab myfig = pylab.figure() plotting.plot_simple(myfig) and would I need any additional commands to actually show the figure? Let me know if that makes sense and please send me the wxmpl.py file or let me know where I can get it. Thanks again, Ryan On 3/19/07, Ken McIvor [EMAIL PROTECTED] wrote: Ryan, In my (limited) experience, it's dicey to mix pylab's plotting functionality and the OO API. I guess I'm a little unclear exactly what your use case is for this. It sounds like you're goal is to create a library of functions that operate on Figure instances, perhaps so you can use them both interactively and as part of a wxPython application. If that's the case, I'd recommend you try using pylab's gcf() and draw () to acquire and redraw the current Figure instance from within IPython. You can also save the return value of pylab's figure(), which returns a Figure that's already been attached to the appropriate renderer. This way you can use the OO API for plotting without having to futz with the drawing machinery directly. This script might give you some ideas about how to structure your code. It contains several of the MPL examples re-coded as functions that accept a Figure instance and use the OO API for plotting. http://svn.csrri.iit.edu/mr-software/wxmpl/trunk/demos/plotting.py Ken def myplot(fig, x, y): myaxes = fig.gca() myaxes.plot(x,y) myaxes.set_title('Test') if __name__ == '__main__': import pylab from scipy import arange, pi, sin t=arange(0,1,0.01) y=sin(2*pi*t) myfig = pylab.figure() myplot(myfig,t,y) pylab.draw() pylab.show() import wxmpl # Create the PlotApp instance. # The title string is one of several optional arguments. app = wxmpl.PlotApp('WxMpl Example 1') from matplotlib.numerix import arange, pi, sin x = arange(0.0, 1, 0.01) y = sin(2*pi*x) ### Plot it ### # All of WxMpl's plotting classes have a get_figure(), # which returns the associated matplotlib Figure. fig = app.get_figure() import test_plot test_plot.myplot(fig, x, y) # == This spot is where the plotting happens # Let wxPython do its thing. app.MainLoop() - 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] source install question: WXAgg's accelerator requires the wxPython headers.
I am getting a message during a source install that WXAgg's accelerator requires the wxPython headers. What do I need to do to get them for Ubuntu? I think I have all wx packages installed? Do I need to download the source tarball from wxPython.org? If so, where should I put the headers? Ryan - 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] pylab vs. embedding in wx
I have a problem that probably highlights a problem with how I normally use mpl vs. how I should use it. I have some utility scripts that do various data processing tasks and also have convenience functions for plotting data using pylab. Almost all of my scripts have a line like this near the top: from pylab import figure, cla, clf, plot, subplot, show, ylabel, xlabel, xlim, ylim, semilogx, legend, title, savefig I am now trying to import some of my data processing functions into a script that is embedding matplotib in a wxPython application following the embedding_in_wx#.py examples. I am getting this error: [EMAIL PROTECTED]:~/siue/Research/PythonSimulationEnvironment$ python SystemID_gui.py Traceback (most recent call last): File SystemID_gui.py, line 18, in ? import rwkbode File /home/ryan/pythonutil/rwkbode/__init__.py, line 3, in ? import pylab File /usr/lib/python2.4/site-packages/pylab.py, line 1, in ? from matplotlib.pylab import * File /usr/lib/python2.4/site-packages/matplotlib/pylab.py, line 216, in ? from backends import new_figure_manager, draw_if_interactive, show ImportError: cannot import name new_figure_manager which seems to say that pylab cannot be imported after my wx mpl panel has done this: import matplotlib import wx from scipy import sin, cos, pi, atleast_1d, shape, log10 #from wxPython.wx import * matplotlib.use('WXAgg') import matplotlib.cm as cm from matplotlib.backends.backend_wxagg import Toolbar, FigureCanvasWxAgg from matplotlib.figure import Figure import matplotlib.numerix as numerix import matplotlib.numerix.mlab as mlab from matplotlib.mlab import meshgrid How should I be using matplotlib/pylab in my utility scripts so that they are compatible with embedding in wx? Thanks, Ryan - 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] 3d axis orientation
I am using axes3d to draw wireframes with code like this: from numpy import * import pylab as p import matplotlib.axes3d as p3 fig1 = figure(1) ax1 = p3.Axes3D(fig1) ax1.plot_wireframe(x,y,z) When this gets done drawing, I can click and drag with my mouse to rotate the figure. I would like to set the orientation from a script. Is there a method of either fig1 or ax1 to do this? Thanks, Ryan - 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] 3d wire frame with thicker lines
I need to generate a drawing of a robot that is essentially a serial connection of lines in 3D. I have been trying to use the recipe at http://www.scipy.org/Cookbook/Matplotlib/mplot3D This I think would work. The only drawback is that I would like to adjust the thickness of the lines drawn. Trying to pass a kwarg of linewidth=2.0 doesn't work. Can a wireframe with a thick line be drawn easily with matplotlib? Thanks, Ryan - 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 set figure size
You have two options. savefig does have a dpi option that will essentially set the figure size for the saved file: savefig('myfile.png',dpi=300) play with dpi until you get a figure size you like. The other way to set the figure size is to specify it when you create the figure: figure(1,(10,8)) would create a fairly large figure. The figure (1 in this case) must not already exist or at least it can't be shown on your screen already. By that I mean if you have already called figure(1) previously in your code, you must close it before you try to call figure(1,(10,8)) or the figure size won't be affected. Ryan On 11/6/06, Chuang [EMAIL PROTECTED] wrote: Hi there, I want to automatically generated hundreds of figures with matplotlib. For each figure, I could use 'plot(Xi)' and 'show()' to draw the figure, and press the 'save' button in the figure panel, but this is not too automatically. Although I could use 'savefig()' to save the figures rather than using 'show()' to show it, and this makes whole program fully automatically, I don't know howto set the figure size before 'save' it (e.g. set size to 3000x1000pixel). The function 'savefig()' doesn't have any option to set figure size. So which function should I go to? or what should I do before using 'savefig()'? Thanks a lot, CC - 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 - 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
Re: [Matplotlib-users] dvipng/miktex 2.5 usetex problem
Thanks Darren. type1cm got installed on the fly by miktex the first time I ran this, but that must not have taken effect fast enough or something. The miktex package manager now shows it as installed and deleting my matplotlib tex.cache and ttfont.cache and re-running my test leads to the usual, beautiful results (without changing the default fonts). Thank again, Ryan On 10/28/06, Darren Dale [EMAIL PROTECTED] wrote: You could try changing your font settings in matplotlibrc, maybe times for serif and helvetica for sans-serif. dvipng is trying to locate a font that hasn't been (or cannot be) generated. This is usually an issue with bitmapped fonts, which are generated on demand, so you would get lots of these messages when working with a new Miktex install. I dont know why bitmapped fonts are being used though, since usetex specifically asks for type1 fonts. Maybe you need to go into your miktex package manager and make sure you have type1cm available on your system. Darren On Saturday 28 October 2006 12:25 am, Ryan Krauss wrote: I am trying to use latex with matplolib on Windows XP with MikTex 2.5 and dvipng 1.8. I am getting this warning: dvipng warning: font cmsy10 at 512 dpi not found, characters will be left blank when I do this: t=arange(0,1,0.01) y=sin(2*pi*t) plot(t,y) and this ylabel('$y(t)$') leads to dvipng warning: font cmr17 at 356 dpi not found, characters will be left blank with no ylabel. I am also getting a lot of other output (see below). How do I fix this? Thanks, Ryan == Trying to make PK font cmmi12 at 512 DPI... Creating cmmi12.pk... Running mf... This is METAFONT, Version 2.71828 (MiKTeX 2.5) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\cmmi12.mf (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\cmbase.mf) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\mathit.mf (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\romanu.mf [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\itall.mf [97] [98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\greeku.mf [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\greekl.mf [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\italms.mf [64] [96] [123] [124] [125] [126] [127]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\olddig.mf [48] [49] [50] [51] [52] [53] [54] [55] [56] [57]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\romms.mf [40] [41] [42] [43] [44] [45] [46] [47] [58] [59] [60] [61] [62] [63] [91] [92] [93] [94] [95]) ) ) Font metrics written on cmmi12.tfm. Output written on cmmi12.512gf (128 characters, 25960 bytes). Transcript written on cmmi12.log. METAFONT failed for some reason ignoring 0 strange path(s) Running gftopk... This is GFtoPK, Version 2.3 (MiKTeX 2.5) 'METAFONT output 2006.10.27:2322' 25960 bytes packed to 14164 bytes. dvipng warning: font cmmi12 at 512 dpi not found, characters will be left blan Trying to make PK font cmr17 at 356 DPI... Creating cmr17.pk... Running mf... This is METAFONT, Version 2.71828 (MiKTeX 2.5) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\cmr17.mf (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\cmbase.mf) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\roman.mf (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\romanu.mf [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\romanl.mf [97] [98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\greeku.mf [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\romand.mf [48] [49] [50] [51] [52] [53] [54] [55] [56] [57]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\romanp.mf [36] [38] [63] [62]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\romspl.mf [16] [17] [25] [26] [27] [28]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\romspu.mf [29] [30] [31]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\punct.mf [33] [60] [35] [37] [39] [40] [41] [42] [43] [44] [46] [47] [58] [59] [61] [64] [91] [93] [96]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\accent.mf [18] [19
[Matplotlib-users] dvipng/miktex 2.5 usetex problem
I am trying to use latex with matplolib on Windows XP with MikTex 2.5 and dvipng 1.8. I am getting this warning: dvipng warning: font cmsy10 at 512 dpi not found, characters will be left blank when I do this: t=arange(0,1,0.01) y=sin(2*pi*t) plot(t,y) and this ylabel('$y(t)$') leads to dvipng warning: font cmr17 at 356 dpi not found, characters will be left blank with no ylabel. I am also getting a lot of other output (see below). How do I fix this? Thanks, Ryan == Trying to make PK font cmmi12 at 512 DPI... Creating cmmi12.pk... Running mf... This is METAFONT, Version 2.71828 (MiKTeX 2.5) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\cmmi12.mf (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\cmbase.mf) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\mathit.mf (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\romanu.mf [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\itall.mf [97] [98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\greeku.mf [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\greekl.mf [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\italms.mf [64] [96] [123] [124] [125] [126] [127]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\olddig.mf [48] [49] [50] [51] [52] [53] [54] [55] [56] [57]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\romms.mf [40] [41] [42] [43] [44] [45] [46] [47] [58] [59] [60] [61] [62] [63] [91] [92] [93] [94] [95]) ) ) Font metrics written on cmmi12.tfm. Output written on cmmi12.512gf (128 characters, 25960 bytes). Transcript written on cmmi12.log. METAFONT failed for some reason ignoring 0 strange path(s) Running gftopk... This is GFtoPK, Version 2.3 (MiKTeX 2.5) 'METAFONT output 2006.10.27:2322' 25960 bytes packed to 14164 bytes. dvipng warning: font cmmi12 at 512 dpi not found, characters will be left blan Trying to make PK font cmr17 at 356 DPI... Creating cmr17.pk... Running mf... This is METAFONT, Version 2.71828 (MiKTeX 2.5) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\cmr17.mf (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\cmbase.mf) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\roman.mf (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\romanu.mf [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\romanl.mf [97] [98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\greeku.mf [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\romand.mf [48] [49] [50] [51] [52] [53] [54] [55] [56] [57]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\romanp.mf [36] [38] [63] [62]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\romspl.mf [16] [17] [25] [26] [27] [28]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\romspu.mf [29] [30] [31]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\punct.mf [33] [60] [35] [37] [39] [40] [41] [42] [43] [44] [46] [47] [58] [59] [61] [64] [91] [93] [96]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\accent.mf [18] [19] [20] [21] [22] [23] [24] [32] [94] [95] [125] [126] [127]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\romlig.mf [11] [12] [13] [14] [15]) (C:\Program Files\MiKTeX 2.5\fonts\source\public\cm\comlig.mf [34] [45] [92] [123] [124]) ) ) Font metrics written on cmr17.tfm. Output written on cmr17.356gf (128 characters, 24612 bytes). Transcript written on cmr17.log. METAFONT failed for some reason ignoring 0 strange path(s) Running gftopk... This is GFtoPK, Version 2.3 (MiKTeX 2.5) 'METAFONT output 2006.10.27:2322' 24612 bytes packed to 11084 bytes. dvipng warning: font cmr17 at 356 dpi not found, characters will be left blank - 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
Re: [Matplotlib-users] segfault from svn
If I change numerix to numarray, this goes away. Is anyone else out there successfully running svn mpl with: In [2]: numpy.__version__ Out[2]: '1.0rc1.dev3190' In [3]: matplotlib.__version__ Out[3]: '0.87.5' Thanks, Ryan On 9/19/06, Ryan Krauss [EMAIL PROTECTED] wrote: I just upgraded matplotlib, numpy, scipy, and ipython to currect svn. I am getting a segfault with pylab: Python 2.4.2 (#2, Sep 30 2005, 21:19:01) [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2 Type help, copyright, credits or license for more information. import pylab loaded rc file /home/ryan/.matplotlib/matplotlibrc matplotlib version 0.87.5 verbose.level debug-annoying interactive is False platform is linux2 loaded modules: ['pylab', '_bisect', '__future__', 'copy_reg', 'sre_compile', 'distutils', 'itertools', '_sre', '__main__', 'popen2', 'site', '__builtin__', 'datetime', 'distutils.re', 'matplotlib.re', 'matplotlib.tempfile', 'encodings', 'pytz.datetime', 'shutil', 'distutils.string', 'dateutil', 'matplotlib.datetime', 'posixpath', '_random', 'tempfile', 'errno', 'matplotlib.warnings', 'binascii', 'encodings.codecs', 'sre_constants', 're', 'matplotlib.md5', 'os.path', 'pytz.sys', '_codecs', 'distutils.sysconfig', 'encodings.exceptions', 'pytz.sets', 'math', 'fcntl', 'stat', 'zipimport', 'string', 'warnings', 'encodings.types', 'UserDict', 'encodings.utf_8', 'matplotlib', 'distutils.os', 'sys', 'pytz.tzinfo', 'pytz', 'matplotlib.__future__', 'codecs', 'matplotlib.sys', 'readline', 'matplotlib.pytz', 'types', 'md5', 'matplotlib.dateutil', 'matplotlib.os', 'thread', 'sre', 'bisect', 'matplotlib.distutils', 'signal', 'distutils.errors', 'random', 'linecache', 'matplotlib.shutil', 'posix', 'encodings.aliases', 'sets', 'exceptions', 'sre_parse', 'pytz.bisect', 'distutils.sys', 'os', 'strop'] numerix numpy 1.0rc1.dev3190 font search path ['/usr/lib/python2.4/site-packages/matplotlib/mpl-data'] trying fontname /usr/lib/python2.4/site-packages/matplotlib/mpl-data/VeraMoIt.ttf trying fontname /usr/lib/python2.4/site-packages/matplotlib/mpl-data/cmsy10.ttf trying fontname /usr/lib/python2.4/site-packages/matplotlib/mpl-data/VeraMoBd.ttf trying fontname /usr/lib/python2.4/site-packages/matplotlib/mpl-data/VeraBI.ttf trying fontname /usr/lib/python2.4/site-packages/matplotlib/mpl-data/cmex10.ttf trying fontname /usr/lib/python2.4/site-packages/matplotlib/mpl-data/Vera.ttf $HOME=/home/ryan CONFIGDIR=/home/ryan/.matplotlib loaded ttfcache file /home/ryan/.matplotlib/ttffont.cache Segmentation fault Help me please. I am running Ubuntu Breezy Ryan - 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] Problem with windows install
I am trying to install matplotlib on my office Windows computer. I have installed the following: python-2.4.3.msi numpy-1.0b5.win32-py2.4.exe scipy-0.5.1.win32-py2.4.exe matplotlib-0.87.5.win32-py2.4.exe on a completely fresh install. I am getting the following message: H:\python Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. import pylab Traceback (most recent call last): File stdin, line 1, in ? File C:\Python24\Lib\site-packages\pylab.py, line 1, in ? from matplotlib.pylab import * ImportError: No module named matplotlib.pylab import matplotlib Traceback (most recent call last): File stdin, line 1, in ? ImportError: No module named matplotlib What am I doing wrong? Thanks, Ryan - 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
Re: [Matplotlib-users] exponent fonts with usetex
It seems like no one has any comments on our plans concerning the exponent fonts. Can you outline for me what it would take to fix this? If it is fairly simple I may take a crack at it. Ryan On 6/14/06, Darren Dale [EMAIL PROTECTED] wrote: I agree that this little experiment of trying to work around latex's limitations has been too much trouble. I suggest we go back to the old behavior, and anyone who wants sans-serif fonts in their exponents can use regular mathtext. I'm hopeful that Edin can make some strides with mpl's mathtext support, and in the meantime, people should get decent results if they set ps.useafm : True in their rc settings. Comments? On Wednesday 14 June 2006 19:53, Ryan Krauss wrote: (Sorry, I submitted this email with a real figure instead of a toy example and the file size was too big and it awaits moderator approval). I am afraid I asked you to open a can of worms and now I don't know what we should do. With my font size settings, \small looks to small for the exponents. I tried \normalsize and actually got decent results with \large (replacing all occurances of \small in your ticker.py). See that attached file. But if \small looked good with your settings, I am afraid things are now dependent on the font settings in the rc file as far as what should go in the latex command for the exponents. I remember that this problem came up because I complained about serif fonts in my exponents and we were having a hard time making tex use sans serif math fonts. Maybe the best solution is for me to go back in time and retract that complaint. I don't know. Sorry about the mess this had made. I have plots I am fairly happy with (I will poke around in my rc file and see if I can find out why my x and y axis fonts look different). Ryan On 6/14/06, Ryan Krauss [EMAIL PROTECTED] wrote: I am afraid I asked you to open a can of worms and now I don't know what we should do. With my font size settings, \small looks to small for the exponents. I tried \normalsize and actually got decent results with \large (replacing all occurances of \small in your ticker.py). See that attached file. But if \small looked good with your settings, I am afraid things are now dependent on the font settings in the rc file as far as what should go in the latex command for the exponents. I remember that this problem came up because I complained about serif fonts in my exponents and we were having a hard time making tex use sans serif math fonts. Maybe the best solution is for me to go back in time and retract that complaint. I don't know. Sorry about the mess this had made. I have plots I am fairly happy with (I will poke around in my rc file and see if I can find out why my x and y axis fonts look different). Ryan On 6/14/06, Ryan Krauss [EMAIL PROTECTED] wrote: I feel bad that I caused this problem and am now asking you to fix it. Ryan On 6/14/06, Darren Dale [EMAIL PROTECTED] wrote: This is an artifact that was introduced when I tried to give you support for sans-serif fonts in the exponent. Try the attached ticker.py, it wraps the exponent in {\small}. Let me know if this is acceptable, and I'll commit it. On Wednesday 14 June 2006 19:14, Ryan Krauss wrote: I still have the problem with large exponents with your matplotlibrc file (but the y-axis plots are no longer different). Any thoughts on what I should try next? Ryan On 6/14/06, Darren Dale [EMAIL PROTECTED] wrote: On Wednesday 14 June 2006 18:51, you wrote: There was a lot of stuff in my tex.cache, but deleting didn't solve my problem. I may have some strange choices for my fonts and font sizes. Can you send me a copy of your matplotlibrc file. Ryan On 6/14/06, Darren Dale [EMAIL PROTECTED] wrote: Hi Ryan, I'm using the latest svn as well (2479), and I cant reproduce your problem. Try deleting your tex.cache. Darren On Wednesday 14 June 2006 18:14, Ryan Krauss wrote: I am having a problem with the fonts for exponents on semilog plots with usetex. The attached figure can be generated on my machine with figure(1) t=arange(0,10,0.01) y=sin(2*pi*t) semilogx(t,y) I just upgraded to the latest svn and now the y-axis plots look different from the x-axis. matplotlib.__version__ Out[6]: '0.87.3' Ryan -- Darren S. Dale, Ph.D. Cornell High Energy Synchrotron Source Cornell University 200L Wilson Lab Rt. 366 Pine Tree Road Ithaca, NY 14853