[Matplotlib-users] matplotlib interactive in a shell terminal?

Raphael Raccuia rafael.raccuia at blindekinder.com
Mon May 18 04:33:53 EDT 2020


Hi,
Any chance  to use matplotlib in a linux shell terminal?

if I make 'python3 my/script.py', it displays the plot but I have no 
prompt >>>.
It works in Idle.
That would be my test script:

#!/usr/bin/env python3 #otherwise loads a 'ghost': cursor turn to cross, 
but no window.

import matplotlib
print(matplotlib.get_backend()) #print TkAgg in the terminal

import matplotlib.pyplot as plt

plt.ion()


plt.plot([1, 2, 3, 4], [1, 4, 2, 3])

plt.show(block=True) #block=True: othewise it close immediately plot and 
terminal

thank you!

rph-r




More information about the Matplotlib-users mailing list