Ask Your Question

Floating plots in notebook?

asked 2015-04-16 17:40:52 -0600

Eugene gravatar image

Is there a way to make plots float? Like in floating divs? Say, I have a two plots:

plot(sin, 0, pi).show()
plot(cos, 0, pi).show()

Right now this code produces two pictures, one on top of the other:

|plot 1|
|plot 2|

But my screen is wide enough to show them alongside like:

|plot 1| plot 2|

It would be nice to have an option allowing to produce a few floating divs from pictures.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2015-04-19 06:43:03 -0600

ndomes gravatar image
edit flag offensive delete link more


Thanks for the answer too! I have the same question about approach with html, is there a way to use additional parameters, like axis labels to ticks? Again, preferably separately for each plot.

Eugene gravatar imageEugene ( 2015-04-19 10:51:51 -0600 )edit

You can use further options with the plot command, for example:

ndomes gravatar imagendomes ( 2015-04-19 11:43:56 -0600 )edit

answered 2015-04-16 18:15:36 -0600

tmonteil gravatar image

Not playing with html, but glueing the plots in a single one, you can use GraphicsArray:

sage: from import GraphicsArray
sage: GraphicsArray([plot(sin, 0, pi), plot(cos, 0, pi)])
Launched png viewer for Graphics Array of size 1 x 2
edit flag offensive delete link more


Thanks for the answer! But in that case where do I put additional parameters like, for example, axis_labels? It would be nice to be able to control additional parameters separately for each plot. I tried to put them in but that cause an error:

RuntimeError: should never launch viewer in embedded mode

and also affected all plots.

Eugene gravatar imageEugene ( 2015-04-19 10:50:31 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-04-16 17:40:52 -0600

Seen: 130 times

Last updated: Apr 19 '15