Getting ipython notebook to plot inline

F

Frank Franklin

I've just managed to install ipython and get it to run by typing ipython notebook --pylab=inline

Now I'm getting the following error when I try to plot something in ipythonnotebook:
AttributeError: 'module' object has no attribute 'FigureCanvas'

I've tried using imports to make this work:
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(0, 5, 0.1);
y = np.sin(x)
plt.plot(x, y)

But for some reason I still get this error. Anybody else know what's going on here? All of the print statements I've done before have worked, and I actually got my plots to work when I didn't set --pylab=inline, though theycame up in a separate window and I want them to stay in the ipython notebook.
 
F

Frank Franklin

Ok, so just to add to this, there is no problem plotting when I used the following command in my terminal to start the notebook:
ipython notebook
The only problem is that this plots my figures outside of the notebook page, and I really want to get everything into the notebook, since that's the point of the install.

but for some reason when I add the --pylab=inline that all the tutorials mention I get the AttributeError I mentioned before. I'm starting to wonderif this is a problem with my machine setup, if I'm missing something else that ipython notebook needs to do inline plotting.

Any help on this would be appreciated -- at this point I'm banging my head against the wall and solution doesn't seem to have surfaced through googling.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top