Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make more than one chart in same IPython Notebook cell

I have started my IPython Notebook with

ipython notebook --pylab inline 

This is my code in one cell

df['korisnika'].plot() df['osiguranika'].plot() 

This is working fine, it will draw two lines, but on the same chart.

I would like to draw each line on a separate chart. And it would be great if the charts would be next to each other, not one after the other.

I know that I can put the second line in the next cell, and then I would get two charts. But I would like the charts close to each other, because they represent the same logical unit.

like image 872
WebOrCode Avatar asked May 06 '13 06:05

WebOrCode


People also ask

Can you run multiple cells at once Jupyter notebook?

First, you will need to install jupyter nbextensions configurator as described here. Then search for "Initialization cells" from inside the search bar of the Jupyter nbextension manager. A check box at the top of every cell will appear. You can select which cells to be marked as initialization cells.

How do you write more than one line in Ipython?

ctrl+o. If you type ctrl+o, you should be able to add additional lines to the input to run them simultaneously. If that doesn't work, as a workaround, you can paste multiple lines after copying them from elsewhere, or you can press enter on a line with a semicolon or unclosed parentheses.


1 Answers

You can also call the show() function after each plot. e.g

   plt.plot(a)    plt.show()    plt.plot(b)    plt.show() 
like image 137
Tooblippe Avatar answered Oct 16 '22 09:10

Tooblippe