Skip to content

Gnuplot process no longer responding when doing simple example gp.plot(x**2) #22

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
asanakoy opened this issue Nov 1, 2020 · 4 comments

Comments

@asanakoy
Copy link

asanakoy commented Nov 1, 2020

Python 3.7, running an example script in tmux through ssh.

import numpy      as np                    
import gnuplotlib as gp                                   
                                           
x = np.arange(101) - 50                    
gp.plot(x**2)                  

Aslo tried passing gp.plot(x**2, ascii=True) with no success.

Always get an error.

Traceback (most recent call last):
  File "test_ascii_plots1.py", line 6, in <module>
    gp.plot(x**2, ascii=True)
  File "/export/home/asanakoy/anaconda2/compgpu/envs/py3.7/lib/python3.7/site-packages/gnuplotlib.py", line 2654, in plot
    globalplot.plot(*curves)
  File "/export/home/asanakoy/anaconda2/compgpu/envs/py3.7/lib/python3.7/site-packages/gnuplotlib.py", line 2552, in plot
    plot_process_footer()
  File "/export/home/asanakoy/anaconda2/compgpu/envs/py3.7/lib/python3.7/site-packages/gnuplotlib.py", line 2385, in plot_process_footer
    self._checkpoint('printwarnings')
  File "/export/home/asanakoy/anaconda2/compgpu/envs/py3.7/lib/python3.7/site-packages/gnuplotlib.py", line 1720, in _checkpoint
    and/or gnuplot itself. Please report this as a gnuplotlib bug''')
gnuplotlib.GnuplotlibError: Gnuplot process no longer responding. This is likely a bug in gnuplotlib
and/or gnuplot itself. Please report this as a gnuplotlib bug
@dkogan
Copy link
Owner

dkogan commented Nov 1, 2020

I'm guessing this has something to do with your system or gnuplot install, but that error message is really not great here. Please try this:

Add hardcopy='/tmp/tst.gp' to the kwargs. The plot() function should then write to that file, and exit succesfully. This file is a gnuplot script. When you run it, you should get a plot, but I bet on your machine that won't happen. Can you let me know what does happen?

@dkogan
Copy link
Owner

dkogan commented Nov 1, 2020

Reading your email more closely, I maybe get a sense of what you're doing. Are you x-forwarding over ssh? Is it slow and/or broken? What if you run "xeyes"? Does it work?

@asanakoy
Copy link
Author

asanakoy commented Nov 1, 2020

It is not slow, and I don't do any X forwarding.
xeyes doesn't work obviously.

I didn't know that Gnuplot requires X to be enabled. I was hoping to be able to just print plots in a terminal without any GUI.

@dkogan
Copy link
Owner

dkogan commented Nov 2, 2020

Gnuplot has plenty of backends that don't require X, but by default it tries to produce an interactive, graphical plot, which does use X. You want the "dumb" terminal. Do this:

import numpy      as np
import gnuplotlib as gp

x = np.arange(101) - 50
gp.plot(x**2, terminal = 'dumb 80,40')

I would like to improve the error message, though. Can you please run "gnuplot" and then do "plot x"? It will presumably fail, but I'd like to know if it hangs or reports an error or what. And it you can tell me what "show terminal" says, that'd be super.

@dkogan dkogan closed this as completed Nov 4, 2020
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

2 participants