# Using streamplot with PyPlot backend in Plots

**URL:** <https://discourse.julialang.org/t/using-streamplot-with-pyplot-backend-in-plots/81278>\
**Category:** Visualization\
**Tags:** question, pyplot, plots\
**Created:** [May 18, 2022, 7:50pm UTC](https://discourse.julialang.org/t/using-streamplot-with-pyplot-backend-in-plots/81278 "2022-05-18T19:50:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmdenis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cmdenis/32/211517_2.png) [@cmdenis](https://discourse.julialang.org/u/cmdenis)\
**Post date:** [May 18, 2022, 7:50pm UTC](https://discourse.julialang.org/t/using-streamplot-with-pyplot-backend-in-plots/81278/1 "2022-05-18T19:50:14Z")

</div>

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:

```julia
using Plots
pyplot()

streamplot()

```

but I simply get an error message saying:

```julia
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!

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [May 19, 2022, 1:19pm UTC](https://discourse.julialang.org/t/using-streamplot-with-pyplot-backend-in-plots/81278/2 "2022-05-19T13:19:11Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![cmdenis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cmdenis/32/211517_2.png) [@cmdenis](https://discourse.julialang.org/u/cmdenis)\
**Post date:** [May 19, 2022, 2:14pm UTC](https://discourse.julialang.org/t/using-streamplot-with-pyplot-backend-in-plots/81278/3 "2022-05-19T14:14:21Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [May 19, 2022, 2:18pm UTC](https://discourse.julialang.org/t/using-streamplot-with-pyplot-backend-in-plots/81278/4 "2022-05-19T14:18:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [May 19, 2022, 2:49pm UTC](https://discourse.julialang.org/t/using-streamplot-with-pyplot-backend-in-plots/81278/5 "2022-05-19T14:49:31Z")

</div>

Interested in trying Makie?

[https://makie.juliaplots.org/dev/documentation/animation/](https://makie.juliaplots.org/dev/documentation/animation/)  
and  
[https://makie.juliaplots.org/dev/examples/plotting\_functions/streamplot/](https://makie.juliaplots.org/dev/examples/plotting_functions/streamplot/)

---

<div class="post-metadata">

**Author:** ![cmdenis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cmdenis/32/211517_2.png) [@cmdenis](https://discourse.julialang.org/u/cmdenis)\
**Post date:** [May 20, 2022, 4:02pm UTC](https://discourse.julialang.org/t/using-streamplot-with-pyplot-backend-in-plots/81278/6 "2022-05-20T16:02:05Z")

</div>

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
