Re: [Matplotlib-users] changing sharex after ?
Hello, I am writing a little GUI with PyQT4 and matplotlib. So it is embeded. I want that feature for the user : he can decided after ploting some data to synchronize 2 graph with the x axis for the zoom. So this method would be very useful for me. Maybe I can write it. Do you have a idea of all the variables involved in the sharex feature ? Thank you Samuel Eric Firing wrote: Samuel, Trying to manipulate variables with leading underscores is discouraged--that is the meaning of the leading underscores. Changing the shared status of axes involves changes in additional variables. This could be encapsulated in a single method. It might be very easy, or complexities and gotchas might turn up. How important is it? What is the problem with setting the shared status when you make the axes, as in your first example? Eric Samuel GARCIA wrote: Hi all, is there a possibility to change the sharex and sharey after creating a axes ? For example this perfectitly work : import pylab fig = pylab.figure() ax1 = fig.add_subplot(121) ax2 = fig.add_subplot(122, sharex=ax1) ax1.plot(rand(5)) ax2.plot(rand(5)) pylab.show() But when I try naively to change _sharex and _masterx after creating the axes it doesn't work : import pylab fig = pylab.figure() ax1 = fig.add_subplot(121) ax2 = fig.add_subplot(122) ax1.plot(rand(5)) ax2.plot(rand(5)) ax2._sharex = ax1 ax1._masterx = True pylab.show() What 's the solution ? thank you Samuel - 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=lnk&kid=120709&bid=263057&dat=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=lnk&kid=120709&bid=263057&dat=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=lnk&kid=120709&bid=263057&dat=121642___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] How do a simple poit plots?
I have esperimental data here and i want plot them to do a grafic and cut the poits who are too out but whem i use plot(Array1,Array2,+) i obtaim a perfect line and i do it in gnu plot and see the ploted points arent a perfect line, someone can tell me how I can simple draw the points in the grafic using mathplot? - 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=lnk&kid=120709&bid=263057&dat=121642___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How do a simple poit plots?
Hi, It's pretty hard to figure out exactly what your problem is without more info. Did you check that the scaling was identical in gnuplot and matplotlib ? matplotlib will set the axes so that all data are included in the figure, so if you have large outliers, the scaling will be too large and its probable that your data will look like a perfect line. Try modifying the scaling of the graph, using ylim(y1, y2) or xlim(x1, x2).David2006/9/1, Esdras Caleb <[EMAIL PROTECTED] >:I have esperimental data here and i want plot them to do a grafic and cut the poits who are too out but whem i use plot(Array1,Array2,+) i obtaim a perfect line and i do it in gnu plot and see the ploted points arent a perfect line, someone can tell me how I can simple draw the points in the grafic using mathplot? -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=lnk&kid=120709&bid=263057&dat=121642___Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.nethttps://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=lnk&kid=120709&bid=263057&dat=121642___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How do a simple poit plots?
> "Esdras" == Esdras Caleb <[EMAIL PROTECTED]> writes: Esdras> I have esperimental data here and i want plot them to do a Esdras> grafic and cut the poits who are too out but whem i use Esdras> plot(Array1,Array2,+) i obtaim a perfect line and i do it Esdras> in gnu plot and see the ploted points arent a perfect Esdras> line, someone can tell me how I can simple draw the points Esdras> in the grafic using mathplot? Try using a mask, eg examples/masked_demo.py. Using nan should work as well from pylab import figure, show, nx x = nx.arange(0.0, 10.0) y = x**2 x[3] = nx.nan fig = figure() ax = fig.add_subplot(111) ax.plot(x, y) show() JDH - 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=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] basemap memory leak?
You're right, Jeff. When I use numpy in the test script, I don't see the leak. Alternatively, moving the basemap object creation outside of the loop (even with Numeric 24.2) makes it faster and doesn't produce the leak. Thanks for showing me the way. Gerald Jeff Whitaker wrote: > Gerald John M. Manipon wrote: >> Hi all, >> >> I'm trying to generate a plot that contains 3 subplots: >> 2 line plots and a basemap plot showing location. I'm >> generating about 200 such plots however my script >> doesn't get to complete because it encounters a MemoryError. >> >> I found the test script at >> http://matplotlib.sourceforge.net/faq.html#LEAKS (which >> BTW generates a plot with 4 subplots) and it succeeded >> beautifully with no memory issues. However I changed the >> last subplot to be a basemap plot and I was able to see >> the memory leak. Below is the modified leak test script >> I used and the abbreviated output from it. I would truly >> appreciate any help on this. >> >> Thanks, >> >> Gerald >> >> >> #memory leak test >> >> import os, sys, time >> import matplotlib >> matplotlib.use('Agg') >> from pylab import * >> from matplotlib.toolkits.basemap import Basemap >> >> def report_memory(i): >> pid = os.getpid() >> a2 = os.popen('ps -p %d -o rss,sz' % pid).readlines() >> print i, ' ', a2[1], >> return int(a2[1].split()[1]) >> >> >> >> # take a memory snapshot on indStart and compare it with indEnd >> indStart, indEnd = 30, 150 >> for i in range(indEnd): >> ind = arange(100) >> xx = rand(len(ind)) >> >> figure(1) >> subplot(221) >> plot(ind, xx) >> >> subplot(222) >> X = rand(50,50) >> >> imshow(X) >> subplot(223) >> scatter(rand(50), rand(50)) >> subplot(224) >> #pcolor(10*rand(50,50)) >> m = Basemap(0, -85, 360, 85) >> m.plot((50,), (20,), 'ro', markersize=12, label='gps') >> m.drawcoastlines() >> >> savefig('tmp%d' % i, dpi = 75) >> close(1) >> >> >> val = report_memory(i) >> # wait a few cycles for memory usage to stabilize >> if i==indStart: start = val >> >> end = val >> print 'Average memory consumed per loop: %1.4fk bytes ' % \ >>((end-start)/float(indEnd-indStart)) >> >> >> >> #abbreviated results >> >> 042724 12739 >> 165068 18359 >> 283036 22924 >> 3100980 27463 >> 4118928 32027 >> 5136872 36577 >> 6154828 41129 >> 7172784 45681 >> 8190736 50156 >> 9208692 54711 >> 10226644 59272 >> 11244592 63824 >> 12262548 68375 >> 13280496 72926 >> 14298440 77478 >> 15316392 81964 >> . >> . >> . >> 1431771824 663458 >> 1441788924 668010 >> 1451791316 672561 >> 1461771104 677112 >> 1471775644 681599 >> 1481787288 686166 >> 1491791604 690718 >> Average memory consumed per loop: 4505.0833k bytes >> > > Gerald: One way to workaround the memory leak with Numeric is to move > the Basemap instance creation > > m = Basemap(0, -85, 360, 85) > > outside the loop. There's no need to recreate it each time. > > As a bonus, the script runs many times faster too. > > -Jeff > - 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=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] installation
hey guys i got the subversion from the site and I am trying to install it on windows. I changed dir into the matplotlib dir that includes the setup.py file. run python setup.py install, and im getting a wierd error. i left the topmost lines along with the error. has anyone seen anything like this before? building 'matplotlib.enthought.traits.ctraits' extension creating build\temp.win32-2.4\Release\lib creating build\temp.win32-2.4\Release\lib\matplotlib creating build\temp.win32-2.4\Release\lib\matplotlib\enthought creating build\temp.win32-2.4\Release\lib\matplotlib\enthought\traits C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -Ic:\Python24\include -Ic:\Python24\PC /Tclib/matplotlib/e nthought/traits/ctraits.c /Fobuild\temp.win32-2.4\Release\lib/matplotlib/enthoug ht/traits/ctraits.obj C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:c:\Python24\libs /LIBPATH:c:\Python24\PCBuild /EXPORT: initctraits build\temp.win32-2.4\Release\lib/matplotlib/enthought/traits/ctraits .obj /OUT:build\lib.win32-2.4\matplotlib\enthought\traits\ctraits.pyd /IMPLIB:bu ild\temp.win32-2.4\Release\lib/matplotlib/enthought/traits\ctraits.lib building 'matplotlib.backends._tkagg' extension C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -Iwin32_static/include/tcl84 -I. -Isrc -Iswig -Iagg23/incl ude -I. -I. -Iwin32_static/include/tcl84\freetype2 -I.\freetype2 -Isrc\freetype2 -Iswig\freetype2 -Iagg23/include\freetype2 -I.\freetype2 -I.\freetype2 -Ic:\Pyt hon24\include -Ic:\Python24\PC /Tpsrc/_tkagg.cpp /Fobuild\temp.win32-2.4\Release \src/_tkagg.obj _tkagg.cpp src\_tkagg.cpp(28) : fatal error C1083: Cannot open include file: 'tk.h': No suc h file or directory error: Command ""C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.e xe" /c /nologo /Ox /MD /W3 /GX /DNDEBUG -Iwin32_static/include/tcl84 -I. -Isrc - Iswig -Iagg23/include -I. -I. -Iwin32_static/include/tcl84\freetype2 -I.\freetyp e2 -Isrc\freetype2 -Iswig\freetype2 -Iagg23/include\freetype2 -I.\freetype2 -I.\ freetype2 -Ic:\Python24\include -Ic:\Python24\PC /Tpsrc/_tkagg.cpp /Fobuild\temp .win32-2.4\Release\src/_tkagg.obj" failed with exit status 2 - 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=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Saving in SVG
Hi, I have a script witch saves to graphs to SVG. The script works on 2 of my computer (ArchLinux and Gentoo) but the SVG saves doesn't on Fedora Core 3. The 3 uses matplotlib v0.87.4. The error I get is : > Traceback (most recent call last): > File "src/affichage/affichage_E.py", line 1091, in ? > main() > File "src/affichage/affichage_E.py", line 262, in main > updatefig() > File "src/affichage/affichage_E.py", line 427, in updatefig > p.savefig(filename, dpi=100) > File "/home/bigaouette/fichiers/programmes/bin/python/matplotlib/pylab.py", > line 811, in savefig > return fig.savefig(*args, **kwargs) > File > "/home/bigaouette/fichiers/programmes/bin/python/matplotlib/figure.py", line > 661, in savefig > self.canvas.print_figure(*args, **kwargs) > File > "/home/bigaouette/fichiers/programmes/bin/python/matplotlib/backends/backend_gtkagg.py", > line 113, in print_figure > orientation, **kwargs) > File > "/home/bigaouette/fichiers/programmes/bin/python/matplotlib/backends/backend_agg.py", > line 481, in print_figure > orientation, **kwargs) > File > "/home/bigaouette/fichiers/programmes/bin/python/matplotlib/backends/backend_svg.py", > line 289, in print_figure > self.figure.draw(renderer) > File > "/home/bigaouette/fichiers/programmes/bin/python/matplotlib/figure.py", line > 532, in draw > for a in self.axes: a.draw(renderer) > File "/home/bigaouette/fichiers/programmes/bin/python/matplotlib/axes.py", > line 1045, in draw > a.draw(renderer) > File "/home/bigaouette/fichiers/programmes/bin/python/matplotlib/image.py", > line 189, in draw > renderer.draw_image(l, b, im, self.axes.bbox) > File > "/home/bigaouette/fichiers/programmes/bin/python/matplotlib/backends/backend_svg.py", > line 154, in draw_image > image64 = base64.b64encode (imfile.read()) > AttributeError: 'module' object has no attribute 'b64encode' Is there something I'm missing ? Thank you. - 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=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users