[Matplotlib-users] Efficiency in connecting two subplot.

Benjamin Root ben.v.root at gmail.com
Tue Feb 20 15:27:45 EST 2018


Yup, that's pretty much it. Since you have it all in a class, then doing
`self.counter` makes a lot of sense. You can also tune it accordingly to do
only every 3rd, 4th, 5th or what-have-you.

Cheers!
Ben Root

On Tue, Feb 20, 2018 at 3:03 PM, Christophe Bal <projetmbc at gmail.com> wrote:

> Thanks
>
> Christophe BAL
> Enseignant Agrégé de Mathématiques
> Programmeur Python Amateur
>
> Le 20 févr. 2018 20:02, "Éric Depagne" <eric at depagne.org> a écrit :
>
>> Hi Christophe,
>>
>> I am not sure it's what Ben had in mind (if not, I'm happy to know  how it
>> should have been done), but here is the way I did it.
>>
>> (my _on_move() method is a member of a class)
>> I added this to the __init__() :
>> self.counter = 0
>>
>> Then I added the following lines to _on_move():
>> self.counter += 1
>> if self.counter %2 :
>>         return
>> [snip all the details of the update of the plots)
>> self.counter = 0
>>
>> And it updates the plot every other move.
>>
>> Éric.
>>
>> --
>> Un clavier azerty en vaut deux
>> ----------------------------------------------------------
>> Éric Depagne
>>
>>
>>
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180220/071b7902/attachment.html>


More information about the Matplotlib-users mailing list