Re: [Matplotlib-users] cxfreeze
I managed to resolve it, by following Mike's hint thanks Mike. It was simply to change the setup.py script to import cx_Freeze import sys import matplotlib base = None if sys.platform == win32: base = Win32GUI executables = [ cx_Freeze.Executable(script.py, base = base) ] cx_Freeze.setup( name = script, options = {build_exe: {include_files:[( matplotlib.get_data_path(),mpl-data)],}}, version = 0.1, description = Sample matplotlib script, executables = executables) Peter On Friday 19 March 2010, Michael Droettboom wrote: I have no experience with cx_freeze, but the page on packaging matplotlib with py2exe may be relevant. You do need to find a way to convince cx_freeze to include the data files and then a way for matplotlib to find them at run time. Mike Peter Bloomfield wrote: Hi, I want to build executables from python scripts that call matplotlib under linux. To this end I have installed cxfreeze on my SuSE 11.2 machine I have tried two methods 1. Execute the command 'cxfreeze script.py' and 2. Creating a setup.py script import cx_Freeze import sys base = None if sys.platform == win32: base = Win32GUI executables = [ cx_Freeze.Executable(script.py, base = base) ] cx_Freeze.setup( name = script, version = 0.1, description = Sample matplotlib script, executables = executables) and then execute 'python setup.py build' In both cases I get an executable, but when executed I get the following error RuntimeError: Could not find the matplotlib data files The version of matplotlib I am running is 0.99.1.1 and Python 2.6.2 Does anyone have any thoughts/suggestions to resolve this, thanks Peter -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] the problem in pylab_examples example code: image_demo2.py
The 1st code snippet of image_demo2.py is as follows #!/usr/bin/env python from pylab import * w, h = 512, 512 s = file('../data/ct.raw', 'rb').read() A = fromstring(s, uint16).astype(float) A *= 1.0/max(A) A.shape = w, h I replaced s = file('../data/ct.raw', 'rb').read() with s = file('/home/jaguar/Developemnt/image_demo2.png', 'rb').read() The image is same as in given demo example(its given in .png format) and rest of code is also same. when I run it it gives the error as * * *A = fromstring(s, uint16).astype(float)* *ValueError: string size must be a multiple of element size* WHat can be the error in program? I may asking stupid question Thanks in advance ! Regards Yogesh -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Overlapping labels in pie charts
Hello, I am having some issues generating pie charts, when some of the slices become very small, their labels will draw on top of each other, making it impossible to distinguish between them. And I am trying to avoid using a legend. Does anyone know if there is a way to properly position labels of pie charts to avoid overlapping. (By for example distributing them vertically with lines pointing to their respective slices) Similar to what is done here: http://chart.apis.google.com/chart?cht=pchd=s:Uf9achs=250x100chl=January|February|March|April -- Regards Rune V. Sjoen -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Sharing axes on multiple subplots
In the current implementation, sharing the axis does not mean sharing its scale. This is not a subplots-specific issue, but applies to all kind of axes sharing. So you need to change the scale of all the axes even though they have shared axis. What seems to be a better approach to me is to initialize subplots with proper scale. f, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2,2, sharey=True, subplot_kw=dict(yscale=log)) Regards, -JJ On Mon, Mar 22, 2010 at 1:18 PM, Gökhan Sever gokhanse...@gmail.com wrote: Hello, I am testing the newly added subplots function in ipython -pylab with the following code: f, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2,2, sharey=True) ax1.plot(np.random.random(20)) ax2.plot(np.random.random(20)) ax3.plot(np.random.random(20)) ax4.plot(np.random.random(20)) For some reason scaling the y-axes logaritmically works only on the focused figure canvas, the rest of the subplots are scaled in a distorted fashion. Axes labels change to proper notation but the scaling stays as if linear along with the data. See for better description: http://img408.imageshack.us/img408/7149/logscale.png Any ideas? -- Gökhan -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] 3d pie charts
You need to define your own path (or you may combine a wedge and rectangles). This may be helpful. http://matplotlib.sourceforge.net/users/path_tutorial.html Regards, -JJ On Sat, Mar 20, 2010 at 2:33 PM, Gary Jaffe gfj...@gmail.com wrote: Hi all -- I'm new to Matplotlib, and it looks like a great project, but I'm having trouble figuring out one thing. I would like to draw a pie chart, but have each wedge appear to have thickness. I see from the examples and the docs that it is possible to draw a wedge in relief so that it appears to cast a shadow, but I don't see how to make it look something like this. Pardon my bad ascii art. :) ___ | \ / \ \ / \ \ / \ \ / \ \ / \ \ / \ \ / \ \ / \ \/ \| Is there a way to do this? Thanks, Gary -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Why the name Axes?
How was the name Axes chosen for the Axes component? :) It did confuse me for at least two days while I was first learning mpl. It's in my thoughts again as I'm writing some wrapper classes for it; what were the alternatives considered, even after the fact? :) -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] the problem in pylab_examples example code: image_demo2.py
The example assumes that the file is a dump of uin16 512x512 array. So, no doubt that it won't work with a png file. See http://matplotlib.sourceforge.net/users/image_tutorial.html -JJ On Tue, Mar 23, 2010 at 9:41 AM, yogesh karpate yogeshkarp...@gmail.com wrote: The 1st code snippet of image_demo2.py is as follows #!/usr/bin/env python from pylab import * w, h = 512, 512 s = file('../data/ct.raw', 'rb').read() A = fromstring(s, uint16).astype(float) A *= 1.0/max(A) A.shape = w, h I replaced s = file('../data/ct.raw', 'rb').read() with s = file('/home/jaguar/Developemnt/image_demo2.png', 'rb').read() The image is same as in given demo example(its given in .png format) and rest of code is also same. when I run it it gives the error as A = fromstring(s, uint16).astype(float) ValueError: string size must be a multiple of element size WHat can be the error in program? I may asking stupid question Thanks in advance ! Regards Yogesh -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Sharing axes on multiple subplots
Yes, that makes it work. Thank you JJ. On Tue, Mar 23, 2010 at 10:58 AM, Jae-Joon Lee lee.j.j...@gmail.com wrote: In the current implementation, sharing the axis does not mean sharing its scale. This is not a subplots-specific issue, but applies to all kind of axes sharing. So you need to change the scale of all the axes even though they have shared axis. What seems to be a better approach to me is to initialize subplots with proper scale. f, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2,2, sharey=True, subplot_kw=dict(yscale=log)) Regards, -JJ On Mon, Mar 22, 2010 at 1:18 PM, Gökhan Sever gokhanse...@gmail.com wrote: Hello, I am testing the newly added subplots function in ipython -pylab with the following code: f, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2,2, sharey=True) ax1.plot(np.random.random(20)) ax2.plot(np.random.random(20)) ax3.plot(np.random.random(20)) ax4.plot(np.random.random(20)) For some reason scaling the y-axes logaritmically works only on the focused figure canvas, the rest of the subplots are scaled in a distorted fashion. Axes labels change to proper notation but the scaling stays as if linear along with the data. See for better description: http://img408.imageshack.us/img408/7149/logscale.png Any ideas? -- Gökhan -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Gökhan -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Overlapping labels in pie charts
This should be doable using the annotation. Here is a simple cook-up I just did. it uses a naive algorithm to place the labels, but I guess it gives you an idea how things work. a screenshot is attached. Regards, -JJ from pylab import * # make a square figure and axes figure(1, figsize=(6,6)) ax = axes([0.1, 0.1, 0.8, 0.8]) labels = 'Frogs', 'Hogs', 'Dogs', 'Logs' fracs = [15,30,45, 10] explode=(0, 0.05, 0, 0) p = pie(fracs, explode=explode, shadow=True) title('Raining Hogs and Dogs', bbox={'facecolor':'0.8', 'pad':5}) for p1, l1 in zip(p[0], labels): r = p1.r dr = r*0.1 t1, t2 = p1.theta1, p1.theta2 theta = (t1+t2)/2. xc, yc = r/2.*cos(theta/180.*pi), r/2.*sin(theta/180.*pi) x1, y1 = (r+dr)*cos(theta/180.*pi), (r+dr)*sin(theta/180.*pi) if x1 0 : x1 = r+2*dr ha, va = left, center tt = -180 cstyle=angle,angleA=0,angleB=%f%(theta,) else: x1 = -(r+2*dr) ha, va = right, center tt = 0 cstyle=angle,angleA=0,angleB=%f%(theta,) annotate(l1, (xc, yc), xycoords=data, xytext=(x1, y1), textcoords=data, ha=ha, va=va, arrowprops=dict(arrowstyle=-, connectionstyle=cstyle, patchB=p1)) show() attachment: new_piechart.png-- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Why the name Axes?
David Carmean wrote: How was the name Axes chosen for the Axes component? :) Much of the MPL API was modeled after the Matlab API, so you may have to ask Mathworks. However: an axis is a single thing -- the x axis. axes is the plural of axis, so when you have a thing with both an x and y axis, is is an axes. -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 chris.bar...@noaa.gov -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problem saving a plot in OSX
I am using the enthought distribution, I would hope that it was done right but maybe not. Then it may be an EPD bug, you might as on the EPD list. As a possible temporary fix, when I had this problem, I was able to copy and paste the name of a file into the OSX save box from another window/terminal etc, and so could still make new names for the files. You also might try a different back-end. I'm not sure what EPD sets as the default but there are sometimes odd Tk issues. EPD should support wxPython (wxAgg), and maybe the macosx back-end. -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 chris.bar...@noaa.gov -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] basemap and py2exe
Yagua Rovi wrote: I identify the problem. There is no basemap data directory and the app search those datas in [MY_DIR]\dist\library.zip\mpl_toolkits\basemap\data But I don't know how to add it at the compilation You can add those to data_files, or you may need to copy them with a little custom code at the end of your setup.py file. -CHB 2010/3/22 Friedrich Romstedt friedrichromst...@gmail.com: I'm not shure whether the following suggestion solves your problem, but it would simplify your script anyway. import matplotlib ... setup(..., data_files = matplotlib.get_py2exe_datafiles()) And maybe don't forget to exclude 'libgdk_pixbuf-2.0-0.dll' (on my system) in 'dll_excludes'. But I actually don't remember for what reason I had to exclude it. hth, Friedrich -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- 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 chris.bar...@noaa.gov -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problem saving a plot in OSX
On Tue, Mar 23, 2010 at 09:58:11AM -0700, Christopher Barker wrote: You also might try a different back-end. I'm not sure what EPD sets as the default but there are sometimes odd Tk issues. EPD should support wxPython (wxAgg), and maybe the macosx back-end. I believe EPD's default is wxAgg. -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] basemap and py2exe
2010/3/22 Friedrich Romstedt friedrichromst...@gmail.com: I'm not shure whether the following suggestion solves your problem, but it would simplify your script anyway. import matplotlib ... setup(..., data_files = matplotlib.get_py2exe_datafiles()) And maybe don't forget to exclude 'libgdk_pixbuf-2.0-0.dll' (on my system) in 'dll_excludes'. But I actually don't remember for what reason I had to exclude it. hth, Friedrich Hello, I wrote the solution implemented in the hope that it serves at someone else. The Situation = I wrote a script using basemap and matplolib. which draw a map.Dread a file containing a bunch of Genbank accession numbers, and downloaded the Genbank records: from pylab import * import os, sys import os.path from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties map = Basemap(projection='cyl', resolution='l') map.drawcoastlines() map.drawmapboundary() ... This worked fine as a script, but when I attempted to turn it into a Windows executable with py2exe and the setup.py script: from distutils.core import setup import py2exe from distutils.core import setup import py2exe import glob import matplotlib opts = { 'py2exe': { includes : [sip, PyQt4, matplotlib.backends, matplotlib.backends.backend_qt4agg, matplotlib.figure,pylab, numpy, matplotlib.numerix.fft,mpl_toolkits.basemap, matplotlib.numerix.linear_algebra, matplotlib.numerix.random_array, matplotlib.backends.backend_tkagg], # 'excludes': ['_gtkagg', '_tkagg','_agg2','_cairo', '_cocoaagg', '_fltkagg', '_gtk', '_gtkcairo', ], 'dll_excludes': ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll'] } } data_files = [(r'mpl-data', glob.glob(r'C:\Python25\Lib\site-packages\matplotlib\mpl-data\*.*')), # Because matplotlibrc does not have an extension, glob does not find it (at least I think that's why) # So add it manually here: (r'mpl-data', [r'C:\Python25\Lib\site-packages\matplotlib\mpl-data\matplotlibrc']), (r'mpl-data\images',glob.glob(r'C:\Python25\Lib\site-packages\matplotlib\mpl-data\images\*.*')), (r'mpl-data\fonts',glob.glob(r'C:\Python25\Lib\site-packages\matplotlib\mpl-data\fonts\*.*'))] setup(windows=[{script : myapp.py, icon_resources: [(1, myapp.ico)]}, ], version = 1.0, options=opts, data_files=data_files) with the command python setup.py py2exe, attempting to run the resulting myapp.exe would throw an error. The Error This is the error thrown on running the executable: Traceback (most recent call last) File myapp.py, line 40, in module File mpl_toolkits\basemap\__init__.pyc, line 774, in __init__ File mpl_toolkits\basemap\__init__.pyc, line 848, in _readboundarydata IOError: Unable to open boundary dataset file. Only the 'crude', 'low', 'intermediate' and 'high' resolution datasets are installed by default. If you are requesting a 'full' resolution dataset, you may need to download and install those files separately (see the basemap README for details). The Problem == Location of basemap data The problem is identified when basemap is imported, the code of basemap/__init__.py try to establish the basemap data directory in the library.zip file. [install dir]\dist\library.zip\mpl_toolkits\basemap\data Under normal script-like execution, it works, the path is a string indicating a location accessible through the filesystem . However with py2exe, the location of data basemap directory is located within the shared zip archive that py2exe creates and the above error is thrown. The Solution == The solution came in three times 1. Add mpl_toolkits.basemap in the option list (setup.py) # opts = { 'py2exe': { includes : [sip, PyQt4, matplotlib.backends, matplotlib.backends.backend_qt4agg, matplotlib.figure,pylab, numpy, matplotlib.numerix.fft,mpl_toolkits.basemap, matplotlib.numerix.linear_algebra, matplotlib.numerix.random_array, matplotlib.backends.backend_tkagg], # 2. Add basemap\data in data_files list # data_files = [(r'mpl-data', glob.glob(r'C:\Python25\Lib\site-packages\matplotlib\mpl-data\*.*')), (r'mpl-data', [r'C:\Python25\Lib\site-packages\matplotlib\mpl-data\matplotlibrc']), (r'mpl-data\images',glob.glob(r'C:\Python25\Lib\site-packages\matplotlib\mpl-data\images\*.*')), (r'mpl-data\data',glob.glob(r'C:\Python25\Lib\site-packages\mpl_toolkits\basemap\data\*.*')), #- 3. Modification of
[Matplotlib-users] Trouble embedding toolbar in Tk using grid
I've been trying to modify the embedding_in_tk.py example to use the grid manager instead of pack. I can get the plot to show ok but I can't seem to get the toolbar to show correctly. The following code does get the toolbar on there but it does use pack for the frame and also I always end up with an extra blank window (this code is simplified from something that a Bonnie Douglas posted on this list recently). Any suggestions? #!/usr/bin/env python import matplotlib matplotlib.use('TkAgg') import Tkinter as Tk from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg from matplotlib.figure import Figure from numpy import arange, sin, pi # create toplevel window tl=Tk.Toplevel() tl.title(storage) # create frame frame=Tk.Frame(master=tl) fig=Figure(figsize=(12,6), dpi=100) # create plots a1 = fig.add_subplot(111) t = arange(0.0,3.0,0.01) s = sin(2*pi*t) a1.plot(t,s) # create canvas canvas=FigureCanvasTkAgg(figure=fig, master=frame) canvas.show() c=canvas.get_tk_widget() c.grid(row=0, column=0) # problems with toolbar not showing solved by setting the master to # the toplevel window, not the frame!!! toolbar=NavigationToolbar2TkAgg(canvas, tl) toolbar.update() frame.pack() Tk.mainloop() -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] matplotlib to draw streamlines?
Is it possible to draw a streamlines plot as shown in the following: http://www.pyngl.ucar.edu/Examples/Images/ngl04p.0.png using matplotlib or basemap? Thanks in advance! -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] matplotlib to draw streamlines?
On 3/23/10 5:33 PM, Reckoner wrote: Is it possible to draw a streamlines plot as shown in the following: http://www.pyngl.ucar.edu/Examples/Images/ngl04p.0.png using matplotlib or basemap? Thanks in advance! Sorry, no. -Jeff -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Trouble embedding toolbar in Tk using grid
Well I realized my error with the extra window being caused by the TopLevel() command. I switched this to Tk.Tk() and it works nicely. However I still have to pack the frame instead of using grid. I can work around this but I wonder if there isn't something else I'm missing. On Tue, Mar 23, 2010 at 6:00 PM, Jonno jonnojohn...@gmail.com wrote: I've been trying to modify the embedding_in_tk.py example to use the grid manager instead of pack. I can get the plot to show ok but I can't seem to get the toolbar to show correctly. The following code does get the toolbar on there but it does use pack for the frame and also I always end up with an extra blank window (this code is simplified from something that a Bonnie Douglas posted on this list recently). Any suggestions? #!/usr/bin/env python import matplotlib matplotlib.use('TkAgg') import Tkinter as Tk from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg from matplotlib.figure import Figure from numpy import arange, sin, pi # create toplevel window tl=Tk.Toplevel() tl.title(storage) # create frame frame=Tk.Frame(master=tl) fig=Figure(figsize=(12,6), dpi=100) # create plots a1 = fig.add_subplot(111) t = arange(0.0,3.0,0.01) s = sin(2*pi*t) a1.plot(t,s) # create canvas canvas=FigureCanvasTkAgg(figure=fig, master=frame) canvas.show() c=canvas.get_tk_widget() c.grid(row=0, column=0) # problems with toolbar not showing solved by setting the master to # the toplevel window, not the frame!!! toolbar=NavigationToolbar2TkAgg(canvas, tl) toolbar.update() frame.pack() Tk.mainloop() -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users