How to plot graph in Pythonanywhere bash console using python matplotlib without saving the graph as a file
Код: Выделить всё
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(range(100))
fig.savefig("graph.png")
Источник: https://stackoverflow.com/questions/781 ... where-bash