Skip to content
Sign upLog in
← Back to Community

Python Matplotlib

Profile icon
KramnikHacker

Hello,
I would like to know if it possible (or the feature will be added) to directly display graphs from matplotlib without having to save the figure.

For me it's a critical feature as I have to do quantitative analysis.

Thanks

Voters
Profile icon
Davijuinor
Profile icon
Kramnik
Comments
hotnewtop
Profile icon
Geocube101

Not sure if this is possible, but...

It may be possible to save the image and then open it in another python program (like Tkinter)
here is a code snippet for using an image in tkinter's window

My best guess would be to save the image and immediately open it in a python Tkinter window for displaying

Profile icon
Kramnik

@Geocube101
Unfortunately PIL / Pillow seems to be not available (can't install/import this library..).
ModuleNotFoundError: No module named 'Pillow'

Profile icon
Geocube101

@Kramnik
Try adding...

from os install system system('pip install Pillow')

...to the beginning of your code. It should install the "PIL" module

Profile icon
Kramnik

@Geocube101
Thanks. Well, Pillow seems to install but then nothing change :

Collecting Pillow
Downloading https://files.pythonhosted.org/packages/89/3e/31c2e5385d7588016c6f7ac552e81c3fff2bef4bc61b6f82f8177752405c/Pillow-6.2.1-cp37-cp37m-manylinux1_x86_64.whl (2.1MB)
100% |████████████████████████████████| 2.1MB 9.5MB/s
Installing collected packages: Pillow
Successfully installed Pillow-6.2.1
You are using pip version 19.0.3, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Traceback (most recent call last):
File "main.py", line 9, in
import Pillow
ModuleNotFoundError: No module named 'Pillow'

Profile icon
Geocube101

@Kramnik
"Pillow" is just the module name on PyPi. You still must import "PIL" sio change your import line from...

import Pillow

...to...

import PIL