2012-04-10 55 views
0

我是gnuplot的新手。任何人都可以告诉我如何将我的模拟参数包含在剧情右上角的一个框中?我希望参数框在用于显示实际曲线的图例下方可见。gnuplot:在右上角的框中包含模拟参数

我想只包括三个参数的形式为:

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

应在刚刚传说下方的盒子是可见的。

回答

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