oktapodi
oktapodi

Reputation: 755

Unable to plot graphs in iPython notebook, OSX 10.6

i am trying to get inline graphs working in iPython notebook.. i begin by starting ipython with the command ipython notebook --pylab inline.

when i try to use the plot() function i get the following error

enter image description here

im running on OSX 10.6.8 and running ipython out of a virtualenv i have matplotlib and libpng installed

i also get this warning in the terminal

libpng warning: Application built with libpng-1.2.41 but running with 1.5.13

and plot() works normally when i use ipython in the terminal only when i use ipython notebook i get this error.. can someone help me with this..?

Upvotes: 1

Views: 1336

Answers (4)

Oleksandr
Oleksandr

Reputation: 676

Since it was complaining that the versions of libpng used for building and for running are different, I have reinstalled the matplotlib by forcing the path to includes.

CFLAGS="`libpng-config --cflags`" pip install matplotlib -I

Upvotes: 0

khstacking
khstacking

Reputation: 637

I had this problem as well. Another solution is to change the format which the notebook will render images in, from 'png' to 'svg'. This can be done in your config file. Mine is located at:

~/.ipython/profile_default/ipython_notebook_config.py

There is a line that looks like this

# c.InlineBackend.figure_format = 'png'

Uncommenting and changing to 'svg' did the trick for me:

c.InlineBackend.figure_format = 'svg'

Upvotes: 1

oktapodi
oktapodi

Reputation: 755

so i finally got this working.. first off i had to get all my outdated ports updated first i did port selfupdate then sudo port update outdated

after that i reinstalled ipython using mac ports sudo port install py27-ipython then i had to install tornado and pyzmq respectively as ipython depends on it sudo port install py27-tornado sudo port install py27-zmq

and then ran it from the terminal

ipython notebook --pylab inline

everything works fine now i can plot maps inline in ipython! i guess the reason it didnt work before was some problems with pip maybe its installing matplotlib that is build only for libpng 1.2.41 ??... so anyways if anyone else faces this problem id suggest reinstalling all the libraries and ipython via mac ports thats the only thing that worked for me.

Upvotes: 0

nom-mon-ir
nom-mon-ir

Reputation: 3918

This recent question on this board is similar to yours: matplotlib and libpng issues with ipython notebook

See if the solution there solves your issue.

Upvotes: 0

Related Questions