Search code examples
gnuplotusability

When writing long lines of commands in gnuplot using the mouse to jump to sections does not work. Any advice please?


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.


Solution

  • 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.