Re: [Matplotlib-users] [ANN] glumpy 0.2.0
thanks Nicolas, On 18-09-2011 19:25, Nicolas Rougier wrote: The interactive plot has been done using the AntTweakBar library and is not really user friendly. You can view the source from the demos directory: http://code.google.com/p/glumpy/source/browse/demos/atb.py I'll take a look, Also, note that glumpy is not a replacement for matplotlib but rather a testbed for a future OpenGL backend to be integrated into matplotlib. Yes but I'm an engineer and therefor not interested in high quality publication plots. cheers, Stef Nicolas On Sep 18, 2011, at 14:00 , Stef Mientki wrote: hi Nicolas, looks very interesting. I was considering to move from MatPlotLib to guiqwt, because of it's easy interactive plots. But I see glumpy has it too. Can show the source code for the interactive plot in your examples ? thanks, stef On 17-09-2011 19:22, Nicolas Rougier wrote: Hi folks, I am pleased to announce a new release of glumpy, a small python library for the (very) fast vizualization of numpy arrays, (mainly two dimensional) that has been designed with efficiency in mind. If you want to draw nice figures for inclusion in a scientific article, you’d better use matplotlib but if you want to have a sense of what’s going on in your simulation while it is running, then maybe glumpy can help you. Download and screenshots at: http://code.google.com/p/glumpy/ Nicolas -- BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA http://p.sf.net/sfu/rim-devcon-copy2 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA http://p.sf.net/sfu/rim-devcon-copy2___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Help with some data manipulation for a plot
On Wed, Sep 21, 2011 at 2:00 PM, Armando Serrano Lombillo < arser...@gmail.com> wrote: > Hello I have a dat set like this one > a=[[x1, y1, cat1], [x2, y2, cat1], ..., [x8, y8, cat1], [x9, y9, cat2], > ..., [x34, y34, cat2], [x35, y35, cat3],...] > and I don't know beforehand how many diffferent categories there will be or > how long they will be. > > I would like to make a plot like this: > ax.plot(a[0:i1, 0], a[0:i1, 1], label=cat1) > ax.plot(a[i1:i2, 0], a[i1:i2, 1], label=cat2) > ax.plot(a[i2:i3, 0], a[i2:i3, 1], label=cat3) > ... > > where i1, i2... are the indices where the data set changes fomt cat1 to > cat2, cat2 to cat3... > > Does anybody see an easy way of coding this? > > Thanks, > Armando. > Maybe something like this? (Warning: untested!) from collections import OrderedDict b = OrderedDict() for index, coords in enumerate(a) : b[coords[2]] = index + 1 a = np.array([[c[0], c[1]] for c in a]) prevIndex = 0 for cat, curIndex in b.iteritems() : ax.plot(a[prevIndex:curIndex, 0], a[prevIndex:curIndex, 1], label=cat) prevIndex = curIndex The ordered dictionary may or may not be available in whatever version of python you use, but it guarantees the order. I hope that helps! Ben Root -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Help with some data manipulation for a plot
Hello I have a dat set like this one a=[[x1, y1, cat1], [x2, y2, cat1], ..., [x8, y8, cat1], [x9, y9, cat2], ..., [x34, y34, cat2], [x35, y35, cat3],...] and I don't know beforehand how many diffferent categories there will be or how long they will be. I would like to make a plot like this: ax.plot(a[0:i1, 0], a[0:i1, 1], label=cat1) ax.plot(a[i1:i2, 0], a[i1:i2, 1], label=cat2) ax.plot(a[i2:i3, 0], a[i2:i3, 1], label=cat3) ... where i1, i2... are the indices where the data set changes fomt cat1 to cat2, cat2 to cat3... Does anybody see an easy way of coding this? Thanks, Armando. -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Error when zooming manually with the mouse outside of the axes
With the Mac OS X backend (at least…), error messages are repeatedly printed when the mouse leaves the axes rectangle: Traceback (most recent call last): File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 1625, in motion_notify_event self.callbacks.process(s, event) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/cbook.py", line 265, in process proxy(*args, **kwargs) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/cbook.py", line 191, in __call__ return mtd(*args, **kwargs) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 2573, in drag_zoom self.draw_rubberband(event, x, y, lastx, lasty) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py", line 420, in draw_rubberband self.canvas.set_rubberband(x0, y0, x1, y1) TypeError: integer argument expected, got float This problem is annoying because the error messages clutter the terminal, and useful printed information leaves the screen. :) Configuration: Mac OS X 10.7, latest MacPort's Python and modules, Matplotlib 1.0.1 with Mac OS X backend. -- View this message in context: http://old.nabble.com/Error-when-zooming-manually-with-the-mouse-outside-of-the-axes-tp32503759p32503759.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] NavigationToolbar2Wx with mplot3d
On Wednesday, September 21, 2011, Keith Jones wrote: > Hi, > > I have two questions about using NavigationToolbar2Wx with mplot3d. > > > > 1/ Initially the 3D scatter plot will rotate as usual with a mouse, but after selecting the ‘pan’ or ‘zoom’ buttons the plot responds with some confusion. How can I restore it to rotation only, i.e. disconnect the zoom or pan behaviour? > That is a bug that should be resolved in the upcoming release. Use the right mouse button for zooming instead. In the upcoming release, the zoom and pan button should have no effect on axes3d objects, if I remember correctly. > > > 2/ When using the ‘save’ button I get different behaviours depending on the backend. With ‘WXAgg’ the saved png image shows only the axes, not the scatter points. The scatter points and axes do appear correctly in a pdf file. Using the ‘WX’ backend gives both scatter points and axes for the png file. > I dont use WxAgg regularly. I will use your code to test this. Ben Root -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] PDF/SVG Backends Don't Save FigureImages
Is this a bug in the PDF/SVG backends or am I doing something wrong? If the former is there any workaround? The simple testcase below demonstrates the problem whereby the watermark doesn't show up in the pdf output but does in the png output. import Image from scipy import lena from scipy.ndimage import map_coordinates from cStringIO import StringIO def add_watermark(fig, watermark): import matplotlib.image as image im = image.imread(watermark) dpi = fig.get_dpi() offset = dpi*fig.get_size_inches()[0] - im.shape[1] fig.figimage(im, offset, 0, alpha=0.3) return fig # im = Image.fromarray(map_coordinates(lena(), mgrid[0:512:100j, 0:512:100j])) watermark = StringIO() im.save(watermark, format='png') watermark.seek(0) fig = figure(figsize=(12, 8)) plot(randn(1000)) add_watermark(fig, watermark) fig.savefig('test.png', dpi=fig.get_dpi()) fig.savefig('test.pdf', dpi=fig.get_dpi()) Thanks, Dave -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problems compiling matplotlib - png_info_def
"Sarlo, Jeffrey S" writes: > libpng: 1.5.4 Your options are to use libpng 1.2.46, use a recent git version of matplotlib, or cherry-pick commit 45c4667 on top of your older version to get support for libpng 1.5. There is a new release planned soon, and it will include this fix. -- Jouni K. Seppänen http://www.iki.fi/jks -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Problems compiling matplotlib - png_info_def
I am having problems compiling matplotlib on RHEL5. I changed the setup.cfg to use a different base directory, but other than that no files changed/customized. Thanks. Jeff $ python setup.py build basedirlist is: ['/share/apps/gpaw-0.8.0-py2.6'] BUILDING MATPLOTLIB matplotlib: 1.0.1 python: 2.6.7 (r267:88850, Sep 20 2011, 13:39:45) [GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] platform: linux2 REQUIRED DEPENDENCIES numpy: 1.5.1 freetype2: 13.0.7 OPTIONAL BACKEND DEPENDENCIES libpng: 1.5.4 Tkinter: Tkinter: 73770, Tk: 8.4, Tcl: 8.4 wxPython: no * wxPython not found Gtk+: no * Building for Gtk+ requires pygtk; you must be able * to "import gtk" in your build/install environment Mac OS X native: no Qt: no Qt4: no Cairo: 1.8.10 OPTIONAL DATE/TIMEZONE DEPENDENCIES datetime: present, version unknown dateutil: matplotlib will provide pytz: matplotlib will provide adding pytz OPTIONAL USETEX DEPENDENCIES dvipng: 1.5 ghostscript: 8.70 latex: 3.141592 pdftops: 3.00 [Edit setup.cfg to suppress the above messages] pymods ['pylab'] packages ['matplotlib', 'matplotlib.backends', 'matplotlib.backends.qt4_editor', 'matplotlib.projections', 'matplotlib.testing', 'matplotlib.testing.jpl_units', 'matplotlib.tests', 'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid', 'mpl_toolkits.axes_grid1', 'mpl_toolkits.axisartist', 'matplotlib.sphinxext', 'matplotlib.numerix', 'matplotlib.numerix.mlab', 'matplotlib.numerix.ma', 'matplotlib.numerix.linear_algebra', 'matplotlib.numerix.random_array', 'matplotlib.numerix.fft', 'matplotlib.tri', 'matplotlib.delaunay', 'pytz', 'dateutil', 'dateutil/zoneinfo'] running build running build_py copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.linux-x86_64-2.6/matplotlib/mpl-data copying lib/matplotlib/mpl-data/matplotlib.conf -> build/lib.linux-x86_64-2.6/matplotlib/mpl-data running build_ext building 'matplotlib._png' extension gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/share/apps/gpaw-0.8.0-py2.6/include -I/share/apps/gpaw-0.8.0-py2.6/include/glib-2.0 -I/share/apps/gpaw-0.8.0-py2.6/include/glib-2.0/include -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/share/apps/gpaw-0.8.0-py2.6/include/libpng15 -I/share/apps/gpaw-0.8.0-py2.6/include -I. -I/share/apps/gpaw-0.8.0-py2.6/lib/python2.6/site-packages/numpy/core/include -I. -I/share/apps/gpaw-0.8.0-py2.6/include/python2.6 -c src/_png.cpp -o build/temp.linux-x86_64-2.6/src/_png.o cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++ src/_png.cpp: In member function 'Py::Object _png_module::read_png(const Py::Tuple&)': src/_png.cpp:353: error: invalid use of undefined type 'struct png_info_def' /share/apps/gpaw-0.8.0-py2.6/include/png.h:692: error: forward declaration of 'struct png_info_def' src/_png.cpp:354: error: invalid use of undefined type 'struct png_info_def' /share/apps/gpaw-0.8.0-py2.6/include/png.h:692: error: forward declaration of 'struct png_info_def' src/_png.cpp:356: error: invalid use of undefined type 'struct png_info_def' /share/apps/gpaw-0.8.0-py2.6/include/png.h:692: error: forward declaration of 'struct png_info_def' src/_png.cpp:364: error: invalid use of undefined type 'struct png_info_def' /share/apps/gpaw-0.8.0-py2.6/include/png.h:692: error: forward declaration of 'struct png_info_def' src/_png.cpp:377: error: invalid use of undefined type 'struct png_info_def' /share/apps/gpaw-0.8.0-py2.6/include/png.h:692: error: forward declaration of 'struct png_info_def' src/_png.cpp:383: error: invalid use of undefined type 'struct png_info_def' /share/apps/gpaw-0.8.0-py2.6/include/png.h:692: error: forward declaration of 'struct png_info_def' src/_png.cpp:411: error: invalid use of undefined type 'struct png_info_def' /share/apps/gpaw-0.8.0-py2.6/include/png.h:692: error: forward declaration of 'struct png_info_def' -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists