File: Introduction-to-Graphics-Structures.html

package info (click to toggle)
octave 4.4.1-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 114,832 kB
  • sloc: cpp: 310,009; ansic: 54,616; fortran: 22,631; yacc: 8,706; sh: 8,231; objc: 7,972; lex: 3,897; perl: 1,540; java: 1,309; awk: 1,070; makefile: 415; xml: 59
file content (197 lines) | stat: -rw-r--r-- 10,408 bytes parent folder | download
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Introduction to Graphics Structures (GNU Octave (version 4.4.1))</title>

<meta name="description" content="Introduction to Graphics Structures (GNU Octave (version 4.4.1))">
<meta name="keywords" content="Introduction to Graphics Structures (GNU Octave (version 4.4.1))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Graphics-Data-Structures.html#Graphics-Data-Structures" rel="up" title="Graphics Data Structures">
<link href="Graphics-Objects.html#Graphics-Objects" rel="next" title="Graphics Objects">
<link href="Graphics-Data-Structures.html#Graphics-Data-Structures" rel="prev" title="Graphics Data Structures">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">


</head>

<body lang="en">
<a name="Introduction-to-Graphics-Structures"></a>
<div class="header">
<p>
Next: <a href="Graphics-Objects.html#Graphics-Objects" accesskey="n" rel="next">Graphics Objects</a>, Up: <a href="Graphics-Data-Structures.html#Graphics-Data-Structures" accesskey="u" rel="up">Graphics Data Structures</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Introduction-to-Graphics-Structures-1"></a>
<h4 class="subsection">15.3.1 Introduction to Graphics Structures</h4>
<a name="index-introduction-to-graphics-structures"></a>
<a name="XREFgraphics-structures"></a>
<p>The graphics functions use pointers, which are of class graphics_handle, in
order to address the data structures which control visual display.  A
graphics handle may point to any one of a number of different base object
types and these objects are the graphics data structures themselves.  The
primitive graphic object types are: <code>figure</code>, <code>axes</code>, <code>line</code>,
<code>text</code>, <code>patch</code>, <code>surface</code>, <code>text</code>, <code>image</code>, and
<code>light</code>.
</p>
<p>Each of these objects has a function by the same name, and, each of these
functions returns a graphics handle pointing to an object of the corresponding
type.  In addition there are several functions which operate on properties of
the graphics objects and which also return handles: the functions <code>plot</code>
and <code>plot3</code> return a handle pointing to an object of type line, the
function <code>subplot</code> returns a handle pointing to an object of type axes,
the function <code>fill</code> returns a handle pointing to an object of type patch,
the functions <code>area</code>, <code>bar</code>, <code>barh</code>, <code>contour</code>,
<code>contourf</code>, <code>contour3</code>, <code>surf</code>, <code>mesh</code>, <code>surfc</code>,
<code>meshc</code>, <code>errorbar</code>, <code>quiver</code>, <code>quiver3</code>, <code>scatter</code>,
<code>scatter3</code>, <code>stair</code>, <code>stem</code>, <code>stem3</code> each return a handle
to a complex data structure as documented in
<a href="Data-Sources-in-Object-Groups.html#XREFdatasources">Data Sources</a>.
</p>
<p>The graphics objects are arranged in a hierarchy:
</p>
<p>1. The root object is returned by <code>groot</code> (historically, equivalent to
the handle 0).  In other words, <code>get (groot)</code> returns the properties of
the root object.
</p>
<p>2. Below the root are <code>figure</code> objects.
</p>
<p>3. Below the <code>figure</code> objects are <code>axes</code> or <code>hggroup</code> objects.
</p>
<p>4. Below the <code>axes</code> objects are <code>line</code>, <code>text</code>, <code>patch</code>,
<code>surface</code>, <code>image</code>, and <code>light</code> objects.
</p>
<p>Graphics handles may be distinguished from function handles
(see <a href="Function-Handles.html#Function-Handles">Function Handles</a>) by means of the function <code>ishghandle</code>.
<code>ishghandle</code> returns true if its argument is a handle of a graphics
object.  In addition, a figure or axes object may be tested using
<code>isfigure</code> or <code>isaxes</code> respectively.  To test for a specific type of
graphics handle, such as a patch or line object, use <code>isgraphics</code>.  The
more specific test functions return true only if the argument is both a
graphics handle and of the correct type (figure, axes, specified object type).
</p>
<p>The <code>whos</code> function can be used to show the object type of each currently
defined graphics handle.  (Note: this is not true today, but it is, I hope,
considered an error in whos.  It may be better to have whos just show
graphics_handle as the class, and provide a new function which, given a
graphics handle, returns its object type.  This could generalize the ishandle()
functions and, in fact, replace them.)
</p>
<p>The <code>get</code> and <code>set</code> commands are used to obtain and set the values of
properties of graphics objects.  In addition, the <code>get</code> command may be
used to obtain property names.
</p>
<p>For example, the property <code>&quot;type&quot;</code> of the graphics object pointed to by
the graphics handle h may be displayed by:
</p>
<div class="example">
<pre class="example">get (h, &quot;type&quot;)
</pre></div>

<p>The properties and their current values are returned by <code>get (h)</code>
where h is a handle of a graphics object.  If only the names of the
allowed properties are wanted they may be displayed by:
<code>get (h, &quot;&quot;)</code>.
</p>
<p>Thus, for example:
</p>
<div class="smallexample">
<pre class="smallexample">h = figure ();
get (h, &quot;type&quot;)
ans = figure
get (h, &quot;&quot;);
error: get: ambiguous figure property name ; possible matches:

__gl_extensions__      dockcontrols           renderer
__gl_renderer__        doublebuffer           renderermode
__gl_vendor__          filename               resize
__gl_version__         graphicssmoothing      resizefcn
__graphics_toolkit__   handlevisibility       selected
__guidata__            hittest                selectionhighlight
__modified__           integerhandle          selectiontype
__mouse_mode__         interruptible          sizechangedfcn
__myhandle__           inverthardcopy         tag
__pan_mode__           keypressfcn            toolbar
__plot_stream__        keyreleasefcn          type
__rotate_mode__        menubar                uicontextmenu
__zoom_mode__          mincolormap            units
alphamap               name                   userdata
beingdeleted           nextplot               visible
busyaction             numbertitle            windowbuttondownfcn
buttondownfcn          outerposition          windowbuttonmotionfcn
children               paperorientation       windowbuttonupfcn
clipping               paperposition          windowkeypressfcn
closerequestfcn        paperpositionmode      windowkeyreleasefcn
color                  papersize              windowscrollwheelfcn
colormap               papertype              windowstyle
createfcn              paperunits             wvisual
currentaxes            parent                 wvisualmode
currentcharacter       pointer                xdisplay
currentobject          pointershapecdata      xvisual
currentpoint           pointershapehotspot    xvisualmode
deletefcn              position
</pre></div>

<p>The properties of the root figure may be displayed by:
<code>get (groot, &quot;&quot;)</code>.
</p>
<p>The uses of <code>get</code> and <code>set</code> are further explained in
<a href="Graphics-Objects.html#XREFget">get</a>, <a href="Graphics-Objects.html#XREFset">set</a>.
</p>
<a name="XREFisprop"></a><dl>
<dt><a name="index-isprop"></a><em><var>res</var> =</em> <strong>isprop</strong> <em>(<var>obj</var>, &quot;<var>prop</var>&quot;)</em></dt>
<dd><p>Return true if <var>prop</var> is a property of the object <var>obj</var>.
</p>
<p><var>obj</var> may also be an array of objects in which case <var>res</var> will be a
logical array indicating whether each handle has the property <var>prop</var>.
</p>
<p>For plotting, <var>obj</var> is a handle to a graphics object.  Otherwise,
<var>obj</var> should be an instance of a class.
</p>
<p><strong>See also:</strong> <a href="Graphics-Objects.html#XREFget">get</a>, <a href="Graphics-Objects.html#XREFset">set</a>, <a href="Creating-a-Class.html#XREFismethod">ismethod</a>, <a href="Creating-a-Class.html#XREFisobject">isobject</a>.
</p></dd></dl>


<hr>
<div class="header">
<p>
Next: <a href="Graphics-Objects.html#Graphics-Objects" accesskey="n" rel="next">Graphics Objects</a>, Up: <a href="Graphics-Data-Structures.html#Graphics-Data-Structures" accesskey="u" rel="up">Graphics Data Structures</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>