Re: [Matplotlib-users] surface without lines + circular domain
Hi, Diego 1) use the linewidth=0 kwarg to plot_surface (e.g. see http://matplotlib.org/examples/mplot3d/surface3d_demo.html) 2) Define your mesh by r, theta, then convert to x, y (e.g. see http://stackoverflow.com/a/26876699/2965572) Ray On Mon, Feb 16, 2015 at 9:45 AM, Diego Avesani diego.aves...@gmail.com wrote: Dear all, I have two problems. 1) I would like to plot a 3D surface, but without lines. 2) I would like to plot the surface on a circular domain. I mean, this is a piece of my code X = np.arange(0, 1, 0.05) Y = np.arange(0, 1, 0.05) X, Y = np.meshgrid(X, Y) R = np.sqrt(X**2 + Y**2) Z = np.sin(R) ax.plot_surface(X, Y, Z, rstride=10, cstride=10, alpha=0.3) The domain is therefore a square, I would like to have a circular domain. Thanks a lot Diego -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Unsubscription
Please use the link on the bottom of every message sent to this mailing list: https://lists.sourceforge.net/lists/listinfo/matplotlib-users On that page, there is an option for un-subscribing. Best, Ray On Thu, Oct 16, 2014 at 4:22 PM, Almerindo Paiva alopa...@gmail.com wrote: Dear Sirs, I would like to ask you to unsubscripte my account from matplotlib-users@lists.sourceforge.net. Kind regards, Almerindo Paiva -- Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://p.sf.net/sfu/Zoho ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://p.sf.net/sfu/Zoho___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Adding a colorbar --- how?
Hi Virgil, I did something very much like this recently by simply adding an axes to my figure and using it to show a linspace of the data range off which the line color was based. See http://matplotlib.org/examples/color/colormaps_reference.html. Best, Ray On Sun, Jun 15, 2014 at 6:17 PM, Virgil Stokes v...@it.uu.se wrote: There are some rather nice and useful matplotlib examples for colormaps that are shown at: http://nbviewer.ipython.org/github/dpsanders/matplotlib-examples/blob/master/colorline.ipynb In* Example 1. Sine wave colored by time (uses the defaults for colorline)*, how can one add a colorbar? --V -- HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing Easy Data Exploration http://p.sf.net/sfu/hpccsystems ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing Easy Data Exploration http://p.sf.net/sfu/hpccsystems___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] problem with patches in animation
Hi Mark, I can't say this is the 'proper' solution or the correct interpretation, but it should work. I think when blitting that the init function serves as a something of a background for the rest of the animation. So try changing def init(): *patch.center = (5, 5)* ax.add_patch(patch) return patch, to def init(): *patch.center = (5, -5)* ax.add_patch(patch) return patch, Cheers, Ray On Wed, Apr 23, 2014 at 5:44 AM, Mark Bakker mark...@gmail.com wrote: Hello list, I am trying to animate a patch. The animation should show a circle orbiting around a point. I took the code from http://nickcharlton.net/posts/drawing-animating-shapes-matplotlib.html Problem is that when I run the code, the animation doesn't remove the initial position of the circle (blit is True) while it works correctly on the website referenced above. Does anybody else see this behavior? Here's the code: import numpy as np from matplotlib import pyplot as plt from matplotlib import animation fig = plt.figure() fig.set_dpi(100) fig.set_size_inches(7, 6.5) ax = plt.axes(xlim=(0, 10), ylim=(0, 10)) patch = plt.Circle((5, -5), 0.75, fc='y') def init(): patch.center = (5, 5) ax.add_patch(patch) return patch, def animate(i): x, y = patch.center x = 5 + 3 * np.sin(np.radians(i)) y = 5 + 3 * np.cos(np.radians(i)) patch.center = (x, y) return patch, anim = animation.FuncAnimation(fig, animate, init_func=init, frames=360, interval=20, blit=True) plt.show() Thanks, Mark -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] problem with patches in animation
Well, the intended behavior of init() isn't completely clear to me after reading over some of the docs http://matplotlib.org/contents.html and examples http://matplotlib.org/examples/animation/index.html, so I'm not sure if it's a bug or not. Either way, it could be a request for documentation, perhaps. On Wed, Apr 23, 2014 at 10:08 AM, Mark Bakker mark...@gmail.com wrote: I thought about that. I even thought about changing the initial color to white or radius to zero. But I am thinking this is a bug. When blitting, whatever is created with the init function is not removed. That is why lines that are animated initially have no data. For a Patch object this is a bit harder, as it needs something to begin with. It seems that this used to work in a previous version. Should I file a bug report? Mark On Wed, Apr 23, 2014 at 3:34 PM, Raymond Smith smit...@mit.edu wrote: Hi Mark, I can't say this is the 'proper' solution or the correct interpretation, but it should work. I think when blitting that the init function serves as a something of a background for the rest of the animation. So try changing def init(): *patch.center = (5, 5)* ax.add_patch(patch) return patch, to def init(): *patch.center = (5, -5)* ax.add_patch(patch) return patch, Cheers, Ray On Wed, Apr 23, 2014 at 5:44 AM, Mark Bakker mark...@gmail.com wrote: Hello list, I am trying to animate a patch. The animation should show a circle orbiting around a point. I took the code from http://nickcharlton.net/posts/drawing-animating-shapes-matplotlib.html Problem is that when I run the code, the animation doesn't remove the initial position of the circle (blit is True) while it works correctly on the website referenced above. Does anybody else see this behavior? Here's the code: import numpy as np from matplotlib import pyplot as plt from matplotlib import animation fig = plt.figure() fig.set_dpi(100) fig.set_size_inches(7, 6.5) ax = plt.axes(xlim=(0, 10), ylim=(0, 10)) patch = plt.Circle((5, -5), 0.75, fc='y') def init(): patch.center = (5, 5) ax.add_patch(patch) return patch, def animate(i): x, y = patch.center x = 5 + 3 * np.sin(np.radians(i)) y = 5 + 3 * np.cos(np.radians(i)) patch.center = (x, y) return patch, anim = animation.FuncAnimation(fig, animate, init_func=init, frames=360, interval=20, blit=True) plt.show() Thanks, Mark -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] problem with patches in animation
This is pretty weird. If instead of Mark's original script, if I move the add_patch out of init and have the init simply return an empty tuple, it _mostly_ works as expected. But -- at least on my computer -- on some runs, it has the moving circle, but also leaves a circle at the top, starting point, whereas on other runs it simply has the desired moving circle with no 'background' circle. Usually, it will happen at least once if I start the animation script 10 times. So still, the init function is a bit of a mystery to me. import numpy as np from matplotlib import pyplot as plt from matplotlib import animation fig = plt.figure() fig.set_dpi(100) fig.set_size_inches(7, 6.5) ax = plt.axes(xlim=(0, 10), ylim=(0, 10)) patch = plt.Circle((5, -5), 0.75, fc='y') ax.add_patch(patch) def init(): return tuple() def animate(i): x, y = patch.center patch.set_facecolor('y') patch.set_edgecolor('k') x = 5 + 3 * np.sin(np.radians(i)) y = 5 + 3 * np.cos(np.radians(i)) patch.center = (x, y) return patch, anim = animation.FuncAnimation(fig, animate, init_func=init, frames=360, interval=20, blit=True) plt.show() On Wed, Apr 23, 2014 at 10:29 AM, Benjamin Root ben.r...@ou.edu wrote: Working off of very faded memory, try not to return any objects in your init function that you intend to be animated. If I remember correctly, when blitting is True, the animator treats any object returned by the init() function as background objects, and any objects returned by the animation function as blittable. Since your patch is returned in both functions, I think it is getting confused. Again, very rusty memory here... Ben Root On Wed, Apr 23, 2014 at 9:34 AM, Raymond Smith smit...@mit.edu wrote: Hi Mark, I can't say this is the 'proper' solution or the correct interpretation, but it should work. I think when blitting that the init function serves as a something of a background for the rest of the animation. So try changing def init(): *patch.center = (5, 5)* ax.add_patch(patch) return patch, to def init(): *patch.center = (5, -5)* ax.add_patch(patch) return patch, Cheers, Ray On Wed, Apr 23, 2014 at 5:44 AM, Mark Bakker mark...@gmail.com wrote: Hello list, I am trying to animate a patch. The animation should show a circle orbiting around a point. I took the code from http://nickcharlton.net/posts/drawing-animating-shapes-matplotlib.html Problem is that when I run the code, the animation doesn't remove the initial position of the circle (blit is True) while it works correctly on the website referenced above. Does anybody else see this behavior? Here's the code: import numpy as np from matplotlib import pyplot as plt from matplotlib import animation fig = plt.figure() fig.set_dpi(100) fig.set_size_inches(7, 6.5) ax = plt.axes(xlim=(0, 10), ylim=(0, 10)) patch = plt.Circle((5, -5), 0.75, fc='y') def init(): patch.center = (5, 5) ax.add_patch(patch) return patch, def animate(i): x, y = patch.center x = 5 + 3 * np.sin(np.radians(i)) y = 5 + 3 * np.cos(np.radians(i)) patch.center = (x, y) return patch, anim = animation.FuncAnimation(fig, animate, init_func=init, frames=360, interval=20, blit=True) plt.show() Thanks, Mark -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet
Re: [Matplotlib-users] moving line
Hi Mike, Have you tried blitting? That prevents the draw from redrawing everything on the plot, allowing it to only redraw the single line that's moving, which should help any issues with speed. See some of the exampleshttp://matplotlib.org/examples/animation/index.htmlwith FuncAnimation and also a QA using the draw method herehttps://stackoverflow.com/questions/8955869/why-is-plotting-with-matplotlib-so-slow/8956211#8956211, which might work more smoothly with QTimer. Ray On Sat, Apr 19, 2014 at 12:56 AM, Michael Mossey michaelmos...@gmail.comwrote: I'm creating a simple little sound file editor, which includes the ability to play a sound file as a vertical line (a cursor) moves across the plot of the waveform in sync with the sound. So the trick is, how to create this moving line. First I tried FuncAnimation, but I had problems with the synchronization with the sound. I'm guessing that the animation capabilities of matplotlib weren't really designed to be synchronized with outside activities. So then I tried using QTimer's and modifying the Line2D instance that is the vertical bar. This didn't work unless I called draw() on the figure canvas every time I modified the Line2D, which caused slowdown (probably because my audio data consists of 1000's of points). So is there a way to animate a vertical line moving across the plot with good control over exact timing, in the presence of other plots with thousands of points? Mike -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/NeoTech ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/NeoTech___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users