0

我是 gnuplot 的新手。谁能告诉我如何将我的模拟参数包含在绘图右上角的框中?我希望参数框在用于显示实际曲线的图例下方可见。

我只想包含表单的三个参数:

"GraphConnectivity: 0.2"
"Query: 0.2"
"Content: 0.2"

这应该在图例下方的框中可见。

4

2 回答 2

3

这个页面有一个很好的方式在一个盒子里放置一个标签(在 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
于 2012-04-11T03:14:10.733 回答
2

要添加标签,您需要set label...

例如

XVAL=???
YVAL=???
set label "GraphConnectivity: 0.2\nQuery: 0.2\nContent: 0.2" at screen XVAL,screen YVAL

您需要稍微使用 XVAL 和 YVAL 才能让标签显示在您想要的位置。

或者,您可以使用 3 个设置标签命令:

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命令

于 2012-04-11T01:31:50.307 回答