我是gnuplot的新手。任何人都可以告诉我如何将我的模拟参数包含在图表右上角的框中?我希望参数框在图例下方可见,用于显示实际曲线。
我想只包含表格中的三个参数:
"GraphConnectivity: 0.2"
"Query: 0.2"
"Content: 0.2"
应该在图例正下方的框中可见。
答案 0 :(得分:3)
This page有一个很好的方法可以在一个盒子里放一个标签(在gnuplot 4.2 +中)。
要了解这对标签中的多行有何效果,请尝试将以下行复制并替换为链接中的示例:
#
# Illustrate using character widths to put a box around a label
#
# each line of the label gets a separate variable here
label1 = "Label in"
label2 = "a box"
label3 = "rocks"
LABEL = label1."\n".label2."\n".label3
# this bit finds the longest part of the multi-line string
# to determine the box width
longlabel = (strlen(label1) > strlen(label2)) ? label1 : label2
longlabel = (strlen(longlabel) > strlen(label3)) ? longlabel : label3
# change 'char 2' below to reflect the number of lines in the label.
# you will also have to adjust the y-position of the rectangle manually
set obj 10 rect at -3,(-4-0.4) size char strlen(longlabel), char 3
set obj 10 fillstyle empty border -1 front
set label 10 at -3,-4 LABEL front center
答案 1 :(得分:2)
要添加标签,您需要set label
...
e.g。
XVAL=???
YVAL=???
set label "GraphConnectivity: 0.2\nQuery: 0.2\nContent: 0.2" at screen XVAL,screen YVAL
你需要稍微玩一下XVAL和YVAL才能让标签显示在你想要的位置。
或者,您可以使用3个set label命令:
set label "GraphConnectivity: 0.2" at screen XVAL, screen YVAL
set label "Query: 0.2" at screen XVAL, screen YVAL offset character 0,-1
set label "Content: 0.2" at screen XVAL, screen YVAL offset character 0,-2
要在标签周围放置一个框,您可以使用没有头的箭头,或者您可以使用set object rectangle
命令