|
From: Daniel J S. <dan...@ie...> - 2005-07-06 16:39:12
|
Hans-Bernhard Broeker wrote:
> Daniel J Sebald wrote:
>
>> gnuplot> set key right outside top right
>> ^
>> warning: Multiple horizontal position settings
>>
>> where the second occurrence of the horizontal position overrides the
>> first occurrence? This would be setting a precedent perhaps for
>> multiple specs for all commands?
>
>
> Actually I think we already have some precedence for repeated options.
> See set.c:set_label(), and all the TBOOLEAN flags like set_position are
> handled: repetition of "strong" options is treated as an error:
>
> gnuplot> set label 'text' at 1,2 at 3,4
> ^
> extraneous or contradicting arguments in label options
>
> The difference in your current "set key" is that some options' effects
> are "weak", i.e. they only set a default for some other choice, which is
> expressly allowed to be overwritten by an explicit specification.
Yes, but there are a large number where an obvious conflict is present. How about creating a special error for this? Something that might be called as:
int_conflict_error(c_token, "label");
int_conflict_error(c_token, "key");
Dan
PS: I forgot the revamped key documentation:
[...]
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
Plots may be drawn with no visible key by requesting `set key off` or
`unset 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.
By default the key is placed in the upper right inside corner of the graph.
The keywords `left`, `right`, `top`, `bottom`, `center`, `inside`, `outside`,
`lmargin`, `rmargin`, `tmargin`, `bmargin` (, `above`, `over`, `below` and
`under`) may be used to automatically place the key in other positions of the
graph. Also an `at <position>` may be given to indicate precisely where the
plot should be placed. In this case, the keywords `left`, `right`, `center`,
`bottom` and `center` serve an analogous purpose for alignment.
To understand positioning, the best concept is to think of a region, i.e.,
inside/outside, or one of the margins. Along with the region, keywords
`left/center/right` (l/c/r) and `top/center/bottom` (t/c/b) control where
within the particular region the key should be placed.
When in `inside` mode, the keywords `left` (l), `right` (r), `top` (t),
`bottom` (b), and `center` (c) push the key out toward the plot boundary as
illustrated:
t/l t/c t/r
c/l c c/r
b/l b/c b/r
When in `outside` mode, automatic placement is similar to the above
illustration, but with respect to the view, rather than the graph boundary.
That is, a border is moved inward to make room for the key outside of
the plotting area, although this may interfere with other labels and may
cause an error on some devices. The particular plot border that is moved
depends upon the position described above and the stacking direction. For
options centered in one of the dimensions, there is no ambiguity about which
border to move. For the corners, when the stack direction is `vertical`, the
left or right border is moved inward appropriately. When the stack direction
is `horizontal`, the top or bottom border is moved inward appropriately.
The margin syntax allows automatic placement of key regardless of stack
direction. When one of the margins `lmargin` (lm), `rmargin` (rm),
`tmargin` (tm), and `bmargin` (bm) is combined with a single, non-conflicting
direction keyword, the following illustrated positions may contain the key:
l/tm c/tm r/tm
t/lm t/rm
c/lm c/rm
b/lm b/rm
l/bm c/bm r/bm
Keywords `above` and `over` are synonymous with `tmargin`. For version
compatibility, `above` or `over` without an additional l/c/r or stack direction
keyword uses `center` and `horizontal`. Keywords `below` and `under` are
synonymous with `bmargin`. For compatibility, `below` or `under` without an
additional l/c/r or stack direction keyword uses `center` and `horizontal`. A
further compatibility issue is that `outside` appearing without an additional
t/b/c or stack direction keyword uses `top`, `right` and `vertical` (i.e., the
same as t/rm above).
The <position> can be a simple x,y,z as in previous versions, but these can
be preceded by one of five keywords (`first`, `second`, `graph`, `screen`,
`character`) which selects the coordinate system in which the position of
the first sample line is specified. See `coordinates` for more details.
The effect of `left`, `right`, `top`, `bottom`, and `center` when <position>
is given is to align the key as though it were text positioned using the
label command, i.e., `left` means left align with key to the right of
<position>, etc.
[...]
|