Using relative paths in gnuplot plot files

只谈情不闲聊 提交于 2019-12-05 11:29:49

Yes, you can specify relative paths in the gnuplot file:

set output '../path/to/outputs/output.eps'
plot '../path/to/csv/input.csv'

works fine. If you want to specify paths as arguments to the script, I recommend a bash wrapper:

#!/bin/bash

# argument 1 is path to input
# argument 2 is path to output

gnuplot << EOF
set terminal ...
set output '$2/output'

plot '$1/input1.csv', \
     '$1/input2.csv' ...
EOF

I've stumbled onto using loadpath to get data loaded relative to one's $HOME:

set loadpath system('readlink -f ~/.gnuplot.scripts')

Of course, this is for un*x systems.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!