I encountered a strange problem when trying to use gnuplot from another program (piping commands into it with popen() and fprintf()). If I zoom using the mouse, the last issued 'plot' command gets garbled, as if a 'set' string was overlayed on it (see output below). This happens on Linux (Debian wheezy and Ubuntu 12.04, both 64-bit editions) with gnuplot versions 4.6 and 4.7 (in the case of 4.6, both the version in the Debian repository and the one I compile from source), with both the 'wxt' and 'x11' terminals. Version 4.4 (the one in the Ubuntu 12.04 repository) seems to work fine. Invoking gnuplot normally (i.e. 'interactive mode') also works fine. Steps to reproduce (I have attached the 'h2dt1k' datafile; other data produces similar results):
1. Start gnuplot with its input coming through a pipe (e.g. on Linux, use something like 'cat | gnuplot')
2. plot something on an interactive terminal ('wxt' or 'x11'
3. zoom in on the resulting plot using the mouse
4. gnuplot displays an error, complaining about that it cannot parse the commands given to it; it displays the last command overlayed on some commands which look like the commands that could be used to set the axis ranges (my guess is that a null-terminator is missing after the plot command)
dani@dani-desktop ~/t/p/pcapi> cat | gnuplot
#here I zoom in on some parts of the plot; the next line is the output of gnuplot:
gnuplot> p "h2dt1k"09327068002:0.737015692881]; set yr[0.561381452448:0.996228368585]; set x2r[ 0.381947: 0.670237]; set y2r[ 0.507635: 0.840450]
line 0: warning: integer overflow; changing to floating point
Log in to post a comment.