Skip to content

Invalid Display Variable #11140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dhope-lab opened this issue Apr 28, 2018 · 3 comments
Closed

Invalid Display Variable #11140

dhope-lab opened this issue Apr 28, 2018 · 3 comments

Comments

@dhope-lab
Copy link

I'm running on a CentOS ( release 7.4.1708 ) Linux environment that is on a Linux-based HPC. Python version 2.7.

I'm running a script to visualize TF-IDF values using the Isomap algorithm ( incorporating sci-kit learns) and then using a 3D scatterplot to visualize possible relationships between tfidf values of a corpus. This has already been preprocessed. This is my code:

def Isomap(tfidf):
  jon = pd.read_csv(tfidf)
  le = preprocessing.LabelEncoder()
  tims = jon.apply(le.fit_transform)
  iso = manifold.Isomap(n_neighbors=2, n_components=3)
  john = iso.fit_transform(tims)
  fig = plt.figure(1)
  colors = ['red', 'yellow', 'green']
  ax = fig.add_subplot(111, projection='3d')
  ax.scatter(john[:,0], john[:,1],john[:,2],color=colors,alpha=.5) # x,y,z coord. jon 1-3 
  plt.title('Isomap of candiates')
  plt.xlabel('x')
  plt.ylabel('y')
  plt.show()
  plt.savefig('isomap.png') 

However, the error code reads as so:

Traceback (most recent call last):
  File "MasterScript.py", line 157, in <module>
    Isomap('tfidf.txt')
  File "MasterScript.py", line 134, in Isomap
    fig = plt.figure(1)
  File "/util/common/python/anaconda-5.0.0/lib/python2.7/site-packages/matplotlib/pyplot.py", line 535, in figure
    **kwargs)
  File "/util/common/python/anaconda-5.0.0/lib/python2.7/site-packages/matplotlib/backends/backend_qt5agg.py", line 44, in new_figure_manager
    return new_figure_manager_given_figure(num, thisFig)
  File "/util/common/python/anaconda-5.0.0/lib/python2.7/site-packages/matplotlib/backends/backend_qt5agg.py", line 51, in new_figure_manager_given_figure
    canvas = FigureCanvasQTAgg(figure)
  File "/util/common/python/anaconda-5.0.0/lib/python2.7/site-packages/matplotlib/backends/backend_qt5agg.py", line 242, in __init__
    super(FigureCanvasQTAgg, self).__init__(figure=figure)
  File "/util/common/python/anaconda-5.0.0/lib/python2.7/site-packages/matplotlib/backends/backend_qt5agg.py", line 66, in __init__
    super(FigureCanvasQTAggBase, self).__init__(figure=figure)
  File "/util/common/python/anaconda-5.0.0/lib/python2.7/site-packages/matplotlib/backends/backend_qt5.py", line 236, in __init__
    _create_qApp()
  File "/util/common/python/anaconda-5.0.0/lib/python2.7/site-packages/matplotlib/backends/backend_qt5.py", line 144, in _create_qApp
    raise RuntimeError('Invalid DISPLAY variable')
RuntimeError: Invalid DISPLAY variable

I'm not exactly sure if it is a fault of matplotlib or my own handling of the library. Any help would be appreciated.

@jklymak
Copy link
Member

jklymak commented Apr 28, 2018

This is not a user-help forum; google is your friend for errors like this.

@jklymak jklymak closed this as completed Apr 28, 2018
@WeatherGod
Copy link
Member

WeatherGod commented Apr 28, 2018 via email

@tacaswell
Copy link
Member

Duplicated of #3466

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants