2024-09-29 23:22:54 发布
网友
在GnuPlot中,我可以在plot命令中使用title columnhead选项自动设置绘图图例,例如:
title columnhead
plot 'test.txt' using 0:1 w linespoints title columnhead
所以它从CSV文件中读取列名并在图例中使用它。在
我想要同样的设置xlabel和ylabel。有可能吗?在
(另外,我还想知道如何在Python中实现这种功能。它比GnuPlot好吗?我应该学习Python吗?)在
正如@Christoph所指出的,system命令可能是唯一可行的解决方案-在您的特定情况下,您可以:
system
fname="test.txt" getTitle(colNum)=system(sprintf("head -n1 '%s' | cut -f%d -d';'", fname, colNum+1)) set xlabel getTitle(0) set ylabel getTitle(1)
正如@Christoph所指出的,
system
命令可能是唯一可行的解决方案-在您的特定情况下,您可以:相关问题 更多 >
编程相关推荐