<html lang="en"> <head> <title>Two-dimensional Geometric Shapes - 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="Two_002dDimensional-Plots.html#Two_002dDimensional-Plots" title="Two-Dimensional Plots"> <link rel="prev" href="Two_002ddimensional-Function-Plotting.html#Two_002ddimensional-Function-Plotting" title="Two-dimensional Function Plotting"> <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="Two-dimensional-Geometric-Shapes"></a> <a name="Two_002ddimensional-Geometric-Shapes"></a> <p> Previous: <a rel="previous" accesskey="p" href="Two_002ddimensional-Function-Plotting.html#Two_002ddimensional-Function-Plotting">Two-dimensional Function Plotting</a>, Up: <a rel="up" accesskey="u" href="Two_002dDimensional-Plots.html#Two_002dDimensional-Plots">Two-Dimensional Plots</a> <hr> </div> <h5 class="subsubsection">15.2.1.3 Two-dimensional Geometric Shapes</h5> <!-- rectangle scripts/plot/rectangle.m --> <p><a name="doc_002drectangle"></a> <div class="defun"> — Function File: <b>rectangle</b> ()<var><a name="index-rectangle-1231"></a></var><br> — Function File: <b>rectangle</b> (<var><small class="dots">...</small>, "Position", pos</var>)<var><a name="index-rectangle-1232"></a></var><br> — Function File: <b>rectangle</b> (<var><small class="dots">...</small>, "Curvature", curv</var>)<var><a name="index-rectangle-1233"></a></var><br> — Function File: <b>rectangle</b> (<var><small class="dots">...</small>, "EdgeColor", ec</var>)<var><a name="index-rectangle-1234"></a></var><br> — Function File: <b>rectangle</b> (<var><small class="dots">...</small>, "FaceColor", fc</var>)<var><a name="index-rectangle-1235"></a></var><br> — Function File: <var>h</var> = <b>rectangle</b> (<var><small class="dots">...</small></var>)<var><a name="index-rectangle-1236"></a></var><br> <blockquote> <p>Draw rectangular patch defined by <var>pos</var> and <var>curv</var>. The variable <var>pos</var><code>(1:2)</code> defines the lower left-hand corner of the patch and <var>pos</var><code>(3:4)</code> defines its width and height. By default, the value of <var>pos</var> is <code>[0, 0, 1, 1]</code>. <p>The variable <var>curv</var> defines the curvature of the sides of the rectangle and may be a scalar or two-element vector with values between 0 and 1. A value of 0 represents no curvature of the side, whereas a value of 1 means that the side is entirely curved into the arc of a circle. If <var>curv</var> is a two-element vector, then the first element is the curvature along the x-axis of the patch and the second along y-axis. <p>If <var>curv</var> is a scalar, it represents the curvature of the shorter of the two sides of the rectangle and the curvature of the other side is defined by <pre class="example"> min (pos (1:2)) / max (pos (1:2)) * curv </pre> <p>Other properties are passed to the underlying patch command. <p>The optional return value <var>h</var> is a graphics handle to the created rectangle object. </p></blockquote></div> <!-- 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_002dpatch.html#doc_002dpatch">patch</a>. </body></html>