[Matplotlib-users] problem with patches in animation

2014-04-23 Thread Mark Bakker
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

Re: [Matplotlib-users] problem with patches in animation

2014-04-23 Thread Raymond Smith
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)

Re: [Matplotlib-users] problem with patches in animation

2014-04-23 Thread Mark Bakker
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

Re: [Matplotlib-users] problem with patches in animation

2014-04-23 Thread Raymond Smith
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,

Re: [Matplotlib-users] problem with patches in animation

2014-04-23 Thread Benjamin Root
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

Re: [Matplotlib-users] problem with patches in animation

2014-04-23 Thread Raymond Smith
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

Re: [Matplotlib-users] problem with patches in animation

2014-04-23 Thread Benjamin Root
I think it is because the figure may or may not have some things drawn by the time the blitting starts. This is due to draw_idle(). So, it is trying to capture whatever is in the figure's canvas, but drawing may or may not have happened yet. Try this: def animate(i): if not animate.patch:

Re: [Matplotlib-users] Make clear figure used in the powerpoint slides?

2014-04-23 Thread Chao YUE
yes, Ben, I understand the difference now. To Mike: I have to select the region of the figure I need in the pdf file and paste it in the powerpoint ... Isn't this you're doing as well? But fine, I can go with the current quality. Thanks to you all for this discussion. Cheers, Chao On Tue,

Re: [Matplotlib-users] Make clear figure used in the powerpoint slides?

2014-04-23 Thread Jody Klymak
On Apr 23, 2014, at 8:35 AM, Chao YUE chaoyue...@gmail.com wrote: yes, Ben, I understand the difference now. To Mike: I have to select the region of the figure I need in the pdf file and paste it in the powerpoint ... Isn't this you're doing as well? Why do you need to select a region?

Re: [Matplotlib-users] Make clear figure used in the powerpoint slides?

2014-04-23 Thread Sterling Smith
On Apr 23, 2014, at 11:41AM, Jody Klymak wrote: On Apr 23, 2014, at 8:35 AM, Chao YUE chaoyue...@gmail.com wrote: yes, Ben, I understand the difference now. To Mike: I have to select the region of the figure I need in the pdf file and paste it in the powerpoint ... Isn't this you're

Re: [Matplotlib-users] problem with patches in animation

2014-04-23 Thread Mark Bakker
Benjamin, I don't mind doing classes to store the state, but isn't a Patch already a class? Do you know of an example online that I can work off? Thanks for your suggestions, Mark On Wed, Apr 23, 2014 at 5:12 PM, Benjamin Root ben.r...@ou.edu wrote: I think it is because the figure may or

Re: [Matplotlib-users] problem with patches in animation

2014-04-23 Thread Mark Bakker
Raymond, The documentation says: If blit=True, *func* and *init_func* should return an iterable of drawables to clear. But clearly, whatever is set by init_func is not cleared during animation when blit=True, while it is cleared when blit=False. Unless anybody knows what I am doing wrong I

Re: [Matplotlib-users] problem with patches in animation

2014-04-23 Thread Benjamin Root
https://github.com/WeatherGod/BRadar in scripts/, there is radarmovie.py which I create a few subclasses of FuncAnimation, which was to solve a modularity issue I was having (I needed self-contained animation classes that I could use pieces of elsewhere, but still be able to join them all

[Matplotlib-users] turning off autoscale

2014-04-23 Thread Michael Mossey
I'm sorry, these are questions that could be found in the Axes documentation, but I really don't feel like scrolling through 100 pages that are irrelevant hoping I can find the relevant functions, which I don't even know what they are called. Is there ever going to be a concise listing of

Re: [Matplotlib-users] turning off autoscale

2014-04-23 Thread Eric Firing
On 2014/04/23 11:19 AM, Michael Mossey wrote: I'm sorry, these are questions that could be found in the Axes documentation, but I really don't feel like scrolling through 100 pages that are irrelevant hoping I can find the relevant functions, which I don't even know what they are called. Is