Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 591c941c2fdf0a32dc57bb5f10791cde > files > 325

gnuplot-doc-4.4.0-5.fc14.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<!--Converted with LaTeX2HTML 2008 (1.71)
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>Key</TITLE>
<META NAME="description" CONTENT="Key">
<META NAME="keywords" CONTENT="gnuplot">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="gnuplot.css">

<LINK REL="next" HREF="node219.html">
<LINK REL="previous" HREF="node215.html">
<LINK REL="up" HREF="node175.html">
<LINK REL="next" HREF="node217.html">
</HEAD>

<BODY >
<!--Navigation Panel-->
<A NAME="tex2html4322"
  HREF="node217.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html4316"
  HREF="node175.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html4310"
  HREF="node215.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html4318"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html4320"
  HREF="node467.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html4323"
  HREF="node217.html">Key placement</A>
<B> Up:</B> <A NAME="tex2html4317"
  HREF="node175.html">Set-show</A>
<B> Previous:</B> <A NAME="tex2html4311"
  HREF="node215.html">Isosamples</A>
 &nbsp; <B>  <A NAME="tex2html4319"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html4321"
  HREF="node467.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->

<H2><A NAME="SECTION0402430000000000000000"></A>
<A NAME="commands_set_key"></A><A NAME="commands_unset_key"></A><A NAME="commands_show_key"></A><A NAME="set_key"></A><A NAME="unset_key"></A><A NAME="show_key"></A><A NAME="key"></A><A NAME="4897"></A>
<A NAME="nokey"></A><A NAME="4899"></A>
<A NAME="legend"></A><A NAME="4901"></A>
<BR>
Key
</H2>
The <B>set key</B> command enables a key (or legend) describing plots on a plot.

<P>
The contents of the key, i.e., the names given to each plotted data set and
function and samples of the lines and/or symbols used to represent them, are
determined by the <B>title</B> and <B>with</B> options of the {<B>s</B>}<B>plot</B> command.
Please see <B>plot title (p.&nbsp;<A HREF="node164.html#plot_title"><IMG  ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)<A NAME="4908"></A></B> and <B>plot with (p.&nbsp;<A HREF="node165.html#plot_with"><IMG  ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)<A NAME="4910"></A></B> for more information.

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

<P>
The key contains a title and a sample (line, point, box) for each plot
in the graph. The key may be turned off by requesting <B>set key off</B> or
<B>unset key</B>.  Individual key entries may be turned off by using the
<B>notitle</B> keyword in the corresponding plot command.

<P>
Elements within the key are stacked according to <B>vertical</B> or <B>horizontal</B>.
In the case of <B>vertical</B>, 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 <B>horizontal</B>, the key
occupies as few rows as possible.

<P>
By default the key is placed in the upper right inside corner of the graph.
The keywords <B>left</B>, <B>right</B>, <B>top</B>, <B>bottom</B>, <B>center</B>, <B>inside</B>, <B>outside</B>,
<B>lmargin</B>, <B>rmargin</B>, <B>tmargin</B>, <B>bmargin</B> (, <B>above</B>, <B>over</B>, <B>below</B> and
<B>under</B>) may be used to automatically place the key in other positions of the
graph.  Also an <B>at 4#4position5#5</B> may be given to indicate precisely where the
plot should be placed.  In this case, the keywords <B>left</B>, <B>right</B>, <B>top</B>,
<B>bottom</B> and <B>center</B> serve an analogous purpose for alignment.
For more information, see <B>key placement (p.&nbsp;<A HREF="node217.html#key_placement"><IMG  ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)<A NAME="4942"></A></B>.

<P>
Justification of the plot titles within the key is controlled by <B>Left</B> or
<B>Right</B> (default).  The text and sample can be reversed (<B>reverse</B>) and a
box can be drawn around the key (<B>box {...}</B>) in a specified <B>linetype</B>
and <B>linewidth</B>, or a user-defined <B>linestyle</B>.

<P>
By default the first plot label is at the top of the key and successive labels
are entered below it. The <B>invert</B> option causes the first label to be placed
at the bottom of the key, with successive labels entered above it. This option
is useful to force the vertical ordering of labels in the key to match the
order of box types in a stacked histogram.

<P>
The 4#4height_increment5#5 is a number of character heights to be added to or
subtracted from the height of the key box.  This is useful mainly when you are
putting a box around the key and want larger borders around the key entries.

<P>
All plotted curves of <B>plot</B>s and <B>splot</B>s are titled according to the
default option <B>autotitles</B>. The automatic generation of titles can be
suppressed by <B>noautotitles</B>; then only those titles explicitly defined
by <B>(s)plot ... title ...</B> will be drawn.

<P>
<A NAME="4956"></A>
The command <B>set key autotitle columnheader</B> causes the first entry in each
column of input data to be interpreted as a text string and used as a title for
the corresponding plot. If the quantity being plotted is a function of data
from several columns, gnuplot may be confused as to which column to draw the
title from. In this case it is necessary to specify the column explicitly in
the plot command, e.g.

<P>
<BR>
<PRE>
     plot "datafile" using (($2+$3)/$4) title columnhead(3) with lines
</PRE>
<BR>

<P>
An overall title can be put on the key (<B>title <TT>"</TT>4#4text5#5<TT>"</TT></B>) -- see also <B>syntax (p.&nbsp;<A HREF="node52.html#syntax"><IMG  ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)<A NAME="4963"></A></B>
for the distinction between text in single- or double-quotes.  The key title
uses the same justification as do the plot titles.

<P>
The defaults for <B>set key</B> are <B>on</B>, <B>right</B>, <B>top</B>, <B>vertical</B>, <B>Right</B>,
<B>noreverse</B>, <B>noinvert</B>, <B>samplen 4</B>, <B>spacing 1.25</B>, <B>title <TT>""</TT></B>, and
<B>nobox</B>.  The default 4#4linetype5#5 is the same as that used for the plot
borders.  Entering <B>set key default</B> returns the key to its default
configuration.

<P>
The key is drawn as a sequence of lines, with one plot described on each
line.  On the right-hand side (or the left-hand side, if <B>reverse</B> is
selected) of each line is a representation that attempts to mimic the way the
curve is plotted.  On the other side of each line is the text description
(the line title), obtained from the <B>plot</B> command.  The lines are vertically
arranged so that an imaginary straight line divides the left- and right-hand
sides of the key.  It is the coordinates of the top of this line that are
specified with the <B>set key</B> command.  In a <B>plot</B>, only the x and y
coordinates are used to specify the line position.  For a <B>splot</B>, x, y and
z are all used as a 3D location mapped using the same mapping as the graph
itself to form the required 2D screen position of the imaginary line.

<P>
When using the TeX or PostScript drivers, or similar drivers where formatting
information is embedded in the string, <B>gnuplot</B> is unable to calculate
correctly the width of the string for key positioning.  If the key is to be
positioned at the left, it may be convenient to use the combination  <B>set key
left Left reverse</B>.  The box and gap in the grid will be the width of the
literal string.

<P>
If <B>splot</B> is being used to draw contours, the contour labels will be listed
in the key.  If the alignment of these labels is poor or a different number
of decimal places is desired, the label format can be specified.  See
<B>set clabel (p.&nbsp;<A HREF="node186.html#set_clabel"><IMG  ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)<A NAME="4987"></A></B> for details.

<P>
Examples:

<P>
This places the key at the default location:
<BR>
<PRE>
     set key default
</PRE>
<BR>

<P>
This disables the key:
<BR>
<PRE>
     unset key
</PRE>
<BR>

<P>
This places a key at coordinates 2,3.5,2 in the default (first) coordinate
system:
<BR>
<PRE>
     set key at 2,3.5,2
</PRE>
<BR>

<P>
This places the key below the graph:
<BR>
<PRE>
     set key below
</PRE>
<BR>

<P>
This places the key in the bottom left corner, left-justifies the text,
gives it a title, and draws a box around it in linetype 3:
<BR>
<PRE>
     set key left bottom Left title 'Legend' box 3
</PRE>
<BR>
<BR><HR>
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>

<UL>
<LI><A NAME="tex2html4324"
  HREF="node217.html">Key placement</A>
<LI><A NAME="tex2html4325"
  HREF="node218.html">Key samples</A>
</UL>
<!--End of Table of Child-Links-->
<HR>
<!--Navigation Panel-->
<A NAME="tex2html4322"
  HREF="node217.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html4316"
  HREF="node175.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html4310"
  HREF="node215.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html4318"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html4320"
  HREF="node467.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html4323"
  HREF="node217.html">Key placement</A>
<B> Up:</B> <A NAME="tex2html4317"
  HREF="node175.html">Set-show</A>
<B> Previous:</B> <A NAME="tex2html4311"
  HREF="node215.html">Isosamples</A>
 &nbsp; <B>  <A NAME="tex2html4319"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html4321"
  HREF="node467.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>

2010-08-17
</ADDRESS>
</BODY>
</HTML>