gnuplot 绘制标签时出错
我想绘制这个数据文件
“/root/temp.txt”
LB|30|421
CN|50|247
BR|20|370
SA|12|310
,其中第一列是 X 轴,第二列是 Y 轴,第三列是放置在直方图每列上方的标签。
在此之前,我使用此语法来绘制图形(但没有任何标签)
set terminal png ;
set title "Hello" ;
set xlabel "Country" ;
set ylabel "values" ;
set style fill solid ;
set xtic rotate -45 ;
set datafile separator "|" ;
set style data histograms ;
plot '/root/temp.txt' using 2:xtic(1) notitle
但是如果我尝试添加标签 gnuplot 会给我错误!
我用来添加标签的语法是 使用 2:xtic(1):3 和标签 notitle 绘制 '/root/temp.txt'
你能帮我吗? 谢谢
I would like to plot this datafile
"/root/temp.txt"
LB|30|421
CN|50|247
BR|20|370
SA|12|310
Where the first column is the X Axis, the second one is the Y Axis and the third one the label to put above each column of the histogram.
Before now, I use this syntax to plot the graph (but without any label)
set terminal png ;
set title "Hello" ;
set xlabel "Country" ;
set ylabel "values" ;
set style fill solid ;
set xtic rotate -45 ;
set datafile separator "|" ;
set style data histograms ;
plot '/root/temp.txt' using 2:xtic(1) notitle
But if I try to add labels gnu plot give me error!!
The syntax I use to add labels is
plot '/root/temp.txt' using 2:xtic(1):3 with labels notitle
Could you please help me?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定您是否可以压缩为一种绘图格式,但您可以使用
replot
(或类似 replot 的绘图):空“”导致重用最后一个输入(文件)。现在,它等于 '/root/temp.txt'
更好一点:
哦!并且不要忘记
设置 png 术语的输出
!I am not sure that you can compress into one plotting format, but you can use
replot
(or replot-like plot):Empty '' induce reuse the last input(file). Now, it equals with '/root/temp.txt'
To be nicer:
Oh! And don't forget to
set output
of png term!