SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S


1
(3)
2
3
(4)
4
(2)
5
6
(1)
7
(3)
8
(3)
9
(4)
10
(2)
11
(5)
12
(3)
13
14
(7)
15
(1)
16
(4)
17
(2)
18
(3)
19
(3)
20
(1)
21
(16)
22
(7)
23
(15)
24
25
(11)
26
27
28
(8)
29
(3)
30
(6)



Showing results of 117

<< < 1 2 3 4 5 > >> (Page 2 of 5)
From: Mark B. <ma...@gm...> - 2014年04月25日 09:02:57
OK, I figured out I can use:
converters={0:strpdate2num('%d-%m-%y')}
What now if part of my dates are given as 'day-month-year' and part as
'day/month/year' in the same file (I know, who does that, an I could do a
replace first and then read it in). Can I specify both formats for the
converter? I guess not....
Thanks,
Mark
On Fri, Apr 25, 2014 at 10:46 AM, Mark Bakker <ma...@gm...> wrote:
> Hello List,
>
> datestr2num works great when dates are stored as month/day/year (as
> American like).
>
> Europeans store them as day/month/year.
>
> Any quick function to convert a day/month/year string do a date? Is there
> an eu version: datestr2numeu?
>
> Thanks,
>
> Mark
>
From: Mark B. <ma...@gm...> - 2014年04月25日 08:46:39
Hello List,
datestr2num works great when dates are stored as month/day/year (as
American like).
Europeans store them as day/month/year.
Any quick function to convert a day/month/year string do a date? Is there
an eu version: datestr2numeu?
Thanks,
Mark
From: Michael M. <mic...@gm...> - 2014年04月25日 03:52:58
On 4/23/2014 2:41 PM, Eric Firing wrote:
> 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 there ever going to be a
>> concise listing of functions? Also there seem to be a lot of
> PRs for doc improvements are welcome!
>
>> undocumented functions related to bounding boxes and copying from the
>> background--I had to find Stack Overflow examples to learn about those.
> Doesn't the search box in the html docs help? Or just plain browser
> searching when you are looking at the Axes API docs?
>
> I also find that ipython is very helpful, with tab completion and the
> question mark for getting the doc string. E.g., make an axes object and
> then use tab completion to see the methods that start with auto, and
> follow with a question mark to see the docstring. Or a double question
> mark to see the code.
Thanks for the suggestions, I'll try them. I working with WinPython so I 
think I already have ipython and Spyder to help me.
Mike
From: Eric F. <ef...@ha...> - 2014年04月23日 21:41:33
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 there ever going to be a
> concise listing of functions? Also there seem to be a lot of
PRs for doc improvements are welcome!
> undocumented functions related to bounding boxes and copying from the
> background--I had to find Stack Overflow examples to learn about those.
Doesn't the search box in the html docs help? Or just plain browser 
searching when you are looking at the Axes API docs?
I also find that ipython is very helpful, with tab completion and the 
question mark for getting the doc string. E.g., make an axes object and 
then use tab completion to see the methods that start with auto, and 
follow with a question mark to see the docstring. Or a double question 
mark to see the code.
>
> What I want to do is
>
> (1) plot a couple of lines with y autoscaling and x autoscaling on
> (2) turn off y autoscaling so the y limits do not change further if the
> x limits are changed
> (3) change the x limits
>
> What axes functions are needed?
try:
ax.autoscale(enable=False, axis='y')
or
ax.set_autoscaley_on(False)
Ugly name for the method, but we're stuck with it.
These differ in that the first one turns y scaling off and then performs 
the autoscaling, while the second only turns y scaling off for any 
subsequent execution of the autoscale_view() method.
Eric
>
> Note that I'm not using pyplot, rather the API so I'm looking for
> methods of Axes.
>
> Mike
>
>
> ------------------------------------------------------------------------------
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Michael M. <mic...@gm...> - 2014年04月23日 21:19:20
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 functions? Also there seem to be a lot of 
undocumented functions related to bounding boxes and copying from the 
background--I had to find Stack Overflow examples to learn about those.
What I want to do is
(1) plot a couple of lines with y autoscaling and x autoscaling on
(2) turn off y autoscaling so the y limits do not change further if the 
x limits are changed
(3) change the x limits
What axes functions are needed?
Note that I'm not using pyplot, rather the API so I'm looking for 
methods of Axes.
Mike
From: Benjamin R. <ben...@ou...> - 2014年04月23日 20:18:28
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 together into a single animation, as is the
case with radarmovie.py). Note, I do think I have an off-by-one error
somewhere, but I never have been able to figure it out, and these
particular animations do not use blitting because I didn't need it.
Now, you don't have to go all the way to subclassing FuncAnimation. The
suggestion about using classes is to avoid the (typically) bad style of
adding attributes to functions for the purpose of storing a state (which is
what a class is all about). You can't use a Patch object because the Patch
object wouldn't exist until the animation starts.
I hope that helps!
Ben Root
On Wed, Apr 23, 2014 at 3:38 PM, Mark Bakker <ma...@gm...> wrote:
> 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...@ou...> wrote:
>
>> 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:
>> animate.patch = plt.Circle((5, -5), 0.75, fc='y')
>> animate.ax.add_patch(animate.patch)
>> x, y = animate.patch.center
>>
>> x = 5 + 3 * np.sin(np.radians(i))
>> y = 5 + 3 * np.cos(np.radians(i))
>> animate.patch.center = (x, y)
>> return animate.patch,
>> animate.ax = ax
>> animate.patch = None
>>
>> If you have something more complicated, then just go full bore and use
>> classes to store the state.
>>
>> Cheers!
>> Ben Root
>>
>>
>>
>> On Wed, Apr 23, 2014 at 10:51 AM, Raymond Smith <sm...@mi...> wrote:
>>
>>> 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...@ou...> 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 <sm...@mi...> 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 <ma...@gm...>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
>>>>>> Mat...@li...
>>>>>> 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
>>>>> Mat...@li...
>>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>>
>>>>>
>>>>
>>>
>>
>
From: Mark B. <ma...@gm...> - 2014年04月23日 19:41:33
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 will file a bug report.
Thanks again, Mark
On Wed, Apr 23, 2014 at 4:25 PM, Raymond Smith <sm...@mi...> wrote:
> 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 <ma...@gm...> 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 <sm...@mi...> 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 <ma...@gm...> 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
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>
>>>>
>>>
>>
>
From: Mark B. <ma...@gm...> - 2014年04月23日 19:38:44
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...@ou...> wrote:
> 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:
> animate.patch = plt.Circle((5, -5), 0.75, fc='y')
> animate.ax.add_patch(animate.patch)
> x, y = animate.patch.center
>
> x = 5 + 3 * np.sin(np.radians(i))
> y = 5 + 3 * np.cos(np.radians(i))
> animate.patch.center = (x, y)
> return animate.patch,
> animate.ax = ax
> animate.patch = None
>
> If you have something more complicated, then just go full bore and use
> classes to store the state.
>
> Cheers!
> Ben Root
>
>
>
> On Wed, Apr 23, 2014 at 10:51 AM, Raymond Smith <sm...@mi...> wrote:
>
>> 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...@ou...> 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 <sm...@mi...> 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 <ma...@gm...> 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
>>>>> Mat...@li...
>>>>> 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
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>
>>>>
>>>
>>
>
From: Sterling S. <sm...@fu...> - 2014年04月23日 17:38:19
On Apr 23, 2014, at 11:41AM, Jody Klymak wrote:
> 
> On Apr 23, 2014, at 8:35 AM, Chao YUE <cha...@gm...> 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? This takes a screen grab that will be terrible quality, doesn't it? Just drag the file into powerpoint (or use insert/picture). If you need to crop the PDF do that in Acrobat, or whatever PDF software you use. 
> 
> Cheers, Jody
On a windows computer, I found these instructions for inserting a pdf file into powerpoint: [1] These instructions indicate that you can not simply insert a pdf picture, as is done on a Mac, which might explain why he was selecting a region of the figure in a pdf viewer. 
Chao,
I'm not sure if the dpi setting or png format for savefig helped you. In the future if you have to cut out a part of a pdf file, and if you are using Adobe reader, then there is a setting in the preferences for customizing the resolution of the clip you are selecting.
-Sterling
[1] http://office.microsoft.com/en-us/powerpoint-help/insert-pdf-file-content-into-a-powerpoint-presentation-HA102809687.aspx
From: Jody K. <jk...@uv...> - 2014年04月23日 16:41:27
On Apr 23, 2014, at 8:35 AM, Chao YUE <cha...@gm...> 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? This takes a screen grab that will be terrible quality, doesn't it? Just drag the file into powerpoint (or use insert/picture). If you need to crop the PDF do that in Acrobat, or whatever PDF software you use. 
Cheers, Jody
> 
> But fine, I can go with the current quality. Thanks to you all for this discussion.
> 
> Cheers,
> 
> Chao
> 
> 
> On Tue, Apr 22, 2014 at 3:31 PM, Benjamin Root <ben...@ou...> wrote:
> Yes, there is a difference if you use the button versus explicitly stating the dpi in a savefig call. When you use the button, matplotlib has to use the default dpi since there is no other way to specify it.
> 
> Cheers!
> Ben Root
> 
> 
> On Mon, Apr 21, 2014 at 5:03 PM, Chao YUE <cha...@gm...> wrote:
> Yes, in fact I set dpi as 1000, which is already very high. In fact I have another question, will there be any difference if I use the save button on the interactive plotting toolbar and use the command line figure.savefig('xx.png',dpi=1000)? 
> 
> Chao
> 
> 
> On Mon, Apr 21, 2014 at 10:59 PM, Jody Klymak <jk...@uv...> wrote:
> Did you set the dpi of the png?
> 
> Cheers, Jody
> 
> 
> On Apr 21, 2014, at 13:50 PM, ChaoYue <cha...@gm...> wrote:
> 
>> OK, I tried but I don't really see the difference between jpg and png by my eyes in the attached case, maybe for other more complicated plots there will be real difference. Anyway, thanks to all for your nice discussions. And, BTW, I tried >2 hours trying to find a way to convert svg to emf, but now I konw :p
>> 
>> Cheers,
>> 
>> Chao
>> 
>> 
>> On Mon, Apr 21, 2014 at 9:49 PM, Benjamin Root-2 [via matplotlib] <[hidden email]> wrote:
>> JPGs will *always* have "bit blur" as it is a lossy image format. PNGs would be a better bet.
>> 
>> Ben Root
>> 
>> 
>> On Mon, Apr 21, 2014 at 3:33 PM, ChaoYue <[hidden email]> wrote:
>> Hi all,
>> 
>> Thank you all for your kind response. I am sorry, but none of these solutions significantly improved the visual quality on microsoft powerpiont 2007. Thought I didn't try eps. So probably l have to go with the current quality. 
>> here is a best case I have now: 
>> https://www.dropbox.com/s/0uhjogalz92hssm/different_figure_example.pptx
>> You can still see the "a bit blur" everywhere (currently with jpg being inserted directly). I didn't have better quality than this one by trying the method as suggested by you. Let me know if I am raising too much high demand for this.
>> 
>> Cheers,
>> 
>> Chao
>> 
>> 
>> On Mon, Apr 21, 2014 at 4:41 PM, Jonathan Slavin [via matplotlib] <[hidden email]> wrote:
>> ​Another alternative, if a vector graphics format doesn't work, is to make your png figure large. Then when you shrink it down to fit in your slide, it should still have good resolution.
>> 
>> Jon​
>> 
>> On Mon, Apr 21, 2014 at 10:13 AM, <[hidden email]> wrote:
>> No Powerpoint version I know supports SVG (or any vector graphics format useful in this case) and Matplotlib does not
>> export WMF graphics anymore. So the easiest way is to use PNGs, if you can live with raster graphics.
>> 
>> Alternatively, if you need vector graphics, you can export the Matplotlib plot as SVG and convert it to WMF or EMF using
>> Inkscape. This can be done in the command line like this:
>> 
>> "c:\Program Files\Inkscape-0.48\inkscape.exe" --without-gui --export-emf="output.emf" "input.svg"
>> 
>> 
>> Juergen
>> 
>> 
>> -- 
>> ________________________________________________________
>> Jonathan D. Slavin Harvard-Smithsonian CfA
>> [hidden email] 60 Garden Street, MS 83
>> phone: <a href="tel:%28617%29%20496-7981" value="<a href="tel:%2B16174967981" value="+16174967981" target="_blank">+16174967981" target="_blank">(617) 496-7981 Cambridge, MA 02138-1516
>> fax: <a href="tel:%28617%29%20496-7577" value="<a href="tel:%2B16174967577" value="+16174967577" target="_blank">+16174967577" target="_blank">(617) 496-7577 USA
>> ________________________________________________________
>> 
>> 
>> ------------------------------------------------------------------------------ 
>> 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 
>> [hidden email] 
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
>> 
>> If you reply to this email, your message will be added to the discussion below:
>> http://matplotlib.1069221.n5.nabble.com/Make-clear-figure-used-in-the-powerpoint-slides-tp43252p43262.html
>> To start a new topic under matplotlib - users, email [hidden email] 
>> To unsubscribe from matplotlib, click here.
>> NAML
>> 
>> 
>> 
>> -- 
>> please visit:
>> http://www.globalcarbonatlas.org/
>> ***********************************************************************************
>> Chao YUE
>> Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
>> UMR 1572 CEA-CNRS-UVSQ
>> Batiment 712 - Pe 119
>> 91191 GIF Sur YVETTE Cedex
>> Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
>> ************************************************************************************
>> 
>> View this message in context: Re: Make clear figure used in the powerpoint slides?
>> Sent from the matplotlib - users mailing list archive at Nabble.com.
>> 
>> ------------------------------------------------------------------------------
>> 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
>> [hidden email]
>> 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 
>> [hidden email] 
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
>> 
>> If you reply to this email, your message will be added to the discussion below:
>> http://matplotlib.1069221.n5.nabble.com/Make-clear-figure-used-in-the-powerpoint-slides-tp43252p43265.html
>> To start a new topic under matplotlib - users, email [hidden email] 
>> To unsubscribe from matplotlib, click here.
>> NAML
>> 
>> 
>> 
>> -- 
>> please visit:
>> http://www.globalcarbonatlas.org/
>> ***********************************************************************************
>> Chao YUE
>> Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
>> UMR 1572 CEA-CNRS-UVSQ
>> Batiment 712 - Pe 119
>> 91191 GIF Sur YVETTE Cedex
>> Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
>> ************************************************************************************
>> 
>> View this message in context: Re: Make clear figure used in the powerpoint slides?
>> Sent from the matplotlib - users mailing list archive at Nabble.com.
>> ------------------------------------------------------------------------------
>> 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
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
> 
> 
> -- 
> please visit:
> http://www.globalcarbonatlas.org/
> ***********************************************************************************
> Chao YUE
> Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
> UMR 1572 CEA-CNRS-UVSQ
> Batiment 712 - Pe 119
> 91191 GIF Sur YVETTE Cedex
> Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
> ************************************************************************************
> 
> ------------------------------------------------------------------------------
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
> 
> 
> 
> -- 
> please visit:
> http://www.globalcarbonatlas.org/
> ***********************************************************************************
> Chao YUE
> Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
> UMR 1572 CEA-CNRS-UVSQ
> Batiment 712 - Pe 119
> 91191 GIF Sur YVETTE Cedex
> Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
> ************************************************************************************
From: Chao Y. <cha...@gm...> - 2014年04月23日 15:35:57
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, Apr 22, 2014 at 3:31 PM, Benjamin Root <ben...@ou...> wrote:
> Yes, there is a difference if you use the button versus explicitly stating
> the dpi in a savefig call. When you use the button, matplotlib has to use
> the default dpi since there is no other way to specify it.
>
> Cheers!
> Ben Root
>
>
> On Mon, Apr 21, 2014 at 5:03 PM, Chao YUE <cha...@gm...> wrote:
>
>> Yes, in fact I set dpi as 1000, which is already very high. In fact I
>> have another question, will there be any difference if I use the save
>> button on the interactive plotting toolbar and use the command line
>> figure.savefig('xx.png',dpi=1000)?
>>
>> Chao
>>
>>
>> On Mon, Apr 21, 2014 at 10:59 PM, Jody Klymak <jk...@uv...> wrote:
>>
>>> Did you set the dpi of the png?
>>>
>>> Cheers, Jody
>>>
>>>
>>> On Apr 21, 2014, at 13:50 PM, ChaoYue <cha...@gm...> wrote:
>>>
>>> OK, I tried but I don't really see the difference between jpg and png by
>>> my eyes in the attached case, maybe for other more complicated plots there
>>> will be real difference. Anyway, thanks to all for your nice discussions.
>>> And, BTW, I tried >2 hours trying to find a way to convert svg to emf, but
>>> now I konw :p
>>>
>>> Cheers,
>>>
>>> Chao
>>>
>>>
>>> On Mon, Apr 21, 2014 at 9:49 PM, Benjamin Root-2 [via matplotlib] <[hidden
>>> email]> wrote:
>>>
>>>> JPGs will *always* have "bit blur" as it is a lossy image format. PNGs
>>>> would be a better bet.
>>>>
>>>> Ben Root
>>>>
>>>>
>>>> On Mon, Apr 21, 2014 at 3:33 PM, ChaoYue <[hidden email]<http://user/SendEmail.jtp?type=node&node=43265&i=0>
>>>> > wrote:
>>>>
>>>>> Hi all,
>>>>>
>>>>> Thank you all for your kind response. I am sorry, but none of these
>>>>> solutions significantly improved the visual quality on microsoft powerpiont
>>>>> 2007. Thought I didn't try eps. So probably l have to go with the current
>>>>> quality.
>>>>> here is a best case I have now:
>>>>> https://www.dropbox.com/s/0uhjogalz92hssm/different_figure_example.pptx
>>>>> You can still see the "a bit blur" everywhere (currently with jpg
>>>>> being inserted directly). I didn't have better quality than this one by
>>>>> trying the method as suggested by you. Let me know if I am raising too much
>>>>> high demand for this.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Chao
>>>>>
>>>>>
>>>>> On Mon, Apr 21, 2014 at 4:41 PM, Jonathan Slavin [via matplotlib] <[hidden
>>>>> email] <http://user/SendEmail.jtp?type=node&node=43264&i=0>> wrote:
>>>>>
>>>>>> ​Another alternative, if a vector graphics format doesn't work, is to
>>>>>> make your png figure large. Then when you shrink it down to fit in your
>>>>>> slide, it should still have good resolution.
>>>>>>
>>>>>> Jon​
>>>>>>
>>>>>> On Mon, Apr 21, 2014 at 10:13 AM, <[hidden email]<http://user/SendEmail.jtp?type=node&node=43262&i=0>
>>>>>> > wrote:
>>>>>>
>>>>>>> No Powerpoint version I know supports SVG (or any vector graphics
>>>>>>> format useful in this case) and Matplotlib does not
>>>>>>> export WMF graphics anymore. So the easiest way is to use PNGs, if
>>>>>>> you can live with raster graphics.
>>>>>>>
>>>>>>> Alternatively, if you need vector graphics, you can export the
>>>>>>> Matplotlib plot as SVG and convert it to WMF or EMF using
>>>>>>> Inkscape. This can be done in the command line like this:
>>>>>>>
>>>>>>> "c:\Program Files\Inkscape-0.48\inkscape.exe" --without-gui
>>>>>>> --export-emf="output.emf" "input.svg"
>>>>>>>
>>>>>>>
>>>>>>> Juergen
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> ________________________________________________________
>>>>>> Jonathan D. Slavin Harvard-Smithsonian CfA
>>>>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=43262&i=1>
>>>>>> 60 Garden Street, MS 83
>>>>>> phone: <a href="tel:%28617%29%20496-7981" value="<a
>>>>>> href="tel:%2B16174967981" value="+16174967981" target="_blank">
>>>>>> +16174967981" target="_blank">(617) 496-7981 Cambridge, MA
>>>>>> 02138-1516
>>>>>> fax: <a href="tel:%28617%29%20496-7577" value="<a
>>>>>> href="tel:%2B16174967577" value="+16174967577" target="_blank">
>>>>>> +16174967577" target="_blank">(617) 496-7577 USA
>>>>>> ________________________________________________________
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>>
>>>>>> 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
>>>>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=43262&i=2>
>>>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>>>
>>>>>>
>>>>>> ------------------------------
>>>>>> If you reply to this email, your message will be added to the
>>>>>> discussion below:
>>>>>>
>>>>>> http://matplotlib.1069221.n5.nabble.com/Make-clear-figure-used-in-the-powerpoint-slides-tp43252p43262.html
>>>>>> To start a new topic under matplotlib - users, email [hidden email]<http://user/SendEmail.jtp?type=node&node=43264&i=1>
>>>>>> To unsubscribe from matplotlib, click here.
>>>>>> NAML<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> please visit:
>>>>> http://www.globalcarbonatlas.org/
>>>>>
>>>>> ***********************************************************************************
>>>>> Chao YUE
>>>>> Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
>>>>> UMR 1572 CEA-CNRS-UVSQ
>>>>> Batiment 712 - Pe 119
>>>>> 91191 GIF Sur YVETTE Cedex
>>>>> Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
>>>>>
>>>>> ************************************************************************************
>>>>>
>>>>> ------------------------------
>>>>> View this message in context: Re: Make clear figure used in the
>>>>> powerpoint slides?<http://matplotlib.1069221.n5.nabble.com/Make-clear-figure-used-in-the-powerpoint-slides-tp43252p43264.html>
>>>>> Sent from the matplotlib - users mailing list archive<http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html>at
>>>>> Nabble.com.
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> 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
>>>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=43265&i=1>
>>>>> 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
>>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=43265&i=2>
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>
>>>>
>>>> ------------------------------
>>>> If you reply to this email, your message will be added to the
>>>> discussion below:
>>>>
>>>> http://matplotlib.1069221.n5.nabble.com/Make-clear-figure-used-in-the-powerpoint-slides-tp43252p43265.html
>>>> To start a new topic under matplotlib - users, email [hidden email]
>>>> To unsubscribe from matplotlib, click here.
>>>> NAML<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>>
>>>
>>>
>>>
>>> --
>>> please visit:
>>> http://www.globalcarbonatlas.org/
>>>
>>> ***********************************************************************************
>>> Chao YUE
>>> Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
>>> UMR 1572 CEA-CNRS-UVSQ
>>> Batiment 712 - Pe 119
>>> 91191 GIF Sur YVETTE Cedex
>>> Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
>>>
>>> ************************************************************************************
>>>
>>> ------------------------------
>>> View this message in context: Re: Make clear figure used in the
>>> powerpoint slides?<http://matplotlib.1069221.n5.nabble.com/Make-clear-figure-used-in-the-powerpoint-slides-tp43252p43266.html>
>>> Sent from the matplotlib - users mailing list archive<http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html>at
>>> Nabble.com.
>>>
>>> ------------------------------------------------------------------------------
>>> 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
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>>
>>
>>
>> --
>> please visit:
>> http://www.globalcarbonatlas.org/
>>
>> ***********************************************************************************
>> Chao YUE
>> Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
>> UMR 1572 CEA-CNRS-UVSQ
>> Batiment 712 - Pe 119
>> 91191 GIF Sur YVETTE Cedex
>> Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
>>
>> ************************************************************************************
>>
>>
>> ------------------------------------------------------------------------------
>> 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
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
-- 
please visit:
http://www.globalcarbonatlas.org/
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
************************************************************************************
From: Benjamin R. <ben...@ou...> - 2014年04月23日 15:12:55
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:
 animate.patch = plt.Circle((5, -5), 0.75, fc='y')
 animate.ax.add_patch(animate.patch)
 x, y = animate.patch.center
 x = 5 + 3 * np.sin(np.radians(i))
 y = 5 + 3 * np.cos(np.radians(i))
 animate.patch.center = (x, y)
 return animate.patch,
animate.ax = ax
animate.patch = None
If you have something more complicated, then just go full bore and use
classes to store the state.
Cheers!
Ben Root
On Wed, Apr 23, 2014 at 10:51 AM, Raymond Smith <sm...@mi...> wrote:
> 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...@ou...> 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 <sm...@mi...> 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 <ma...@gm...> 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
>>>> Mat...@li...
>>>> 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
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>
>
From: Raymond S. <sm...@mi...> - 2014年04月23日 14:51:50
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...@ou...> 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 <sm...@mi...> 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 <ma...@gm...> 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
>>> Mat...@li...
>>> 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
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
From: Benjamin R. <ben...@ou...> - 2014年04月23日 14:30:04
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 <sm...@mi...> 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 <ma...@gm...> 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
>> Mat...@li...
>> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Raymond S. <sm...@mi...> - 2014年04月23日 14:26:19
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 <ma...@gm...> 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 <sm...@mi...> 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 <ma...@gm...> 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
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>
>
From: Mark B. <ma...@gm...> - 2014年04月23日 14:08:15
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 <sm...@mi...> 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 <ma...@gm...> 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
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
From: Raymond S. <sm...@mi...> - 2014年04月23日 13:35:10
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 <ma...@gm...> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Mark B. <ma...@gm...> - 2014年04月23日 09:44:30
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
From: Don M. <don...@bo...> - 2014年04月22日 15:13:15
Hello,
I'm new to this list (but not matplotlib and basemap), and am not sure if
this is the place to post basemap questions. I apologise if I have erred.
I'm reporting an issue whereby if I try to plot a zoomed in orthographic
projection with a bluemarble (or etopo or shaded relief) background, the
background remains "global," though it's oriented to the correct location,
not mapping to the zoomed projection coordinates. I am pasting in a simple
demo code that illustrates the behaviour. If you use the lcc projection,
all works fine, and if you use a "non-zoomed" ortho projection, the
background maps correctly.
It seems that there is something preventing the background from mapping
into anything but a "complete-domain" ortho projection. I'm not a great
map person, and I realise I may be missing the boat on the way I'm trying
to zoom my ortho projection, but I'm not sure.
Am I screwing up, or is it a bug?
Thank you,
Don Morton
#---------------------------------------------------
import mpl_toolkits.basemap as bm
import matplotlib.pyplot as plt
import numpy as np
# Define a lambert conformal over northwest United States
# With this projection (centered on Montana, and zoomed in),
# the background image does map to the zoomed in projection
'''
theMap = bm.Basemap(projection='lcc',
 lat_0=47, lat_1=30, lat_2=60, lon_0=-115,
 llcrnrlat=43, llcrnrlon=-128,
 urcrnrlat=55, urcrnrlon=-105,
 resolution='i', area_thresh=1000)
'''
# With this projection (centered on Vienna, and zoomed in),
# the background image doesn't map to the zoomed in projection
theMap = bm.Basemap(projection='ortho',
 lat_0=48.2, lon_0=16.4,
 llcrnry=-1000000.0, llcrnrx=-1000000.0,
 urcrnry=1000000.0, urcrnrx=1000000.0,
 resolution='l', area_thresh=1000)
theMap.drawcountries()
theMap.drawcoastlines()
theMap.bluemarble()
#theMap.shadedrelief()
#theMap.etopo()
plt.show()
---
Don Morton, Owner/Manager
Boreal Scientific Computing LLC
Fairbanks, Alaska USA
http://www.borealscicomp.com/
http://www.borealscicomp.com/Miscellaneous/MortonBio/
From: Benjamin R. <ben...@ou...> - 2014年04月22日 13:35:06
In most cases, you can also query the artist object for which axes it
belongs to:
ax = a.get_axes()
Note that is can be None if it hasn't been attached anywhere.
Cheers!
Ben Root
On Tue, Apr 22, 2014 at 3:35 AM, Eric Firing <ef...@ha...> wrote:
> On 2014年04月21日 8:30 PM, Michael Mossey wrote:
> > How do I check if an artist is in the list of artists attached to an
> axes?
>
> if a in ax.get_children():
> ...
>
> Eric
> >
> > Mike
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > 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
> > Mat...@li...
> > 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Benjamin R. <ben...@ou...> - 2014年04月22日 13:32:04
Yes, there is a difference if you use the button versus explicitly stating
the dpi in a savefig call. When you use the button, matplotlib has to use
the default dpi since there is no other way to specify it.
Cheers!
Ben Root
On Mon, Apr 21, 2014 at 5:03 PM, Chao YUE <cha...@gm...> wrote:
> Yes, in fact I set dpi as 1000, which is already very high. In fact I have
> another question, will there be any difference if I use the save button on
> the interactive plotting toolbar and use the command line
> figure.savefig('xx.png',dpi=1000)?
>
> Chao
>
>
> On Mon, Apr 21, 2014 at 10:59 PM, Jody Klymak <jk...@uv...> wrote:
>
>> Did you set the dpi of the png?
>>
>> Cheers, Jody
>>
>>
>> On Apr 21, 2014, at 13:50 PM, ChaoYue <cha...@gm...> wrote:
>>
>> OK, I tried but I don't really see the difference between jpg and png by
>> my eyes in the attached case, maybe for other more complicated plots there
>> will be real difference. Anyway, thanks to all for your nice discussions.
>> And, BTW, I tried >2 hours trying to find a way to convert svg to emf, but
>> now I konw :p
>>
>> Cheers,
>>
>> Chao
>>
>>
>> On Mon, Apr 21, 2014 at 9:49 PM, Benjamin Root-2 [via matplotlib] <[hidden
>> email]> wrote:
>>
>>> JPGs will *always* have "bit blur" as it is a lossy image format. PNGs
>>> would be a better bet.
>>>
>>> Ben Root
>>>
>>>
>>> On Mon, Apr 21, 2014 at 3:33 PM, ChaoYue <[hidden email]<http://user/SendEmail.jtp?type=node&node=43265&i=0>
>>> > wrote:
>>>
>>>> Hi all,
>>>>
>>>> Thank you all for your kind response. I am sorry, but none of these
>>>> solutions significantly improved the visual quality on microsoft powerpiont
>>>> 2007. Thought I didn't try eps. So probably l have to go with the current
>>>> quality.
>>>> here is a best case I have now:
>>>> https://www.dropbox.com/s/0uhjogalz92hssm/different_figure_example.pptx
>>>> You can still see the "a bit blur" everywhere (currently with jpg being
>>>> inserted directly). I didn't have better quality than this one by trying
>>>> the method as suggested by you. Let me know if I am raising too much high
>>>> demand for this.
>>>>
>>>> Cheers,
>>>>
>>>> Chao
>>>>
>>>>
>>>> On Mon, Apr 21, 2014 at 4:41 PM, Jonathan Slavin [via matplotlib] <[hidden
>>>> email] <http://user/SendEmail.jtp?type=node&node=43264&i=0>> wrote:
>>>>
>>>>> ​Another alternative, if a vector graphics format doesn't work, is to
>>>>> make your png figure large. Then when you shrink it down to fit in your
>>>>> slide, it should still have good resolution.
>>>>>
>>>>> Jon​
>>>>>
>>>>> On Mon, Apr 21, 2014 at 10:13 AM, <[hidden email]<http://user/SendEmail.jtp?type=node&node=43262&i=0>
>>>>> > wrote:
>>>>>
>>>>>> No Powerpoint version I know supports SVG (or any vector graphics
>>>>>> format useful in this case) and Matplotlib does not
>>>>>> export WMF graphics anymore. So the easiest way is to use PNGs, if
>>>>>> you can live with raster graphics.
>>>>>>
>>>>>> Alternatively, if you need vector graphics, you can export the
>>>>>> Matplotlib plot as SVG and convert it to WMF or EMF using
>>>>>> Inkscape. This can be done in the command line like this:
>>>>>>
>>>>>> "c:\Program Files\Inkscape-0.48\inkscape.exe" --without-gui
>>>>>> --export-emf="output.emf" "input.svg"
>>>>>>
>>>>>>
>>>>>> Juergen
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> ________________________________________________________
>>>>> Jonathan D. Slavin Harvard-Smithsonian CfA
>>>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=43262&i=1>
>>>>> 60 Garden Street, MS 83
>>>>> phone: <a href="tel:%28617%29%20496-7981" value="<a
>>>>> href="tel:%2B16174967981" value="+16174967981" target="_blank">
>>>>> +16174967981" target="_blank">(617) 496-7981 Cambridge, MA
>>>>> 02138-1516
>>>>> fax: <a href="tel:%28617%29%20496-7577" value="<a
>>>>> href="tel:%2B16174967577" value="+16174967577" target="_blank">
>>>>> +16174967577" target="_blank">(617) 496-7577 USA
>>>>> ________________________________________________________
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>>
>>>>> 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
>>>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=43262&i=2>
>>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>>
>>>>>
>>>>> ------------------------------
>>>>> If you reply to this email, your message will be added to the
>>>>> discussion below:
>>>>>
>>>>> http://matplotlib.1069221.n5.nabble.com/Make-clear-figure-used-in-the-powerpoint-slides-tp43252p43262.html
>>>>> To start a new topic under matplotlib - users, email [hidden email]<http://user/SendEmail.jtp?type=node&node=43264&i=1>
>>>>> To unsubscribe from matplotlib, click here.
>>>>> NAML<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> please visit:
>>>> http://www.globalcarbonatlas.org/
>>>>
>>>> ***********************************************************************************
>>>> Chao YUE
>>>> Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
>>>> UMR 1572 CEA-CNRS-UVSQ
>>>> Batiment 712 - Pe 119
>>>> 91191 GIF Sur YVETTE Cedex
>>>> Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
>>>>
>>>> ************************************************************************************
>>>>
>>>> ------------------------------
>>>> View this message in context: Re: Make clear figure used in the
>>>> powerpoint slides?<http://matplotlib.1069221.n5.nabble.com/Make-clear-figure-used-in-the-powerpoint-slides-tp43252p43264.html>
>>>> Sent from the matplotlib - users mailing list archive<http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html>at
>>>> Nabble.com.
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> 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
>>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=43265&i=1>
>>>> 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
>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=43265&i=2>
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>> ------------------------------
>>> If you reply to this email, your message will be added to the
>>> discussion below:
>>>
>>> http://matplotlib.1069221.n5.nabble.com/Make-clear-figure-used-in-the-powerpoint-slides-tp43252p43265.html
>>> To start a new topic under matplotlib - users, email [hidden email]
>>> To unsubscribe from matplotlib, click here.
>>> NAML<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>
>>
>>
>>
>> --
>> please visit:
>> http://www.globalcarbonatlas.org/
>>
>> ***********************************************************************************
>> Chao YUE
>> Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
>> UMR 1572 CEA-CNRS-UVSQ
>> Batiment 712 - Pe 119
>> 91191 GIF Sur YVETTE Cedex
>> Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
>>
>> ************************************************************************************
>>
>> ------------------------------
>> View this message in context: Re: Make clear figure used in the
>> powerpoint slides?<http://matplotlib.1069221.n5.nabble.com/Make-clear-figure-used-in-the-powerpoint-slides-tp43252p43266.html>
>> Sent from the matplotlib - users mailing list archive<http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html>at
>> Nabble.com.
>>
>> ------------------------------------------------------------------------------
>> 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
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>>
>
>
> --
> please visit:
> http://www.globalcarbonatlas.org/
>
> ***********************************************************************************
> Chao YUE
> Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
> UMR 1572 CEA-CNRS-UVSQ
> Batiment 712 - Pe 119
> 91191 GIF Sur YVETTE Cedex
> Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
>
> ************************************************************************************
>
>
> ------------------------------------------------------------------------------
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Eric F. <ef...@ha...> - 2014年04月22日 07:41:39
On 2014年04月21日 8:30 PM, Michael Mossey wrote:
> How do I check if an artist is in the list of artists attached to an axes?
if a in ax.get_children():
 ...
Eric
>
> Mike
>
>
>
> ------------------------------------------------------------------------------
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Michael M. <mic...@gm...> - 2014年04月22日 06:30:21
How do I check if an artist is in the list of artists attached to an axes?
Mike
From: Michael M. <mic...@gm...> - 2014年04月22日 00:59:33
Further update: I think I know how to do this. I can register a mouse event
handler, and its xdata and ydata properties will tell me the data
coordinates.
On Mon, Apr 21, 2014 at 4:17 PM, Michael Mossey <mic...@gm...>wrote:
> Note: I'm looking at the Picker examples now and one problem I see is that
> I'm not asking the user to click on data points, but anywhere on the axes.
>
>
> On Mon, Apr 21, 2014 at 3:49 PM, Michael Mossey <mic...@gm...>wrote:
>
>> For my application which is a simple sound file editor written with
>> matplotlib and PyQt4, I want to detect left and right clicks on the canvas.
>> I need to know the data coordinates of the click (i.e., not where on the
>> screen the click occurred, but what data point as defined by the axes it
>> represents). How do I do this?
>>
>> Mike
>>
>>
>
From: Mike K. <mc...@gm...> - 2014年04月22日 00:03:29
Why not save to PDF? Drops straight into Powerpoint...
M
On 4/21/14, 4:50 PM, ChaoYue wrote:
> OK, I tried but I don't really see the difference between jpg and png by
> my eyes in the attached case, maybe for other more complicated plots
> there will be real difference. Anyway, thanks to all for your nice
> discussions. And, BTW, I tried >2 hours trying to find a way to convert
> svg to emf, but now I konw :p
>
> Cheers,
>
> Chao
>
>
> On Mon, Apr 21, 2014 at 9:49 PM, Benjamin Root-2 [via matplotlib]
> <[hidden email] </user/SendEmail.jtp?type=node&node=43266&i=0>> wrote:
>
> JPGs will *always* have "bit blur" as it is a lossy image format.
> PNGs would be a better bet.
>
> Ben Root
>
>

Showing results of 117

<< < 1 2 3 4 5 > >> (Page 2 of 5)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /