您的位置:首页 > 其它

设置图列(key/legend)的位置和大小 --gnuplot

2017-11-18 14:00 1226 查看
先看几个例子:

//不显示图例。
unset key
//设置图例 显示在图形(内)的顶部居中,并且多个图例水平显示。
set key top horizontal center
//设置图例 显示在图形(外)的顶部居中,并且多个图例水平显示。
set key top outside horizontal center
//设置图例 显示的字体并加粗。
set key font "Times,18,Bold"
//调整图例行间隔
set key spacing 3
//调整图例中线段示例长度
set key samplen 2


set key 的语法规则

Syntax:
set key {on|off} {default}
{{inside | outside} | {lmargin | rmargin | tmargin | bmargin}
| {at <position>}}
{left | right | center} {top | bottom | center}
{vertical | horizontal} {Left | Right}
{{no}reverse} {{no}invert}
{samplen <sample_length>} {spacing <vertical_spacing>}
{width <width_increment>}
{height <height_increment>}
{{no}autotitle {columnheader}}
{title "<text>"} {{no}enhanced}
{{no}box { {linestyle | ls <line_style>}
| {linetype | lt <line_type>}
{linewidth | lw <line_width>}}}
unset key
show key


Elements within the key are stacked according to vertical or horizontal. In the case of vertical, the key occupies as few columns as possible. That is, elements are aligned in a column until running out of vertical space at which point a new column is started. In the case of horizontal, the key occupies as few rows as possible.

图例是依据我们设置的水平显示或垂直显示进行堆叠式地显示。对于垂直显示,pnuplot会占用尽可能少的行来放置我们的图例,当图例在一行显示不下时,它会另启一行来显示。对于水平显示方式,pnuplot会占用尽可能少的列来放置我们的图例,当图例在一列显示不下时,它会另启一列来放置。

The vertical spacing between lines is controlled by spacing. The spacing is set equal to the product of the pointsize, the vertical tic size, and vertical_spacing. The program will guarantee that the vertical spacing is no smaller than the character height.

The defaults for set key are on, right, top, vertical, Right, noreverse, noinvert, samplen 4, spacing 1.25, title “”, and nobox.

References:

set key

adjust size of key/legend

gnuplot 修改标注位置
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  gnuplot key legend