0

is it possible to run matplotlib from text-only console? I am using matplotlib to generate few graphs and save it using fig.savefig(). So, basically, the graphs are genrated in the background and saved on the filesystem.

The error is

    self.fig1 = plt.figure(figsize=plt.figaspect(aspect_ratio))
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 535, in figure
    **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 81, in new_figure_manager
    return new_figure_manager_given_figure(num, figure)
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 89, in new_figure_manager_given_figure
    window = Tk.Tk()
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1818, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
infoclogged
  • 3,641
  • 5
  • 32
  • 53
  • 1
    Possible duplicate of [\_tkinter.TclError: no display name and no $DISPLAY environment variable](https://stackoverflow.com/questions/37604289/tkinter-tclerror-no-display-name-and-no-display-environment-variable) – Y. Luo Apr 29 '18 at 22:11
  • @Y.Luo - indeed.. thank you. Perhaps, I was using the keyword terminal instead of ssh, it didnt come up in search. – infoclogged Apr 30 '18 at 06:57
  • You are welcome! – Y. Luo Apr 30 '18 at 07:00

0 Answers0