Gnuplot Doesn't Work Through Ssh Command

gnuplot doesn't work through ssh command

That means, that your self-compiled gnuplot probably isn't found when you log-in with ssh. Type which gnuplot in both cases to see which binary is used.

Usually when using ssh you get a non-interactive shell, which sources different configuration files and has different environmental variables than a login shell, see e.g. Why does an SSH remote command get fewer environment variables then when run manually?.

So you can either change the respective configuration files (which ones are used, depends on your distribution), or you can use the full path to the gnuplot binary.

Gnuplot using shell command to set yrange

Could it be possible that you are using the wrong quotes?

gnuplot> n = `echo 2`
gnuplot> print n
2

Applied to you specific case, and after some refactoring:

pres_max = `awk '/average\(inlet\) of p/{p=$9} END{print p}' log.xy`
pres_min = pres_max - 10
set yrange [pres_min:pres_max]

See section "Substitution and Command line macros" of the gnuplot manual

gnuplot and Shell script read many files and create graphs

One of the arguments passed to the "plot" command has a trailing space following it. It's possible that this is being interpreted as part of the filename. Remove the trailing space and see if the behavior improves.

You use the construct "$PlotInputLoc/$PlotInputName-$i.$PNext" many times. You may find it less error-prone (and more readable) to store this as a variable instead of copy/pasting the same thing over and over.

Also, your code that increments the i variable is inside the script that gets passed to gnuplot. The bash variable i in never being updated, so you'll loop continuously. Try swapping your EOF and i=$(( $i + 1 )) lines.



Related Topics



Leave a reply



Submit