如何解决如何在不创建文件的情况下生成带有坐标的 gnuplot?
我想用一些坐标创建一个图表,然后将它们排列起来。 例如: 1; 3 / 2; 4 / 4; 5 但没有创建包含该信息的文件。我可以绘制坐标吗?
# To view in X:
# To print on a PostScript printer:
set terminal png
set output "graph.png"
set title "Teste Plot"
set xlabel "t"
set ylabel "nt batatas"
set xrange [0:10]
set yrange [0:10]
1,3
2,4
4,5
# Plot
plot "-" with linespoints
解决方法
检查 help inline
或 help special-filenames
...
好吧,文档似乎没有包含 plot "-"
的示例......也许隐藏在某个地方......
尝试以下操作:
代码:
reset session
set title "Teste Plot"
set xlabel "t"
set ylabel "nt batatas"
set xrange [0:10]
set yrange [0:10]
set datafile separator comma
# Plot
plot "-" with linespoints title "my inline data"
1,3
2,4
4,5
e
或(我更喜欢这种方式):
reset session
$Data <<EOD
1,5
EOD
set title "Teste Plot"
set xlabel "t"
set ylabel "nt batatas"
set xrange [0:10]
set yrange [0:10]
set datafile separator comma
# Plot
plot $Data u 1:2 with linespoints title "my inline data"
结果:
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。