Plots.jl/Jupyter figure?


I’ve slowly been moving over from PyPlot to Plots.jl and one thing that seems missing is an analog of figure(). This shows up when I have a cell in a Jupyter notebook, and I want to create several plots, one after another. While I can create a new cell for each plot, there were times when it made sense to organize them all together into a single cell.


I’m not a heavy user of Plots.jl (yet), but I couldn’t believe the functionality
you’re looking here was really lacking. I spent about 90 seconds in the docs and
found references to @layout, which
I’m pretty sure is what you’re looking for. Or is there functionality in
matplotlib figures beyond what you have with layout that I’m not aware of?

EDIT: The section on layouts is hidden away on the “advanced topics” part of the
docs, which seems ridiculous.


layout seems to really be for doing subplots (which my be what I should be doing). I was looking for something that would just allow me to open up a new figure and plot in it.


Can you give me a concrete example of this workflow? I’m not sure I understand.

Afaict, a matplotlib figure is
just a container to hold some subplots.

EDIT: not sure if it’s possible to change it at this point, but this question
probably fits into the vizualizations section of discourse.

using PyPlot

x= linspace(0,10)


You can force anything to show up in the jupyter output cell using the display
function. So my minimal example of getting the same thing with Plots.jl would be:

using Plots
display(plot(sin, 0:0.1:10))
display(plot(cos, 0:0.1:10))