Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > b38d2da330d1936e5ab1307c039c4941 > files > 363

octave-doc-3.6.4-3.mga4.noarch.rpm

<html lang="en">
<head>
<title>Multiple Plots on One Page - GNU Octave</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU Octave">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="High_002dLevel-Plotting.html#High_002dLevel-Plotting" title="High-Level Plotting">
<link rel="prev" href="Plot-Annotations.html#Plot-Annotations" title="Plot Annotations">
<link rel="next" href="Multiple-Plot-Windows.html#Multiple-Plot-Windows" title="Multiple Plot Windows">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<a name="Multiple-Plots-on-One-Page"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Multiple-Plot-Windows.html#Multiple-Plot-Windows">Multiple Plot Windows</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Plot-Annotations.html#Plot-Annotations">Plot Annotations</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="High_002dLevel-Plotting.html#High_002dLevel-Plotting">High-Level Plotting</a>
<hr>
</div>

<h4 class="subsection">15.2.4 Multiple Plots on One Page</h4>

<p>Octave can display more than one plot in a single figure.  The simplest
way to do this is to use the <code>subplot</code> function to divide the plot
area into a series of subplot windows that are indexed by an integer. 
For example,

<pre class="example">     subplot (2, 1, 1)
     fplot (@sin, [-10, 10]);
     subplot (2, 1, 2)
     fplot (@cos, [-10, 10]);
</pre>
   <p class="noindent">creates a figure with two separate axes, one displaying a sine wave and
the other a cosine wave.  The first call to subplot divides the figure
into two plotting areas (two rows and one column) and makes the first plot
area active.  The grid of plot areas created by <code>subplot</code> is
numbered in column-major order (top to bottom, left to right).

<!-- subplot scripts/plot/subplot.m -->
   <p><a name="doc_002dsubplot"></a>

<div class="defun">
&mdash; Function File:  <b>subplot</b> (<var>rows, cols, index</var>)<var><a name="index-subplot-1401"></a></var><br>
&mdash; Function File:  <b>subplot</b> (<var>rcn</var>)<var><a name="index-subplot-1402"></a></var><br>
<blockquote><p>Set up a plot grid with <var>rows</var> by <var>cols</var> subwindows and plot
in location given by <var>index</var>.

        <p>If only one argument is supplied, then it must be a three digit value
specifying the location in digits 1 (rows) and 2 (columns) and the plot
index in digit 3.

        <p>The plot index runs row-wise.  First all the columns in a row are filled
and then the next row is filled.

        <p>For example, a plot with 2 by 3 grid will have plot indices running as
follows:

     <pre class="example">          +-----+-----+-----+
          |  1  |  2  |  3  |
          +-----+-----+-----+
          |  4  |  5  |  6  |
          +-----+-----+-----+
</pre>
        <p><var>index</var> may be a vector.  In which case, the new axis will enclose
the grid locations specified.  The first demo illustrates an example:

     <pre class="example">          demo ("subplot", 1)
</pre>
        <!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
     <!-- A simple blank line produces the correct behavior. -->
     <!-- @sp 1 -->
     <p class="noindent"><strong>See also:</strong> <a href="doc_002daxes.html#doc_002daxes">axes</a>, <a href="doc_002dplot.html#doc_002dplot">plot</a>. 
</p></blockquote></div>

   </body></html>