Gnuplot 使用'绘制多列-';

Gnuplot 使用'绘制多列-';,gnuplot,Gnuplot,我试图找出如何使以下代码工作,而不必多次打印数据(并用“e”分隔副本): 上面的代码生成错误消息: warning: Skipping data file with no valid points 我知道,我可以将数据写入文件并多次调用plot'file'。有没有办法避免这种情况?谢谢 没有(好的)方法可以做到这一点。这里有一个相当丑陋的黑客: s = "-1 0.000679244 0.000246399\n-0.99875 0.000687629 0.000251162\n-0.9975

我试图找出如何使以下代码工作,而不必多次打印数据(并用“e”分隔副本):

上面的代码生成错误消息:

warning: Skipping data file with no valid points
我知道,我可以将数据写入文件并多次调用
plot'file'
。有没有办法避免这种情况?谢谢

没有(好的)方法可以做到这一点。这里有一个相当丑陋的黑客:

s = "-1 0.000679244 0.000246399\n-0.99875 0.000687629 0.000251162\n-0.9975 0.000696107 0.000256024\n-0.99625 0.000704678 0.000260987\n-0.995 0.000713343 0.000266052\n-0.99375 0.000722103 0.000271221\n-0.9925  0.00073096 0.000276496\n-0.99125 0.000739913 0.000281879\n-0.99 0.000748965 0.000287372"

plot sprintf('<echo "%s"',s) using 1:2, sprintf('<echo "%s"',s) using 1:3
s=“-1 0.000679244 0.000246399\n-0.99875 0.000687629 0.000251126\n-0.9975 0.000696107 0.000256024\n-0.99625 0.000704678 0.000260987\n-0.995 0.000713343 0.000266052\n-0.99375 0.000722103 0.000271221\n-0.9925 0.0007300.000276496\n-0.99125 0.000739913 0.00028749\n-1870.730”

plot sprintf(',因为版本5.0 gnuplot支持数据块,这允许您更好地处理内联数据:

$data <<EOD
-1 0.000679244 0.000246399
-0.99875 0.000687629 0.000251162
-0.9975 0.000696107 0.000256024
EOD
plot $data u 1:2, '' u 1:3

$data这确实不是很漂亮,但很有效!感谢您提供的见解!
inline_file ="\
-1 0.000679244 0.000246399\n \
-0.99875 0.000687629 0.000251162\n \
-0.9975 0.000696107 0.000256024\n \
-0.99625 0.000704678 0.000260987\n \
-0.995 0.000713343 0.000266052\n \
-0.99375 0.000722103 0.000271221\n \
-0.9925  0.00073096 0.000276496\n \
-0.99125 0.000739913 0.000281879\n \
-0.99 0.000748965 0.000287372"

plot sprintf('<echo "%s"',inline_file) using 1:2, \
     sprintf('<echo "%s"',inline_file) using 1:3
$data <<EOD
-1 0.000679244 0.000246399
-0.99875 0.000687629 0.000251162
-0.9975 0.000696107 0.000256024
EOD
plot $data u 1:2, '' u 1:3