Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Matplotlib imshow in Pycharm Ipython not always displaying image

I'm using Pycharm IDE for Ipython and like it a lot. However, recently I'm having trouble with the matplotlib pyplot imshow function. Sometimes it works properly and displays an image but other times it just hangs (the cell is not executed, its labeled by the asterisk). You can execute additional cells after this with the image never being displayed. Im on OS X mavericks, using pycharm 5, latest ipython and matplotlib versions, enthought canopy python 2.7.. anyone experiencing something similar and worked out a solution?

like image 426
mistakeNot Avatar asked Jan 22 '16 22:01

mistakeNot


People also ask

How do I display an image in PyCharm?

Specify how you want images to be shown in PyCharm. Optionally, specify an external editor for working with images. Use this area to specify the settings according to which images should be displayed in PyCharm. Select this checkbox to have a grid displayed when reviewing image files.

Does Imshow normalize image?

By default, imshow normalizes the data to its min and max. You can control this with either the vmin and vmax arguments or with the norm argument (if you want a non-linear scaling).

How do I get matplotlib to work with PyCharm?

Click the Python Interpreter tab within your project tab. Click the small + symbol to add a new library to the project. Now type in the library to be installed, in your example "matplotlib" without quotes, and click Install Package . Wait for the installation to terminate and close all popup windows.


1 Answers

The code might be helpful:

import matplotlib.pyplot as plt
plt.imshow(im)
plt.show()
like image 130
zheng Avatar answered Sep 28 '22 08:09

zheng