我在gnuplot中使用以下行来绘制rdf.xvg文件中的4个图形
plot for [n=2:5] "rdf.xvg" u 1:n ti 'graph'.n.' wL=0.25'
问题出在标题上。我要每个图的标题说
"graph LL wL=0.25"
"graph RR wL=0.25"
"graph LR wL=0.25"
"graph To wL=0.25"
我认为解决方案是使用if语句将n变量与LL,RR,LR,To连接起来
如果n = 2,则ti'graph LL wL = 0.25'等
是否可以?
只需定义一个包含不同单词的字符串即可。您可以使用word
函数访问它们(第一个单词是带有的索引1
):
labels = "LL RR LR To"
plot for [n=2:5] "rdf.xvg" u 1:n ti 'graph '.word(labels, n-1).' wL=0.25'
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句