6778
|
1 @c Copyright (C) 1996, 1997, 2007 John W. Eaton |
3294
|
2 @c This is part of the Octave manual. |
|
3 @c For copying conditions, see the file gpl.texi. |
|
4 |
4167
|
5 @node Plotting |
3294
|
6 @chapter Plotting |
6888
|
7 @cindex plotting |
|
8 @cindex graphics |
3294
|
9 |
|
10 @menu |
6888
|
11 * Plotting Basics:: |
|
12 * Advanced Plotting:: |
|
13 @end menu |
|
14 |
|
15 @node Plotting Basics |
|
16 @section Plotting Basics |
|
17 |
|
18 Octave makes it easy to create many different types of two- and |
|
19 three-dimensional plots using a few high-level functions. |
|
20 |
|
21 If you need finer control over graphics, see @ref{Advanced Plotting}. |
|
22 |
|
23 @menu |
|
24 * Two-Dimensional Plots:: |
3294
|
25 * Three-Dimensional Plotting:: |
|
26 * Plot Annotations:: |
|
27 * Multiple Plots on One Page:: |
3428
|
28 * Multiple Plot Windows:: |
6888
|
29 * Printing Plots:: |
|
30 * Test Plotting Functions:: |
3294
|
31 @end menu |
|
32 |
6888
|
33 @node Two-Dimensional Plots |
|
34 @subsection Two-Dimensional Plots |
|
35 |
|
36 The @code{plot} function allows you to create simple x-y plots with |
|
37 linear axes. For example, |
3294
|
38 |
6888
|
39 @example |
|
40 @group |
|
41 x = -10:0.1:10; |
|
42 plot (x, sin (x)); |
|
43 @end group |
|
44 @end example |
|
45 |
|
46 @noindent |
|
47 displays a sine wave shown in @xref{fig:plot}. On most systems, this |
|
48 command will open a separate plot window to display the graph. |
5134
|
49 |
6888
|
50 @float Figure,fig:plot |
|
51 @image{plot,8cm} |
|
52 @caption{Simple Two-Dimensional Plot.} |
|
53 @end float |
|
54 |
|
55 The function @code{fplot} also generates two-dimensional plots with |
|
56 linear axes using a function name and limits for the range of the |
|
57 x-coordinate instead of the x and y data. For example, |
5134
|
58 |
6888
|
59 @example |
|
60 @group |
|
61 fplot (@@sin, [-10, 10], 201); |
|
62 @end group |
|
63 @end example |
|
64 |
|
65 @noindent |
|
66 produces a plot that is equivalent to the one above, but also includes a |
|
67 legend displaying the name of the plotted function. |
6502
|
68 |
5134
|
69 @DOCSTRING(plot) |
|
70 |
6502
|
71 @DOCSTRING(fplot) |
|
72 |
6888
|
73 The functions @code{semilogx}, @code{semilogy}, and @code{loglog} are |
|
74 similar to the @code{plot} function, but produce plots in which one or |
|
75 both of the axes use log scales. |
|
76 |
|
77 @DOCSTRING(semilogx) |
6502
|
78 |
6888
|
79 @DOCSTRING(semilogy) |
6502
|
80 |
6888
|
81 @DOCSTRING(loglog) |
|
82 |
|
83 The functions @code{bar}, @code{barh}, @code{stairs}, and @code{stem} |
|
84 are useful for displaying discrete data. For example, |
5134
|
85 |
6888
|
86 @example |
|
87 @group |
|
88 hist (randn (10000, 1), 30); |
|
89 @end group |
|
90 @end example |
5134
|
91 |
6888
|
92 @noindent |
|
93 produces the histogram of 10,000 normally distributed random numbers |
|
94 shown in @xref{fig:hist}. |
5134
|
95 |
6888
|
96 @float Figure,fig:hist |
|
97 @image{hist,8cm} |
|
98 @caption{Histogram.} |
|
99 @end float |
5134
|
100 |
|
101 @DOCSTRING(bar) |
|
102 |
6877
|
103 @DOCSTRING(barh) |
|
104 |
6888
|
105 @DOCSTRING(hist) |
|
106 |
|
107 @DOCSTRING(stairs) |
|
108 |
|
109 @DOCSTRING(stem) |
|
110 |
|
111 The @code{contour} and @code{contourc} functions produce two-dimensional |
|
112 contour plots from three dimensional data. |
|
113 |
5134
|
114 @DOCSTRING(contour) |
|
115 |
6502
|
116 @DOCSTRING(contourc) |
|
117 |
6888
|
118 The @code{errorbar}, @code{semilogxerr}, @code{semilogyerr}, and |
|
119 @code{loglogerr} functions produces plots with error bar markers. For |
|
120 example, |
6877
|
121 |
6888
|
122 @example |
|
123 x = 0:0.1:10; |
|
124 y = sin (x); |
|
125 yp = 0.1 .* randn (size (x)); |
|
126 ym = -0.1 .* randn (size (x)); |
|
127 errorbar (x, sin (x), ym, yp); |
|
128 @end example |
5134
|
129 |
6888
|
130 @noindent |
|
131 produces the figure shown in @xref{fig:errorbar}. |
6502
|
132 |
6888
|
133 @float Figure,fig:errorbar |
|
134 @image{errorbar,8cm} |
|
135 @caption{Errorbar plot.} |
|
136 @end float |
5134
|
137 |
|
138 @DOCSTRING(errorbar) |
|
139 |
|
140 @DOCSTRING(semilogxerr) |
|
141 |
|
142 @DOCSTRING(semilogyerr) |
|
143 |
6888
|
144 @DOCSTRING(loglogerr) |
|
145 |
|
146 Finally, the @code{polar} function allows you to easily plot data in |
|
147 polor coordinates. However, the display coordinates remain rectangular |
|
148 and linear. For example, |
|
149 |
|
150 @example |
|
151 polar (0:0.1:10*pi, 0:0.1:10*pi); |
|
152 @end example |
|
153 |
|
154 @noindent |
|
155 produces the spiral plot shown in @xref{fig:polar}. |
|
156 |
|
157 @float Figure,fig:polar |
|
158 @image{polar,8cm} |
|
159 @caption{Polar plot.} |
|
160 @end float |
|
161 |
|
162 @DOCSTRING(polar) |
|
163 |
|
164 The axis function may be used to change the axis limits of an existing |
|
165 plot. |
|
166 |
|
167 @DOCSTRING(axis) |
|
168 |
5134
|
169 @node Three-Dimensional Plotting |
6888
|
170 @subsection Three-Dimensional Plotting |
|
171 |
|
172 The function @code{mesh} produces mesh surface plots. For example, |
|
173 |
|
174 @example |
|
175 @group |
|
176 tx = ty = linspace (-8, 8, 41)'; |
|
177 [xx, yy] = meshgrid (tx, ty); |
|
178 r = sqrt (xx .^ 2 + yy .^ 2) + eps; |
|
179 tz = sin (r) ./ r; |
|
180 mesh (tx, ty, tz); |
|
181 @end group |
|
182 @end example |
|
183 |
|
184 @noindent |
|
185 produces the familiar ``sombrero'' plot shown in @xref{fig:mesh}. Note |
|
186 the use of the function @code{meshgrid} to create matrices of X and Y |
|
187 coordinates to use for plotting the Z data. The @code{ndgrid} function |
|
188 is similar to @code{meshgrid}, but works for N-dimensional matrices. |
|
189 |
|
190 @float Figure,fig:mesh |
|
191 @image{mesh,8cm} |
|
192 @caption{Mesh plot.} |
|
193 @end float |
5134
|
194 |
6888
|
195 The @code{meshc} function is similar to @code{mesh}, but also produces a |
|
196 plot of contours for the surface. |
|
197 |
|
198 The @code{plot3} function displays arbitrary three-dimensional data, |
|
199 without requiring it to form a surface. For example |
|
200 |
|
201 @example |
|
202 @group |
|
203 t = 0:0.1:10*pi; |
|
204 r = linspace (0, 1, numel (t)); |
|
205 z = linspace (0, 1, numel (t)); |
|
206 plot3 (r.*sin(t), r.*cos(t), z); |
|
207 @end group |
|
208 @end example |
|
209 |
|
210 @noindent |
|
211 displays the spiral in three dimensions shown in @xref{fig:plot3}. |
|
212 |
|
213 @float Figure,fig:plot3 |
|
214 @image{plot3,8cm} |
|
215 @caption{Three dimensional spiral.} |
|
216 @end float |
|
217 |
|
218 Finally, the @code{view} function changes the viewpoint for |
|
219 three-dimensional plots. |
5134
|
220 |
|
221 @DOCSTRING(mesh) |
|
222 |
6788
|
223 @DOCSTRING(meshc) |
|
224 |
5134
|
225 @DOCSTRING(meshgrid) |
|
226 |
6550
|
227 @DOCSTRING(ndgrid) |
|
228 |
6888
|
229 @DOCSTRING(plot3) |
|
230 |
6502
|
231 @DOCSTRING(view) |
|
232 |
6888
|
233 @node Plot Annotations |
|
234 @subsection Plot Annotations |
6502
|
235 |
6888
|
236 You can add titles, axis labels, legends, and arbitrary text to an |
|
237 existing plot. For example, |
6877
|
238 |
6888
|
239 @example |
|
240 @group |
|
241 x = -10:0.1:10; |
|
242 plot (x, sin (x)); |
|
243 title ("sin(x) for x = -10:0.1:10"); |
|
244 xlabel ("x"); |
|
245 ylabel ("sin (x)"); |
|
246 text (pi, 0.7, "arbitrary text"); |
|
247 legend ("sin (x)"); |
|
248 @end group |
|
249 @end example |
6502
|
250 |
6888
|
251 The functions @code{grid} and @code{box} may also be used to add grid |
|
252 and border lines to the plot. By default, the grid is off and the |
|
253 border lines are on. |
5134
|
254 |
|
255 @DOCSTRING(title) |
|
256 |
6502
|
257 @DOCSTRING(legend) |
|
258 |
|
259 @DOCSTRING(text) |
|
260 |
5134
|
261 @DOCSTRING(xlabel) |
|
262 |
6502
|
263 @DOCSTRING(box) |
|
264 |
|
265 @DOCSTRING(grid) |
|
266 |
5134
|
267 @node Multiple Plots on One Page |
6888
|
268 @subsection Multiple Plots on One Page |
|
269 |
|
270 Octave can display more than one plot in a single figure. The simplest |
|
271 way to do this is to use the @code{subplot} function to divide the plot |
|
272 area into a series of subplot windows that are indexed by an integer. |
|
273 For example, |
|
274 |
|
275 @example |
|
276 @group |
|
277 subplot (2, 1, 1) |
|
278 fplot (@@sin, [-10, 10]); |
|
279 subplot (2, 1, 2) |
|
280 fplot (@@cos, [-10, 10]); |
|
281 @end group |
|
282 @end example |
|
283 |
|
284 @noindent |
|
285 creates a figure with two separate axes, one displaying a sine wave and |
|
286 the other a cosine wave. The first call to subplot divides the figure |
|
287 into two plotting areas (two rows and one column) and makes the first plot |
|
288 area active. The grid of plot areas created by @code{subplot} is |
|
289 numbered in column-major order (top to bottom, left to right). |
5134
|
290 |
|
291 @DOCSTRING(subplot) |
|
292 |
|
293 @node Multiple Plot Windows |
6888
|
294 @subsection Multiple Plot Windows |
|
295 |
|
296 You can open multiple plot windows using the @code{figure} function. |
|
297 For example |
|
298 |
|
299 @example |
|
300 figure (1); |
|
301 fplot (@@sin, [-10, 10]); |
|
302 figure (2); |
|
303 fplot (@@cos, [-10, 10]); |
|
304 @end example |
|
305 |
|
306 @noindent |
|
307 creates two figures, with the first displaying a sine wave and |
|
308 the second a cosine wave. Figure numbers must be positive integers. |
5134
|
309 |
|
310 @DOCSTRING(figure) |
|
311 |
6502
|
312 @node Printing Plots |
6888
|
313 @subsection Printing Plots |
|
314 |
|
315 The @code{print} command allows you to save plots in a variety of |
|
316 formats. For example, |
|
317 |
|
318 @example |
|
319 print -deps foo.eps |
|
320 @end example |
|
321 |
|
322 @noindent |
|
323 writes the current figure to an encapsulated PostScript file called |
|
324 @file{foo.eps}. |
6502
|
325 |
|
326 @DOCSTRING(print) |
|
327 |
|
328 @DOCSTRING(orient) |
5134
|
329 |
6788
|
330 @node Test Plotting Functions |
6888
|
331 @subsection Test Plotting Functions |
|
332 |
|
333 The functions @code{sombrero} and @code{peaks} provide a way to check |
|
334 that plotting is working. Typing either @code{sombrero} or @code{peaks} |
|
335 at the Octave prompt should display a three dimensional plot. |
6788
|
336 |
6877
|
337 @DOCSTRING(sombrero) |
|
338 |
6788
|
339 @DOCSTRING(peaks) |
|
340 |
6888
|
341 @node Advanced Plotting |
|
342 @section Advanced Plotting |
|
343 |
|
344 @menu |
|
345 * Graphics Objects:: |
|
346 * Graphics Object Properties:: |
6889
|
347 * Colors:: |
|
348 * Line Styles:: |
|
349 * Marker Styles:: |
6888
|
350 * Interaction with gnuplot:: |
|
351 @end menu |
|
352 |
|
353 @node Graphics Objects |
|
354 @subsection Graphics Objects |
|
355 |
|
356 Plots in Octave are constructed from the following @dfn{graphics |
|
357 objects}. Each graphics object has a set of properties that define its |
|
358 appearance and may also contain links to other graphics objects. |
|
359 Graphics objects are only referenced by a numeric index, or @dfn{handle}. |
|
360 |
|
361 @table @asis |
|
362 @item root figure |
|
363 The parent of all figure objects. The index for the root figure is |
|
364 defined to be 0. |
|
365 |
|
366 @item figure |
|
367 A figure window. |
|
368 |
|
369 @item axes |
|
370 An set of axes. This object is a child of a figure object and may be a |
|
371 parent of line, text, image, patch, or surface objects. |
|
372 |
|
373 @item line |
|
374 A line in two or three dimensions. |
|
375 |
|
376 @item text |
|
377 Text annotations. |
|
378 |
|
379 @item image |
|
380 A bitmap image. |
|
381 |
|
382 @item patch |
|
383 A filled polygon, currently limited to two dimensions. |
|
384 |
|
385 @item surface |
|
386 A three-dimensional surface. |
|
387 @end table |
|
388 |
|
389 To determine whether an object is a graphics object index or a figure |
|
390 index, use the functions @code{ishandle} and @code{isfigure}. |
|
391 |
|
392 @DOCSTRING(ishandle) |
|
393 |
|
394 @DOCSTRING(isfigure) |
|
395 |
|
396 The function @code{gcf} returns an index to the current figure object, |
|
397 or creates one if none exists. Similarly, @code{gca} returns the |
|
398 current axes object, or creates one (and its parent figure object) if |
|
399 none exists. |
|
400 |
|
401 @DOCSTRING(gcf) |
|
402 |
|
403 @DOCSTRING(gca) |
|
404 |
|
405 The @code{get} and @code{set} functions may be used to examine and set |
|
406 properties for graphics objects. For example, |
|
407 |
|
408 @example |
|
409 @group |
|
410 get (0) |
|
411 @result{} ans = |
|
412 @{ |
|
413 type = root figure |
|
414 currentfigure = [](0x0) |
|
415 children = [](0x0) |
|
416 visible = on |
|
417 @} |
|
418 @end group |
|
419 @end example |
|
420 |
|
421 @noindent |
|
422 returns a structure containing all the properties of the root figure. |
|
423 As with all functions in Octave, the structure is returned by value, so |
|
424 modifying it will not modify the internal root figure plot object. To |
|
425 do that, you must use the @code{set} function. Also, note that in this |
|
426 case, the @code{currentfigure} property is empty, which indicates that |
|
427 there is no current figure window. |
|
428 |
|
429 The @code{get} function may also be used to find the value of a single |
|
430 property. For example, |
|
431 |
|
432 @example |
|
433 @group |
|
434 get (gca (), "xlim") |
|
435 @result{} [ 0 1 ] |
|
436 @end group |
|
437 @end example |
|
438 |
|
439 @noindent |
|
440 returns the range of the x-axis for the current axes object in the |
|
441 current figure. |
|
442 |
|
443 To set graphics object properties, use the set function. For example, |
|
444 |
|
445 @example |
|
446 set (gca (), "xlim", [-10, 10]); |
|
447 @end example |
|
448 |
|
449 @noindent |
|
450 sets the range of the x-axis for the current axes object in the current |
|
451 figure to @samp{[-10, 10]}. Additionally, calling set with a graphics |
|
452 object index as the only argument returns a structure containing the |
|
453 default values for all the properties for the given object type. For |
|
454 example, |
|
455 |
|
456 @example |
|
457 set (gca ()) |
|
458 @end example |
|
459 |
|
460 @noindent |
|
461 returns a structure containing the default property values for axes |
|
462 objects. |
|
463 |
|
464 @DOCSTRING(get) |
|
465 |
|
466 @DOCSTRING(set) |
|
467 |
|
468 @DOCSTRING(ancestor) |
|
469 |
|
470 You can create axes, line, and patch objects directly using the |
|
471 @code{axes}, @code{line}, and @code{patch} functions. These objects |
|
472 become children of the current axes object. |
|
473 |
|
474 @DOCSTRING(axes) |
|
475 |
|
476 @DOCSTRING(line) |
|
477 |
|
478 @DOCSTRING(patch) |
|
479 |
|
480 By default, Octave refreshes the plot window when a prompt is printed, |
|
481 or when waiting for input. To force an update at other times, call the |
|
482 @code{drawnow} function. |
|
483 |
|
484 @DOCSTRING(drawnow) |
|
485 |
|
486 Normally, high-level plot functions like @code{plot} or @code{mesh} call |
|
487 @code{newplot} to initialize the state of the current axes so that the |
|
488 next plot is drawn in a blank window with default property settings. To |
|
489 have two plots superimposed over one another, call the @code{hold} |
|
490 function. For example, |
|
491 |
|
492 @example |
|
493 @group |
|
494 hold ("on"); |
|
495 x = -10:0.1:10; |
|
496 plot (x, sin (x)); |
|
497 plot (x, cos (x)); |
|
498 hold ("off"); |
|
499 @end group |
|
500 @end example |
|
501 |
|
502 @noindent |
|
503 displays sine and cosine waves on the same axes. If the hold state is |
|
504 off, consecutive plotting commands like this will only display the last |
|
505 plot. |
|
506 |
|
507 @DOCSTRING(newplot) |
|
508 |
|
509 @DOCSTRING(hold) |
|
510 |
|
511 @DOCSTRING(ishold) |
|
512 |
|
513 To clear the current figure, call the @code{clf} function. To bring it |
|
514 to the top of the window stack, call the @code{shg} function. To delete |
|
515 a graphics object, call @code{delete} on its index. To close the |
|
516 figure window, call the @code{close} function. |
|
517 |
|
518 @DOCSTRING(clf) |
|
519 |
|
520 @DOCSTRING(shg) |
|
521 |
|
522 @DOCSTRING(delete) |
|
523 |
|
524 @DOCSTRING(close) |
|
525 |
|
526 @DOCSTRING(closereq) |
|
527 |
|
528 @node Graphics Object Properties |
|
529 @subsection Graphics Object Properties |
|
530 @cindex graphics object properties |
|
531 |
|
532 @menu |
|
533 * Root Figure Properties:: |
6889
|
534 * Figure Properties:: |
6888
|
535 * Axes Properties:: |
|
536 * Line Properties:: |
|
537 * Text Properties:: |
|
538 * Image Properties:: |
|
539 * Patch Properties:: |
|
540 * Surface Properties:: |
|
541 @end menu |
|
542 |
|
543 @node Root Figure Properties |
|
544 @subsubsection Root Figure Properties |
|
545 |
|
546 @table @code |
|
547 @item currentfigure |
6889
|
548 Index to graphics object for the current figure. |
|
549 |
|
550 @c FIXME -- does this work? |
|
551 @c @item visible |
|
552 @c Either @code{"on"} or @code{"off"} to toggle display of figures. |
6888
|
553 @end table |
|
554 |
6889
|
555 @node Figure Properties |
|
556 @subsubsection Figure Properties |
6888
|
557 |
|
558 @table @code |
|
559 @item nextplot |
6889
|
560 May be one of |
|
561 @table @code |
|
562 @item "new" |
|
563 @item "add" |
|
564 @item "replace" |
|
565 @item "replacechildren" |
|
566 @end table |
|
567 |
6888
|
568 @item closerequestfcn |
6889
|
569 Handle of function to call when a figure is closed. |
|
570 |
6888
|
571 @item currentaxes |
6889
|
572 Index to graphics object of current axes. |
|
573 |
6888
|
574 @item colormap |
6889
|
575 An N-by-3 matrix containing the color map for the current axes. |
|
576 |
6888
|
577 @item visible |
6889
|
578 Either @code{"on"} or @code{"off"} to toggle display of the figure. |
|
579 |
6888
|
580 @item paperorientation |
6889
|
581 Indicates the orientation for printing. Either @code{"landscape"} or |
|
582 @code{"portrait"}. |
6888
|
583 @end table |
|
584 |
|
585 @node Axes Properties |
|
586 @subsubsection Axes Properties |
|
587 |
|
588 @table @code |
|
589 @item position |
6889
|
590 A four-element vector specifying the coordinates of the lower left |
|
591 corner and width and height of the plot, in normalized units. For |
|
592 example, @code{[0.2, 0.3, 0.4, 0.5]} sets the lower left corner of the |
|
593 axes at @math{(0.2, 0.3)} and the width and heigth to be 0.4 and 0.5 |
|
594 respectively. |
|
595 |
6888
|
596 @item title |
6889
|
597 Index of text object for the axes title. |
|
598 |
6888
|
599 @item box |
6889
|
600 Either @code{"on"} or @code{"off"} to toggle display of the box around |
|
601 the axes. |
|
602 |
6888
|
603 @item key |
6889
|
604 Either @code{"on"} or @code{"off"} to toggle display of the legend. |
|
605 Note that this property is not compatible with @sc{Matlab} and may be |
|
606 removed in a future version of Octave. |
|
607 |
6888
|
608 @item keybox |
6889
|
609 Either @code{"on"} or @code{"off"} to toggle display of a box around the |
|
610 legend. Note that this property is not compatible with @sc{Matlab} and |
|
611 may be removed in a future version of Octave. |
|
612 |
6888
|
613 @item keypos |
6889
|
614 An integer from 1 to 4 specifying the position of the legend. 1 |
|
615 indicates upper right corner, 2 indicates upper left, 3 indicates lower |
|
616 left, and 4 indicates lower right. Note that this property is not |
|
617 compatible with @sc{Matlab} and may be removed in a future version of |
|
618 Octave. |
|
619 |
6888
|
620 @item dataaspectratio |
6889
|
621 A two-element vector specifying the relative height and width of the |
|
622 data displayed in the axes. Setting @code{dataaspectratio} to @samp{1, |
|
623 2]} causes the length of one unit as displayed on the y axis to be the |
|
624 same as the length of 2 units on the x axis. Setting |
|
625 @code{dataaspectratio} also forces the @code{dataaspectratiomode} |
|
626 property to be set to @code{"manual"}. |
|
627 |
6888
|
628 @item dataaspectratiomode |
6889
|
629 Either @code{"manual"} or @code{"auto"}. |
|
630 |
6888
|
631 @item xlim |
|
632 @itemx ylim |
|
633 @itemx zlim |
|
634 @itemx clim |
6889
|
635 Two-element vectors defining the limits for the x, y, and z axes and the |
|
636 Setting one of these properties also forces the corresponding mode |
|
637 property to be set to @code{"manual"}. |
|
638 |
6888
|
639 @item xlimmode |
|
640 @itemx ylimmode |
|
641 @itemx zlimmode |
|
642 @itemx climmode |
6889
|
643 Either @code{"manual"} or @code{"auto"}. |
|
644 |
6888
|
645 @item xlabel |
|
646 @itemx ylabel |
|
647 @itemx zlabel |
6889
|
648 Indices to text objects for the axes labels. |
|
649 |
6888
|
650 @item xgrid |
|
651 @itemx ygrid |
|
652 @itemx zgrid |
6889
|
653 Either @code{"on"} or @code{"off"} to toggle display of grid lines. |
|
654 |
6888
|
655 @item xminorgrid |
|
656 @itemx yminorgrid |
|
657 @itemx zminorgrid |
6889
|
658 Either @code{"on"} or @code{"off"} to toggle display of minor grid lines. |
|
659 |
6888
|
660 @item xtick |
|
661 @itemx ytick |
|
662 @itemx ztick |
6889
|
663 Setting one of these properties also forces the corresponding mode |
|
664 property to be set to @code{"manual"}. |
|
665 |
6888
|
666 @item xtickmode |
|
667 @itemx ytickmode |
|
668 @itemx ztickmode |
6889
|
669 Either @code{"manual"} or @code{"auto"}. |
|
670 |
6888
|
671 @item xticklabel |
|
672 @itemx yticklabel |
|
673 @itemx zticklabel |
6889
|
674 Setting one of these properties also forces the corresponding mode |
|
675 property to be set to @code{"manual"}. |
|
676 |
6888
|
677 @item xticklabelmode |
|
678 @itemx yticklabelmode |
|
679 @itemx zticklabelmode |
6889
|
680 Either @code{"manual"} or @code{"auto"}. |
|
681 |
6888
|
682 @item xscale |
|
683 @itemx yscale |
|
684 @itemx zscale |
6889
|
685 Either @code{"linear"} or @code{"log"}. |
|
686 |
6888
|
687 @item xdir |
|
688 @itemx ydir |
|
689 @itemx zdir |
6889
|
690 Either @code{"forward"} or @code{"reverse"}. |
|
691 |
6888
|
692 @item xaxislocation |
|
693 @itemx yaxislocation |
6889
|
694 Either @code{"top"} or @code{"bottom"} for the x axis and @code{"left"} |
|
695 or @code{"right"} for the y axis. |
|
696 |
6888
|
697 @item view |
6889
|
698 A three element vector specifying the view point for three-dimensional plots. |
|
699 |
6888
|
700 @item visible |
6889
|
701 Either @code{"on"} or @code{"off"} to toggle display of the axes. |
|
702 |
6888
|
703 @item nextplot |
6889
|
704 May be one of |
|
705 @table @code |
|
706 @item "new" |
|
707 @item "add" |
|
708 @item "replace" |
|
709 @item "replacechildren" |
|
710 @end table |
|
711 |
6888
|
712 @item outerposition |
6889
|
713 A four-element vector specifying the coordinates of the lower left |
|
714 corner and width and height of the plot, in normalized units. For |
|
715 example, @code{[0.2, 0.3, 0.4, 0.5]} sets the lower left corner of the |
|
716 axes at @math{(0.2, 0.3)} and the width and heigth to be 0.4 and 0.5 |
|
717 respectively. |
6888
|
718 @end table |
|
719 |
|
720 @node Line Properties |
|
721 @subsubsection Line Properties |
|
722 |
|
723 @table @code |
|
724 @itemx xdata |
|
725 @itemx ydata |
|
726 @itemx zdata |
|
727 @itemx ldata |
|
728 @itemx udata |
|
729 @itemx xldata |
|
730 @itemx xudata |
6889
|
731 The data to be plotted. The @code{ldata} and @code{udata} elements are |
|
732 for errobars in the y direction, and the @code{xldata} and @code{xudata} |
|
733 elements are for errorbars in the x direction. |
|
734 |
6888
|
735 @item color |
6889
|
736 The RGB color of the line, or a color name. @xref{Colors}. |
|
737 |
6888
|
738 @item linestyle |
6889
|
739 @itemx linewidth |
|
740 @xref{Line Styles}. |
|
741 |
6888
|
742 @item marker |
|
743 @item markeredgecolor |
|
744 @item markerfacecolor |
|
745 @item markersize |
6889
|
746 @xref{Marker Styles}. |
|
747 |
6888
|
748 @item keylabel |
6889
|
749 The text of the legend entry corresponding to this line. Note that this |
|
750 property is not compatible with @sc{Matlab} and may be removed in a |
|
751 future version of Octave. |
6888
|
752 @end table |
|
753 |
|
754 @node Text Properties |
|
755 @subsubsection Text Properties |
|
756 |
|
757 @table @code |
|
758 @item string |
6889
|
759 The character string contained by the text object. |
|
760 |
6888
|
761 @item units |
6889
|
762 May be @code{"normalized"} or @code{"graph"}. |
|
763 |
6888
|
764 @item position |
6889
|
765 The coordinates of the text object. |
|
766 |
6888
|
767 @item rotation |
6889
|
768 The angle of rotation for the displayed text, measured in degrees. |
|
769 |
6888
|
770 @item horizontalalignment |
6889
|
771 May be @code{"left"}, @code{"center"}, or @code{"right"}. |
|
772 |
6888
|
773 @item color |
6889
|
774 The color of the text. @xref{Colors}. |
6888
|
775 @end table |
|
776 |
|
777 @node Image Properties |
|
778 @subsubsection Image Properties |
|
779 |
|
780 @table @code |
|
781 @item cdata |
6889
|
782 The data for the image. Each pixel of the image corresponds to an |
|
783 element of @code{cdata}. The value of an element of @code{cdata} |
|
784 specifies the row-index into the colormap of the axes object containing |
|
785 the image. The color value found in the color map for the given index |
|
786 determines the color of the pixel. |
|
787 |
|
788 @item xdata |
6888
|
789 @itemx ydata |
6889
|
790 Two-element vectors specifing the range of the x- and y- coordinates for |
|
791 the image. |
6888
|
792 @end table |
|
793 |
|
794 @node Patch Properties |
|
795 @subsubsection Patch Properties |
|
796 |
|
797 @table @code |
|
798 @item cdata |
|
799 @itemx xdata |
|
800 @itemx ydata |
|
801 @itemx zdata |
6889
|
802 Data defining the patch object. |
|
803 |
6888
|
804 @item facecolor |
6889
|
805 The fill color of the patch. @xref{Colors}. |
|
806 |
6888
|
807 @item facealpha |
6889
|
808 A number in the range [0, 1] indicating the transparency of the patch. |
|
809 |
6888
|
810 @item edgecolor |
6889
|
811 The color of the line defining the patch. @xref{Colors}. |
|
812 |
6888
|
813 @item linestyle |
6889
|
814 @itemx linewidth |
|
815 @xref{Line Styles}. |
|
816 |
6888
|
817 @item marker |
6889
|
818 @itemx markeredgecolor |
|
819 @itemx markerfacecolor |
|
820 @itemx markersize |
|
821 @xref{Marker Styles}. |
6888
|
822 @end table |
|
823 |
|
824 @node Surface Properties |
|
825 @subsubsection Surface Properties |
|
826 |
|
827 @table @code |
|
828 @item xdata |
|
829 @itemx ydata |
|
830 @itemx zdata |
6889
|
831 The data determining the surface. The @code{xdata} and @code{ydata} |
|
832 elements are vectors and @code{zdata} must be a matrix. |
|
833 |
6888
|
834 @item keylabel |
6889
|
835 The text of the legend entry corresponding to this surface. Note that |
|
836 this property is not compatible with @sc{Matlab} and may be removed in a |
|
837 future version of Octave. |
|
838 @end table |
|
839 |
|
840 @node Colors |
|
841 @subsection Colors |
|
842 |
|
843 Colors may be specified as RGB triplets with values ranging from zero to |
|
844 one, or by name. Recognized color names include @code{"blue"}, |
|
845 @code{"black"}, @code{"cyan"}, @code{"green"}, @code{"magenta"}, |
|
846 @code{"red"}, @code{"white"}, and @code{"yellow"}. |
|
847 |
|
848 @node Line Styles |
|
849 @subsection Line Styles |
|
850 Line styles are specified by the folowing properties: |
|
851 |
|
852 @table @code |
|
853 @item linestyle |
|
854 May be one of |
|
855 @table @code |
|
856 @item "-" |
|
857 Solid lines. |
|
858 @item "--" |
|
859 Dashed lines. |
|
860 @item ":" |
|
861 Points. |
|
862 @item "-." |
|
863 A dash-dot line. |
|
864 @end table |
|
865 |
|
866 @item linewidth |
|
867 A number specifying the width of the line. The default is 1. A value |
|
868 of 2 is twice as wide as the default, etc. |
|
869 @end table |
|
870 |
|
871 @node Marker Styles |
|
872 @subsection Marker Styles |
|
873 Marker styles are specified by the folowing properties: |
|
874 @table @code |
|
875 @item marker |
|
876 A character indicating a plot marker to be place at each data point, or |
|
877 @code{"none"}, meaning no markers should be displayed. |
|
878 |
|
879 @itemx markeredgecolor |
|
880 The color of the edge around the marker, or @code{"auto"}, meaning that |
|
881 the edge color is the same as the face color. @xref{Colors}. |
|
882 |
|
883 @itemx markerfacecolor |
|
884 The color of the marker, or @code{"none"} to indicate that the marker |
|
885 should not be filled. @xref{Colors}. |
|
886 |
|
887 @itemx markersize |
|
888 A number specifying the size of the marker. The default is 1. A value |
|
889 of 2 is twice as large as the default, etc. |
6888
|
890 @end table |
|
891 |
4167
|
892 @node Interaction with gnuplot |
6888
|
893 @subsection Interaction with @code{gnuplot} |
3428
|
894 |
|
895 @DOCSTRING(gnuplot_binary) |
|
896 |
6331
|
897 @DOCSTRING(gnuplot_use_title_option) |