如何在gnuplot中将整数转换为字符串? [英] How do I convert an integer to a string in gnuplot?
本文介绍了如何在gnuplot中将整数转换为字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在类似的示例中,我知道如何将$
与using
一起使用
I know how to use $
with using
in examples like
plot datafile using f($1):g($2)
绘制列数据的函数.但我想在循环中使用此功能:
to plot functions of column data. But I want to use this feature in a loop:
plot for [c=1:10] datafile using f($(c)):g($(c+1))
当然,此代码不起作用.我猜想,如果我知道如何将整数c
转换为字符串(或单个ASCII字符),那么它将起作用.我该怎么办?
Of course this code doesn't work. I guess that if I know how to convert the integer c
to a string (or a single ASCII character) then it would work. How can I do it?
(如果可以在不将整数转换为字符串的情况下完成相同的任务,那也可以.)
(If the same task can be done without conversion of integer to string, that would be fine too.)
推荐答案
您是否正在寻找类似的东西:
Are you looking for something like:
plot for [c=1:5] datafile using (column(c)):(column(c+1))
这将执行:plot datafile u 1:2, "" u 2:3, "" u 3:4, "" u 4:5, "" u 5:6
这篇关于如何在gnuplot中将整数转换为字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文