ImportError: No module named matplotlib.pyplot

You have two pythons installed on your machine, one is the standard python that comes with Mac OSX and the second is the one you installed with ports (this is the one that has matplotlib installed in its library, the one that comes with macosx does not). Is the standard mac python and since it … Read more

python – how to get the data from an plt.imshow()?

a should be a matplotlib.image.AxesImage instance, in which case you can use and The array is stored as a masked array. Example There’s an official example available at http://matplotlib.org/examples/animation/dynamic_image.html. Direct access You can also use to access the array data directly, though I imagine that the getters and setters are the preferred method.

Showing an image with pylab.imshow()

This is the problem, if you pass a 3D ndarray, it expects that you will have 3 or 4 planes (RGB or RGBA) (Read the code on line 410 in the last frame of the stack trace). You just need to get rid of the extra dimension using or To see what squeeze is doing, see the following … Read more

Purpose of “%matplotlib inline”

%matplotlib is a magic function in IPython. I’ll quote the relevant documentation here for you to read for convenience: IPython has a set of predefined ‘magic functions’ that you can call with a command line style syntax. There are two kinds of magics, line-oriented and cell-oriented. Line magics are prefixed with the % character and work much like … Read more

Purpose of “%matplotlib inline”

%matplotlib is a magic function in IPython. I’ll quote the relevant documentation here for you to read for convenience: IPython has a set of predefined ‘magic functions’ that you can call with a command line style syntax. There are two kinds of magics, line-oriented and cell-oriented. Line magics are prefixed with the % character and work much like … Read more

ImportError: DLL load failed: The specified module could not be found

(I found this answer from a video: http://www.youtube.com/watch?v=xmvRF7koJ5E) Download msvcp71.dll and msvcr71.dll from the web. Save them to your C:\Windows\System32 folder. Save them to your C:\Windows\SysWOW64 folder as well (if you have a 64-bit operating system). Now try running your code file in Python and it will load the graph in couple of seconds.

ImportError: DLL load failed: The specified module could not be found

(I found this answer from a video: http://www.youtube.com/watch?v=xmvRF7koJ5E) Download msvcp71.dll and msvcr71.dll from the web. Save them to your C:\Windows\System32 folder. Save them to your C:\Windows\SysWOW64 folder as well (if you have a 64-bit operating system). Now try running your code file in Python and it will load the graph in couple of seconds.