Hi all.

Just a little update: I got a few answers from Davide (who did the
recent plotting refactors) at
https://github.com/mgeier/python-audio/issues/4.

If anyone has further advice, please reply here or there.

cheers,
Matthias

On Tue, Nov 12, 2024 at 9:32 PM Aaron Meurer <[email protected]> wrote:
>
> On Tue, Nov 12, 2024 at 11:38 AM Matthias Geier
> <[email protected]> wrote:
> >
> > Hi Aaron.
> >
> > On Mon, Nov 11, 2024 at 8:38 PM Aaron Meurer wrote:
> > >
> > > I haven't followed all the changes to plotting. Do you know what the
> > > PR SymPy was that changed this?
> >
> > That's not so straightforward ... different things seem to have broken
> > at different times. But maybe I wasn't using them correctly in the
> > first place?
> >
> > The example which assigns to "parent"
> > (https://nbviewer.org/github/mgeier/python-audio/blob/master/sympy/sympy-matplotlib-animations.ipynb#Changing-the-Whole-Plot)
> > still partially works with
> > https://github.com/sympy/sympy/commit/5d1e056.
> >
> > I'm saying "partially", because it now cycles the plotting colors,
> > which it didn't do before (see below for the cause of that problem).
> >
> > One commit later (https://github.com/sympy/sympy/commit/46558492a7),
> > I'm getting this exception:
> >
> >     AttributeError: 'MatplotlibBackend' object has no attribute 'fig'
>
> It seems like that commit was supposed to just be a refactor, so if it
> broke some use-case, it was likely unintentional.
>
> It's not clear to me whether the things you're doing are supposed to
> be supported or not (again, I don't really know much about the
> plotting module). I would say that animation is something that should
> be doable, either by being directly supported or by being
> straightforward to hook into what SymPy gives you.
>
> Aaron Meurer
>
> >
> > The "fig" attribute is now not set in the constructor anymore, but
> > instead at a later point, e.g. when calling process_series(). So
> > should I call that first?
> >
> > If yes, it is still not working. Even though this avoids the
> > exception, now the animation simply consists of an empty plot (i.e.
> > only the axes are visible).
> >
> > BTW, I'm using "show=False". When I drop that, the "has no attribute
> > 'fig'" goes away, but the animation still doesn't work (instead, there
> > are a few stray plots generated).
> >
> > Going back in the history, I found that
> > https://github.com/sympy/sympy/commit/79a2cd5432177f662b2bebe1ffc3b3bc4ca575b9
> > is the commit that introduces the color cycling.
> > According to the commit message, the color change is definitely
> > intentional, so I guess I'll have to try to work around that behavior
> > change.
> >
> > The first example still doesn't work at this point in the history. It
> > just shows an empty plot (only the axes are visible).
> >
> > I wanted to go further back in history, but I wasn't able to install a
> > combination of SymPy/NumPy/Matplotlib/Python that worked.
> >
> > Is there anything else I should try?
> >
> > cheers,
> > Matthias
> >
> > > Aaron Meurer
> > >
> > > On Sat, Nov 9, 2024 at 1:24 PM Matthias Geier <[email protected]> 
> > > wrote:
> > > >
> > > > Hi all.
> > > >
> > > > A few years ago, I have documented how to create Matplotlib animations
> > > > from SymPy plots:
> > > > https://nbviewer.org/github/mgeier/python-audio/blob/master/sympy/sympy-matplotlib-animations.ipynb
> > > >
> > > > This has worked quite well (as can be seen in the link), but in the
> > > > meantime, the behavior/usage of the MatplotlibBackend seems to have
> > > > changed and some of the approaches don't work anymore with the latest
> > > > SymPy/Matplotlib versions.
> > > >
> > > > Most notably, the process_series() method doesn't seem to have the
> > > > desired effect anymore.
> > > >
> > > > Note that the approach using get_points() still works perfectly, and
> > > > the approach using get_segments() is deprecated, and is not expected
> > > > to work anymore.
> > > >
> > > > Does anyone have an idea how to make the approaches using
> > > > MatplotlibBackend work again?
> > > >
> > > > cheers,
> > > > Matthias
> > > >
> > > > --
> > > > You received this message because you are subscribed to the Google 
> > > > Groups "sympy" group.
> > > > To unsubscribe from this group and stop receiving emails from it, send 
> > > > an email to [email protected].
> > > > To view this discussion visit 
> > > > https://groups.google.com/d/msgid/sympy/CAFesC-dx1U1%2BLHDpU4J-SqLs21cszhCaDXSLYSf2dEuTDEjYDg%40mail.gmail.com.
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "sympy" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an 
> > > email to [email protected].
> > > To view this discussion visit 
> > > https://groups.google.com/d/msgid/sympy/CAKgW%3D6K1hVkWmw3FZ0nHBemS4oBkAqC4kRHdR9uxSXXk6f21EA%40mail.gmail.com.
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "sympy" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to [email protected].
> > To view this discussion visit 
> > https://groups.google.com/d/msgid/sympy/CAFesC-cvTU-VOsMgoCRAdWE5jzrSVG5%3Dk-dASH%2BXwaXo8HJ63w%40mail.gmail.com.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion visit 
> https://groups.google.com/d/msgid/sympy/CAKgW%3D6KC6QCJt0Y%3DTsa1rFSTRbeMWCgN-WxMxaqx91xQdwb%2BQw%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/sympy/CAFesC-cWQTsMxQo%3DzigRZZ_rbf59TWyooJ4Q5tp1J4AF5_JYPQ%40mail.gmail.com.

Reply via email to