关闭gnuplot直方图中的精选标题
我想在直方图中绘制数据,其中有两种方法与每个实验的2种不同的实验和各种设置进行了比较。在不同的方法 /实验中,设置是相同的。以下是我这样做的脚本,这是找到的示例的变体>。
reset
clear
set border 3 front lt black linewidth 1.000 dashtype solid
set boxwidth 0.95 absolute
set style fill solid 1.00
set grid noxtics nomxtics ytics nomytics noztics nomztics nortics nomrtics \
nox2tics nomx2tics noy2tics nomy2tics nocbtics nomcbtics
set style histogram clustered gap 1 title textcolor lt -1 offset character 2, 0.25
set style data histograms
set xtics border in scale 0,0 nomirror rotate by -45 autojustify
set xtics norangelimit font ",8"
set xtics ()
set ytics border in scale 0,0 mirror norotate autojustify
set ytics norangelimit autofreq font ",8"
set xlabel offset character 0, -2, 0 font "" textcolor lt -1 norotate
set xrange [ * : * ] noreverse writeback
set ylabel "Percent Success"
set yrange [ 0 : 100 ] noreverse writeback
plot newhistogram "Approach 1", 'aprch1.dat' using "Setting A":xtic(1) t col lc 1 fs pattern 1, '' u "Setting B" t col lc 2 fs pattern 5, '' u "Setting C" t col lc 3 fs pattern 7, newhistogram "Approach 2", 'aprch2.dat' using "Setting A":xtic(1) t col lc 1 fs pattern 1, '' u "Setting B" t col lc 2 fs pattern 5, '' u "Setting C" t col lc 3 fs pattern 7
这是 aprch1.dat 的样子。 aprch2.dat 是相似的。
Title "Setting A" "Setting B" "Setting C"
"Experiment 1 " 84.32451898 73.54666118 79.07579357
"Experiment 2 " 84.25763967 45.88435024 42.17414819
这是结果图:
但是,传说是多余的。如何删除传奇中的重复项?
我尝试使用NotiTle
和设置键NoAutotitle
,如标题“>这个问题,但我遇到了讨厌的错误,而不是所需的结果。我会承认,我不完全理解脚本中的所有命令。我是设置不允许我使用NotiTle
的东西还是有更好的方法来获得所需的结果?
I want to plot data in a histogram where there are two approaches being compared with 2 different experiments and various settings for each experiment. The settings are the same across different approaches / experiments. Below is my script for doing this, which is a variation of the example found here.
reset
clear
set border 3 front lt black linewidth 1.000 dashtype solid
set boxwidth 0.95 absolute
set style fill solid 1.00
set grid noxtics nomxtics ytics nomytics noztics nomztics nortics nomrtics \
nox2tics nomx2tics noy2tics nomy2tics nocbtics nomcbtics
set style histogram clustered gap 1 title textcolor lt -1 offset character 2, 0.25
set style data histograms
set xtics border in scale 0,0 nomirror rotate by -45 autojustify
set xtics norangelimit font ",8"
set xtics ()
set ytics border in scale 0,0 mirror norotate autojustify
set ytics norangelimit autofreq font ",8"
set xlabel offset character 0, -2, 0 font "" textcolor lt -1 norotate
set xrange [ * : * ] noreverse writeback
set ylabel "Percent Success"
set yrange [ 0 : 100 ] noreverse writeback
plot newhistogram "Approach 1", 'aprch1.dat' using "Setting A":xtic(1) t col lc 1 fs pattern 1, '' u "Setting B" t col lc 2 fs pattern 5, '' u "Setting C" t col lc 3 fs pattern 7, newhistogram "Approach 2", 'aprch2.dat' using "Setting A":xtic(1) t col lc 1 fs pattern 1, '' u "Setting B" t col lc 2 fs pattern 5, '' u "Setting C" t col lc 3 fs pattern 7
Here is what aprch1.dat looks like. aprch2.dat is similar.
Title "Setting A" "Setting B" "Setting C"
"Experiment 1 " 84.32451898 73.54666118 79.07579357
"Experiment 2 " 84.25763967 45.88435024 42.17414819
Here is the resulting graph:
However, the legend is redundant. How do I remove the duplicates in the legend?
I have tried using notitle
and set key noautotitle
, as described in this question, but I'm getting nasty errors and not the desired result. I will admit that I do not totally understand all of the commands in the script. Am I setting something that doesn't allow me to use notitle
or is there a better approach to get the desired result?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该使用
NotiTle
仅在plot
命令的第二部分中使用:You should use
notitle
only int the second part of theplot
command: