Closed birktj closed 4 years ago
I tried this out here and there and my conclusion is that it's not quite true universally. Some terminals definitely support interactivity without pause mouse close
. I wanted to add it by default, but it breaks two features:
There's probably a way to get it working (perhaps as an option?), but for now I'll not add this in.
To make your life easier, however, I added a method on Figure
struct: set_post_commands
, so you can do:
fig.set_post_commands("pause mouse close");
fig.show();
That's perfectly fine. Thank you for looking into it and with the new method this almost becomes a non-issue.
Hi there,
I've tried your workaround as I'm facing the same issue but get this error message:
gnuplot> pause mouse clone
^
line 0: expecting string
Am I missing something? I'm using gnuplot 5.0 and version 0.0.30 of the crate.
thanks!
I think that your problem is that it should be pause mouse close
, not pause mouse clone
Oh indeed, no idea how I screwed that, thanks! :)
I no longer get the error but controls from the gnuplot_qt
window are still not working.
Controls stall working if gnuplot is closed. Try adding loop{}
to the end of the scop which calls fig.show()
.
Doesn't seem to help, controls are still not working.
Hmm, I can't seem to reproduce this. I added fg.set_post_commands("pause mouse close");
and with the qt
terminal, I could toggle the grid without issue. I'm using gnuplot 5.2 patchlevel 8
.
Strange, I'm using the same gnuplot version.
Could you please provide the test case you are using (or even add it as an examples to the repo) so we are sure to try running the same code?
With 52016af471eb77087665379fc367ec213a68f481, calling show
issues pause mouse close
internally, so by default the plots remain interactive. You can test this out with most of the examples, e.g. cargo run --example lines_points_3d
When using
fg.show()
a nice gnuplot window pops up and everything is good until I try to zoom or move around or in any way interact with the window. As far as I understand this is normal behavior when using the-p
gnuplot parameter.I think it would be better to use
pause mouse close
as the last command instead of-p
. This command keeps the gnuplot process running until the window is closed and is probably better than-p
since the window becomes interactive.Currently I am using this workaround, but if you agree I think this would be a nice addition to the library.