0

when writing long command lines in gnuplot 5.4 - e.g., plotting several sets of data in one graph - it would be useful if I could jump to specific sections of the command line to edit using my mouse, at the moment I can only do that using the arrow keys, which takes quite a while. Does anyone have any advice on whether its possible to do that using the mouse? Cheers.

2
  • I don't know about using the mouse, but if your gnuplot is built with readline support then you should be able to use M-b and M-f (where M might be the Alt or Option key) to move the cursor backwards/forwards by whole words, which is much faster than with the arrow keys.
    – user8153
    Mar 16, 2022 at 22:11
  • @user8153 Alternatively, Ctrl + left/right arrow keys do the same thing and are, at least for me, more intuitive than meta + b or meta + f.
    – Eldrad
    Mar 17, 2022 at 8:38

1 Answer 1

0

I understand that you are using the gnuplot console to type your gnuplot commands to create your graph and you have lengthy commands which you might eventually need to edit.

Why don't you:

  • use the text editor of your choice
  • type your commands there (ideally start with reset session to have default settings)
  • save it as file, e.g. as myScript.gp
  • in gnuplot console, type load 'myScript.gp' and your script will start
  • if you need to edit anything, go to the text editor and flexibly navigate with the mouse, arrows, and scroll buttons as you like and save it again.
  • in gnuplot console use the arrow-up key to get back to the command load 'myScript.gp' and press <Enter>. In case you have used many other commands in the meantime, you could also type hist and you will get the history of commands. Type, e.g. hist!197 if 197 is the number of the command you want to re-execute. Check help history.
  • repeat editing your script until you are satisfied with the plot result.

I would say that this is more convenient than recalling and editing long lines in the gnuplot console.

1
  • Good advice, I'd like to add another point: Use abbreviations, like a="/long/path/to/my/file"; plot a to make the plot command shorter.
    – Eldrad
    Mar 17, 2022 at 8:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.