In a more detailed answer, you need to install xvfb first:
$ sudo apt-get install xvfb
And then, supposing a script like this that we save as mpl.py:
from matplotlib.pyplot import * plot([2,4,2,5,6,3,1]) savefig("graph.png")
We then run it:
$ xvfb-run python mpl.pyThere should be a file named graph.png that will look like:
All from the console.
No comments:
Post a Comment