1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
<html lang="en">
<head>
<title>Plotting the Triangulation - Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Delaunay-Triangulation.html#Delaunay-Triangulation" title="Delaunay Triangulation">
<link rel="next" href="Identifying-points-in-Triangulation.html#Identifying-points-in-Triangulation" title="Identifying points in Triangulation">
<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">
<p>
<a name="Plotting-the-Triangulation"></a>
Next: <a rel="next" accesskey="n" href="Identifying-points-in-Triangulation.html#Identifying-points-in-Triangulation">Identifying points in Triangulation</a>,
Up: <a rel="up" accesskey="u" href="Delaunay-Triangulation.html#Delaunay-Triangulation">Delaunay Triangulation</a>
<hr>
</div>
<h4 class="subsection">29.1.1 Plotting the Triangulation</h4>
<p>Octave has the functions <code>triplot</code> and <code>trimesh</code> to plot the
Delaunay triangulation of a 2-dimensional set of points.
<!-- ./geometry/triplot.m -->
<p><a name="doc_002dtriplot"></a>
<div class="defun">
— Function File: <b>triplot</b> (<var>tri, x, y</var>)<var><a name="index-triplot-2090"></a></var><br>
— Function File: <b>triplot</b> (<var>tri, x, y, linespec</var>)<var><a name="index-triplot-2091"></a></var><br>
— Function File: <var>h</var> = <b>triplot</b> (<var><small class="dots">...</small></var>)<var><a name="index-triplot-2092"></a></var><br>
<blockquote><p>Plot a triangular mesh in 2D. The variable <var>tri</var> is the triangular
meshing of the points <code>(</code><var>x</var><code>, </code><var>y</var><code>)</code> which is returned from
<code>delaunay</code>. If given, the <var>linespec</var> determines the properties
to use for the lines. The output argument <var>h</var> is the graphic handle
to the plot.
<!-- 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_002dplot.html#doc_002dplot">plot</a>, <a href="doc_002dtrimesh.html#doc_002dtrimesh">trimesh</a>, <a href="doc_002ddelaunay.html#doc_002ddelaunay">delaunay</a>.
</p></blockquote></div>
<!-- ./geometry/trimesh.m -->
<p><a name="doc_002dtrimesh"></a>
<div class="defun">
— Function File: <b>trimesh</b> (<var>tri, x, y, z</var>)<var><a name="index-trimesh-2093"></a></var><br>
— Function File: <var>h</var> = <b>trimesh</b> (<var><small class="dots">...</small></var>)<var><a name="index-trimesh-2094"></a></var><br>
<blockquote><p>Plot a triangular mesh in 3D. The variable <var>tri</var> is the triangular
meshing of the points <code>(</code><var>x</var><code>, </code><var>y</var><code>)</code> which is returned
from <code>delaunay</code>. The variable <var>z</var> is value at the point
<code>(</code><var>x</var><code>, </code><var>y</var><code>)</code>. The output argument <var>h</var> is the graphic
handle to the plot.
<!-- 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_002dtriplot.html#doc_002dtriplot">triplot</a>, <a href="doc_002ddelaunay3.html#doc_002ddelaunay3">delaunay3</a>.
</p></blockquote></div>
<p>The difference between <code>triplot</code> and <code>trimesh</code> is that the
former only plots the 2-dimensional triangulation itself, whereas the
second plots the value of some function <code>f (</code><var>x</var><code>, </code><var>y</var><code>)</code>.
An example of the use of the <code>triplot</code> function is
<pre class="example"> rand ("state", 2)
x = rand (20, 1);
y = rand (20, 1);
tri = delaunay (x, y);
triplot (tri, x, y);
</pre>
<p>that plot the Delaunay triangulation of a set of random points in
2-dimensions.
</body></html>
|