2

Typically if I want to make an interactive plot, I use %matplotlib qt, such that I can explore, zoom, add to the figure etc. I wanted to make an area plot, and with the release of seaborn objects, this is easy. Only, it always plots "inline" in my console (spyder), which I find really user-unfriendly as compared with the interactive plotting I normally do (with the normal seaborn plots which are built on matplotlib, there is no problem). Is there anyone who knows a solution for this?

fig, ax = plt.subplots(nrows = 1, ncols = 1, figsize=(15,8))
p = so.Plot(sumstat, "date", "std")
p.add(so.Area())
3

1 Answer 1

0

To compile the Plot using the axes that you have created, you want Plot.on:

fig, ax = plt.subplots(nrows = 1, ncols = 1, figsize=(15,8))
(
    so.Plot(sumstat, "date", "std")
    .add(so.Area())
    .on(ax)
)

Or you can keep the entire specification within the objects interface but hook into pyplot for the display using Plot.show:

(
    so.Plot(sumstat, "date", "std")
    .add(so.Area())
    .layout(size=(15, 8))
    .show()
)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.