Bla*_*iro 3 label key gnuplot legend
我想在读取文件中的数据时使用"Best F""Worst F"等关键标题作为gnuplot 4.4图表,但我无法弄清楚如何放置空间,例如:
Generation Best_F Worst_F Average_F
5 4 9 5
4 3 9 4
Run Code Online (Sandbox Code Playgroud)
我尝试在文件"Best F","Best%20F""Best\F"中写入,但是当它们作为列标题读取时它们会被拆分,或者我看到丑陋的"%20".
plot for[col=2:4] data.dat using 1:col title columnheader(col)
Run Code Online (Sandbox Code Playgroud)
或者有没有办法进行字符替换,比如"Best_F"%"" - >"Best F"?replace("_","\",columheader(col))?
我正在使用终端wxt和pngcairo(没有乳胶).谢谢
根据手册的Datastrings部分(这是旧版本,但不幸的是后来的版本尚未以HTML格式发布),数据文件中的字符串用双引号分隔.如果我将您的示例数据文件修改为这样,那么当我在gnuplot 4.6 patchlevel 1(启用了数据字符串)下运行时,我会获得带空格的标题.
Generation "Best F" "Worst F" "Average F"
5 4 9 5
4 3 9 4
Run Code Online (Sandbox Code Playgroud)
程序:
plot for[col=2:4] "data.txt" using 1:col title columnheader(col)
Run Code Online (Sandbox Code Playgroud)
输出摘录: