Using streamplot with PyPlot backend in Plots

Hello,

I don’t have a strong understanding of how Plots work, but as far as I know, it serves as an API that uses backend plotting systems, like matplotlib or gr. This allows the user to use similar (if not identical) syntax between different backends. Hopefully my understanding here is correct, but I’d appreciate any corrections!

Based on this, I would like to use the streamplot function from the PyPlot backend inside Plots.

Is this doable?

I have tried to test it like this:

using Plots
pyplot()

streamplot()

but I simply get an error message saying:

UndefVarError: streamplot not defined

Is the streamplot function not present when using PyPlot as backend? Or if it is, how do I use it?

I know that I could be using directly the PyPlot package without going through Plots, but the reason why I prefer to stick with Plots is because it has a very convenient interface to generate GIFs (with the @animate macro).

Any help or clarification would be appreciated!

Are you able to achieve your aim with using quiver in Plots.jl as a replacement for streamplot or is there something specific in streamplot you need to use?

As far as I know, quiver only displays arrows in the plot, while streamplot displays trajectory curves automatically (unless there’s an argument allowing quiver to display curved lines like streamplot that I don’t know about?). This last feature is what’s of interest to me.

Before knowing about streamplot I tried doing a homemade version of the function, but it didn’t work as conveniently as streamplot did :slight_smile:

Ok, thought that might be the case. It would take a lot of finesse to get something like streamplot working smoothly if writing from scratch.

Interested in trying Makie?

https://makie.juliaplots.org/dev/documentation/animation/
and
https://makie.juliaplots.org/dev/examples/plotting_functions/streamplot/

Thanks! I think I’ll give it a shot!

But I’d be still open to a way of using Plots if someone finds something