mikeizbicki / cmc-csci046

CMC's Data Structures and Algorithms Course Materials
55 stars 155 forks source link

no display name/environment variables #538

Closed norawillett closed 1 year ago

norawillett commented 1 year ago

I'm having trouble with my visualize.py file. I have tried a simple bar chart like the one below, and I am getting an error.

import  matplotlib.pyplot as plt 
fig = plt.figure()
plt.bar(['a', 'b', 'c'], [1, 3, 2]) 
plt.show()

This is producing the error:

_tkinter.TclError: no display name and no $DISPLAY environment variable

I have tried logging out and reloading in using SSH username -X, however I am still getting the same error. Do you have any suggestions for creating the bar plot?

mikeizbicki commented 1 year ago

Copy/pasting that error message into google gives this stackoverflow question. The first answer there has a solution to your problem.