Skip to content

Make visualize subcommand compatible with jupyter notebook #10

@sean-la

Description

@sean-la

Running the PATHOGIST visualize in a jupyter notebook with a BASH kernel doesn't work.
We get the following error:

07:48:03 AM (3427 ms) -> INFO:Visualing clusterings...
Traceback (most recent call last):
  File "/home/klw17/dev/PathOGiST/PATHOGIST", line 319, in <module>
    main()
  File "/home/klw17/dev/PathOGiST/PATHOGIST", line 316, in main
    visualize(param)
  File "/home/klw17/dev/PathOGiST/PATHOGIST", line 227, in visualize
    pathogist.visualize.visualize_clusterings(summary_clustering)
  File "/home/klw17/dev/PathOGiST/pathogist/visualize.py", line 111, in visualize_clusterings
    ax = plt.subplot(num_rows,num_cols,subplot_index)
  File "/home/klw17/anaconda3/envs/pathogist2/lib/python3.5/site-packages/matplotlib/pyplot.py", line 1071, in subplot
    fig = gcf()
  File "/home/klw17/anaconda3/envs/pathogist2/lib/python3.5/site-packages/matplotlib/pyplot.py", line 601, in gcf
    return figure()
  File "/home/klw17/anaconda3/envs/pathogist2/lib/python3.5/site-packages/matplotlib/pyplot.py", line 548, in figure
    **kwargs)
  File "/home/klw17/anaconda3/envs/pathogist2/lib/python3.5/site-packages/matplotlib/backend_bases.py", line 161, in new_figure_manager
    return cls.new_figure_manager_given_figure(num, fig)
  File "/home/klw17/anaconda3/envs/pathogist2/lib/python3.5/site-packages/matplotlib/backends/_backend_tk.py", line 1044, in new_figure_manager_given_figure
    window = Tk.Tk(className="matplotlib")
  File "/home/klw17/anaconda3/envs/pathogist2/lib/python3.5/tkinter/__init__.py", line 1876, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
(pathogist2) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions