File: octave_18.html

package info (click to toggle)
octave2.1 1%3A2.1.73-13
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 37,028 kB
  • ctags: 20,874
  • sloc: cpp: 106,508; fortran: 46,978; ansic: 5,720; sh: 4,800; makefile: 3,186; yacc: 3,132; lex: 2,892; lisp: 1,715; perl: 778; awk: 174; exp: 134
file content (1624 lines) | stat: -rw-r--r-- 53,362 bytes parent folder | download | duplicates (2)
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                      "http://www.w3.org/TR/html40/loose.dtd">
<HTML>
<!-- Created on May, 18 2005 by texi2html 1.66 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Many creative people <dev@texi2html.cvshome.org>
Send bugs and suggestions to <users@texi2html.cvshome.org>

-->
<HEAD>
<TITLE>GNU Octave: Plotting</TITLE>

<META NAME="description" CONTENT="GNU Octave: Plotting">
<META NAME="keywords" CONTENT="GNU Octave: Plotting">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.66">

</HEAD>

<BODY LANG="en" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">

<A NAME="SEC138"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_17.html#SEC137"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC139"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_17.html#SEC113"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_19.html#SEC147"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_42.html#SEC245">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H1> 17. Plotting </H1>
<!--docid::SEC138::-->
<P>

All of Octave's plotting functions use <CODE>gnuplot</CODE> to handle the
actual graphics. Most types of plots can be generated using the basic
plotting functions, which are patterned after the equivalent functions
in MATLAB. The use of these functions is generally
straightforward, and is the preferred method for generating plots.
However, for users familiar with <CODE>gnuplot</CODE>, or for some
specialized applications where the basic commands are inadequate,
Octave also provides two low-level functions, <CODE>gplot</CODE> and
<CODE>gsplot</CODE>, that behave almost exactly like the corresponding
<CODE>gnuplot</CODE> functions <CODE>plot</CODE> and <CODE>splot</CODE>. Also note that
some advanced MATLAB features from recent versions are not
implemented, such as handle-graphics and related functions.
</P>
<P>

<TABLE BORDER="0" CELLSPACING="0">
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="octave_18.html#SEC139">17.1 Two-Dimensional Plotting</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="octave_18.html#SEC140">17.2 Specialized Two-Dimensional Plots</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="octave_18.html#SEC141">17.3 Three-Dimensional Plotting</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="octave_18.html#SEC142">17.4 Plot Annotations</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="octave_18.html#SEC143">17.5 Multiple Plots on One Page</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="octave_18.html#SEC144">17.6 Multiple Plot Windows</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="octave_18.html#SEC145">17.7 Low-Level plotting commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="octave_18.html#SEC146">17.8 Interaction with <CODE>gnuplot</CODE></A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
</TABLE>
<P>

<A NAME="Two-Dimensional Plotting"></A>
<HR SIZE="6">
<A NAME="SEC139"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC138"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC140"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC138"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC138"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_19.html#SEC147"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_42.html#SEC245">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 17.1 Two-Dimensional Plotting </H2>
<!--docid::SEC139::-->
<P>

The MATLAB-style two-dimensional plotting commands are:
</P>
<P>

<A NAME="IDX476"></A>
<A NAME="IDX477"></A>
</P>
<P>

<A NAME="doc-plot"></A>
<A NAME="IDX478"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>plot</B> <I>(<VAR>args</VAR>)</I>
<DD>This function produces two-dimensional plots.  Many different
combinations of arguments are possible.  The simplest form is
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>plot (<VAR>y</VAR>)
</pre></td></tr></table><P>

where the argument is taken as the set of <VAR>y</VAR> coordinates and the
<VAR>x</VAR> coordinates are taken to be the indices of the elements,
starting with 1.
</P>
<P>

If more than one argument is given, they are interpreted as
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>plot (<VAR>x</VAR>, <VAR>y</VAR>, <VAR>fmt</VAR> ...)
</pre></td></tr></table><P>

where <VAR>y</VAR> and <VAR>fmt</VAR> are optional, and any number of argument
sets may appear.  The <VAR>x</VAR> and <VAR>y</VAR> values are
interpreted as follows:
</P>
<P>

<UL>
<LI>
If a single data argument is supplied, it is taken as the set of <VAR>y</VAR>
coordinates and the <VAR>x</VAR> coordinates are taken to be the indices of
the elements, starting with 1.
<P>

</P>
<LI>
If the first argument is a vector and the second is a matrix, the
the vector is plotted versus the columns (or rows) of the matrix.
(using whichever combination matches, with columns tried first.)
<P>

</P>
<LI>
If the first argument is a matrix and the second is a vector, the
the columns (or rows) of the matrix are plotted versus the vector.
(using whichever combination matches, with columns tried first.)
<P>

</P>
<LI>
If both arguments are vectors, the elements of <VAR>y</VAR> are plotted versus
the elements of <VAR>x</VAR>.
<P>

</P>
<LI>
If both arguments are matrices, the columns of <VAR>y</VAR> are plotted
versus the columns of <VAR>x</VAR>.  In this case, both matrices must have
the same number of rows and columns and no attempt is made to transpose
the arguments to make the number of rows match.
<P>

If both arguments are scalars, a single point is plotted.
</UL>
<P>

If the <VAR>fmt</VAR> argument is supplied, it is interpreted as
follows.  If <VAR>fmt</VAR> is missing, the default gnuplot line style
is assumed.
</P>
<P>

</P>
<DL COMPACT>
<DT>`<SAMP>-</SAMP>'
<DD>Set lines plot style (default).
<P>

</P>
<DT>`<SAMP>.</SAMP>'
<DD>Set dots plot style.
<P>

</P>
<DT>`<SAMP>@</SAMP>'
<DD>Set points plot style.
<P>

</P>
<DT>`<SAMP>-@</SAMP>'
<DD>Set linespoints plot style.
<P>

</P>
<DT>`<SAMP>^</SAMP>'
<DD>Set impulses plot style.
<P>

</P>
<DT>`<SAMP>L</SAMP>'
<DD>Set steps plot style.
<P>

</P>
<DT>`<SAMP><VAR>n</VAR></SAMP>'
<DD>Interpreted as the plot color if <VAR>n</VAR> is an integer in the range 1 to
6.
<P>

</P>
<DT>`<SAMP><VAR>nm</VAR></SAMP>'
<DD>If <VAR>nm</VAR> is a two digit integer and <VAR>m</VAR> is an integer in the
range 1 to 6, <VAR>m</VAR> is interpreted as the point style.  This is only
valid in combination with the <CODE>@</CODE> or <CODE>-@</CODE> specifiers.
<P>

</P>
<DT>`<SAMP><VAR>c</VAR></SAMP>'
<DD>If <VAR>c</VAR> is one of <CODE>&quot;r&quot;</CODE>, <CODE>&quot;g&quot;</CODE>, <CODE>&quot;b&quot;</CODE>, <CODE>&quot;m&quot;</CODE>,
<CODE>&quot;c&quot;</CODE>, or <CODE>&quot;w&quot;</CODE>, it is interpreted as the plot color (red,
green, blue, magenta, cyan, or white).
<P>

</P>
<DT>`<SAMP>&quot;;title;&quot;</SAMP>'
<DD>Here <CODE>&quot;title&quot;</CODE> is the label for the key.
<P>

</P>
<DT>`<SAMP>+</SAMP>'
<DD><DT>`<SAMP>*</SAMP>'
<DD><DT>`<SAMP>o</SAMP>'
<DD><DT>`<SAMP>x</SAMP>'
<DD>Used in combination with the points or linespoints styles, set the point
style.
</DL>
<P>

The color line styles have the following meanings on terminals that
support color.
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>Number  Gnuplot colors  (lines)points style
  1       red                   *
  2       green                 +
  3       blue                  o
  4       magenta               x
  5       cyan                house
  6       brown            there exists
</pre></td></tr></table><P>

The <VAR>fmt</VAR> argument can also be used to assign key titles.
To do so, include the desired title between semi-colons after the
formatting sequence described above, e.g. &quot;+3;Key Title;&quot;
Note that the last semi-colon is required and will generate an error if
it is left out.
</P>
<P>

Here are some plot examples:
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>plot (x, y, &quot;@12&quot;, x, y2, x, y3, &quot;4&quot;, x, y4, &quot;+&quot;)
</pre></td></tr></table><P>

This command will plot <CODE>y</CODE> with points of type 2 (displayed as
`<SAMP>+</SAMP>') and color 1 (red), <CODE>y2</CODE> with lines, <CODE>y3</CODE> with lines of
color 4 (magenta) and <CODE>y4</CODE> with points displayed as `<SAMP>+</SAMP>'.
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>plot (b, &quot;*&quot;)
</pre></td></tr></table><P>

This command will plot the data in the variable <CODE>b</CODE> will be plotted
with points displayed as `<SAMP>*</SAMP>'.
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>t = 0:0.1:6.3;
plot (t, cos(t), &quot;-;cos(t);&quot;, t, sin(t), &quot;+3;sin(t);&quot;);
</pre></td></tr></table><P>

This will plot the cosine and sine functions and label them accordingly
in the key.
</P>
</DL>
<P>

<A NAME="doc-hold"></A>
<A NAME="IDX479"></A>
</P>
<DL>
<DT><U>Built-in Function:</U>  <B>hold</B> <I><VAR>args</VAR></I>
<DD>Tell Octave to `hold' the current data on the plot when executing
subsequent plotting commands.  This allows you to execute a series of
plot commands and have all the lines end up on the same figure.  The
default is for each new plot command to clear the plot device first.
For example, the command
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>hold on
</pre></td></tr></table><P>

turns the hold state on.  An argument of <CODE>off</CODE> turns the hold state
off, and <CODE>hold</CODE> with no arguments toggles the current hold state.
</P>
</DL>
<P>

<A NAME="doc-ishold"></A>
<A NAME="IDX480"></A>
</P>
<DL>
<DT><U>Built-in Function:</U>  <B>ishold</B>
<DD>Return 1 if the next line will be added to the current plot, or 0 if
the plot device will be cleared before drawing the next line.
</DL>
<P>

<A NAME="doc-clearplot"></A>
<A NAME="IDX481"></A>
</P>
<DL>
<DT><U>Built-in Function:</U>  <B>clearplot</B>
<DD><A NAME="IDX482"></A>
<DT><U>Built-in Function:</U>  <B>clg</B>
<DD>Clear the plot window and any titles or axis labels.  The name
<CODE>clg</CODE> is aliased to <CODE>clearplot</CODE> for compatibility with
MATLAB.
<P>

The commands <KBD>gplot clear</KBD>, <KBD>gsplot clear</KBD>, and <KBD>replot
clear</KBD> are equivalent to <CODE>clearplot</CODE>.  (Previously, commands like
<KBD>gplot clear</KBD> would evaluate <CODE>clear</CODE> as an ordinary expression
and clear all the visible variables.)
</P>
</DL>
<P>

<A NAME="doc-shg"></A>
<A NAME="IDX483"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>shg</B>
<DD><P>

Show the graph window.  Currently, this is the same as executing
replot.
</P>
<P>

</P>
</DL>
<P>

<A NAME="doc-closeplot"></A>
<A NAME="IDX484"></A>
</P>
<DL>
<DT><U>Built-in Function:</U>  <B>closeplot</B>
<DD>Close stream to the <CODE>gnuplot</CODE> subprocess.  If you are using X11,
this will close the plot window.
</DL>
<P>

<A NAME="doc-purge_tmp_files"></A>
<A NAME="IDX485"></A>
</P>
<DL>
<DT><U>Built-in Function:</U>  <B>purge_tmp_files</B>
<DD>Delete the temporary files created by the plotting commands.
<P>

Octave creates temporary data files for <CODE>gnuplot</CODE> and then sends
commands to <CODE>gnuplot</CODE> through a pipe.  Octave will delete the
temporary files on exit, but if you are doing a lot of plotting you may
want to clean up in the middle of a session.
</P>
<P>

A future version of Octave will eliminate the need to use temporary
files to hold the plot data.
</P>
</DL>
<P>

<A NAME="doc-axis"></A>
<A NAME="IDX486"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>axis</B> <I>(<VAR>limits</VAR>)</I>
<DD>Set axis limits for plots.
<P>

The argument <VAR>limits</VAR> should be a 2, 4, or 6 element vector.  The
first and second elements specify the lower and upper limits for the x
axis.  The third and fourth specify the limits for the y axis, and the
fifth and sixth specify the limits for the z axis.
</P>
<P>

Without any arguments, <CODE>axis</CODE> turns autoscaling on.  
</P>
<P>

With one output argument, <CODE>x=axis</CODE> returns the current axes 
(this is not yet implemented for automatic axes).
</P>
<P>

The vector argument specifying limits is optional, and additional
string arguments may be used to specify various axis properties.  For
example,
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>axis ([1, 2, 3, 4], &quot;square&quot;);
</pre></td></tr></table><P>

forces a square aspect ratio, and
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>axis (&quot;labely&quot;, &quot;tic&quot;);
</pre></td></tr></table><P>

turns tic marks on for all axes and tic mark labels on for the y-axis
only.
</P>
<P>

The following options control the aspect ratio of the axes.
</P>
<P>

</P>
<DL COMPACT>
<DT><CODE>&quot;square&quot;</CODE>
<DD>Force a square aspect ratio.
<DT><CODE>&quot;equal&quot;</CODE>
<DD>Force x distance to equal y-distance.
<DT><CODE>&quot;normal&quot;</CODE>
<DD>Restore the balance.
</DL>
<P>

The following options control the way axis limits are interpreted.
</P>
<P>

</P>
<DL COMPACT>
<DT><CODE>&quot;auto&quot;</CODE>
<DD>Set the specified axes to have nice limits around the data
or all if no axes are specified.
<DT><CODE>&quot;manual&quot;</CODE>
<DD>Fix the current axes limits.
<DT><CODE>&quot;tight&quot;</CODE>
<DD>Fix axes to the limits of the data (not implemented).
</DL>
<P>

The option <CODE>&quot;image&quot;</CODE> is equivalent to <CODE>&quot;tight&quot;</CODE> and
<CODE>&quot;equal&quot;</CODE>.
</P>
<P>

The following options affect the appearance of tic marks.
</P>
<P>

</P>
<DL COMPACT>
<DT><CODE>&quot;on&quot;</CODE>
<DD>Turn tic marks and labels on for all axes.
<DT><CODE>&quot;off&quot;</CODE>
<DD>Turn tic marks off for all axes.
<DT><CODE>&quot;tic[xyz]&quot;</CODE>
<DD>Turn tic marks on for all axes, or turn them on for the
specified axes and off for the remainder.
<DT><CODE>&quot;label[xyz]&quot;</CODE>
<DD>Turn tic labels on for all axes, or turn them on for the 
specified axes and off for the remainder.
<DT><CODE>&quot;nolabel&quot;</CODE>
<DD>Turn tic labels off for all axes.
</DL>
Note, if there are no tic marks for an axis, there can be no labels.
<P>

The following options affect the direction of increasing values on
the axes.
</P>
<P>

</P>
<DL COMPACT>
<DT><CODE>&quot;ij&quot;</CODE>
<DD>Reverse y-axis, so lower values are nearer the top.
<DT><CODE>&quot;xy&quot;</CODE>
<DD>Restore y-axis, so higher values are nearer the top. 
</DL>
<P>

</P>
</DL>
<P>

<A NAME="Specialized Two-Dimensional Plots"></A>
<HR SIZE="6">
<A NAME="SEC140"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC139"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC141"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC138"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC138"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_19.html#SEC147"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_42.html#SEC245">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 17.2 Specialized Two-Dimensional Plots </H2>
<!--docid::SEC140::-->
<P>

<A NAME="doc-bar"></A>
<A NAME="IDX487"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>bar</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>)</I>
<DD>Given two vectors of x-y data, <CODE>bar</CODE> produces a bar graph.
<P>

If only one argument is given, it is taken as a vector of y-values
and the x coordinates are taken to be the indices of the elements.
</P>
<P>

If two output arguments are specified, the data are generated but
not plotted.  For example,
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>bar (x, y);
</pre></td></tr></table><P>

and
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>[xb, yb] = bar (x, y);
plot (xb, yb);
</pre></td></tr></table><P>

are equivalent.
</P>
</DL>
<P>

<A NAME="doc-contour"></A>
<A NAME="IDX488"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>contour</B> <I>(<VAR>z</VAR>, <VAR>n</VAR>)</I>
<DD><A NAME="IDX489"></A>
<DT><U>Function File:</U>  <B>contour</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>, <VAR>z</VAR>, <VAR>n</VAR>)</I>
<DD>Make a contour plot of the three-dimensional surface described by
<VAR>z</VAR>.  Someone needs to improve <CODE>gnuplot</CODE>'s contour routines
before this will be very useful.
</DL>
<P>

<A NAME="doc-hist"></A>
<A NAME="IDX490"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>hist</B> <I>(<VAR>y</VAR>, <VAR>x</VAR>, <VAR>norm</VAR>)</I>
<DD>Produce histogram counts or plots.
<P>

With one vector input argument, plot a histogram of the values with
10 bins.  The range of the histogram bins is determined by the range
of the data.
</P>
<P>

Given a second scalar argument, use that as the number of bins.
</P>
<P>

Given a second vector argument, use that as the centers of the bins,
with the width of the bins determined from the adjacent values in
the vector.
</P>
<P>

If third argument is provided, the histogram is normalised such that
the sum of the bars is equal to <VAR>norm</VAR>.
</P>
<P>

Extreme values are lumped in the first and last bins.
</P>
<P>

With two output arguments, produce the values <VAR>nn</VAR> and <VAR>xx</VAR> such
that <CODE>bar (<VAR>xx</VAR>, <VAR>nn</VAR>)</CODE> will plot the histogram.
</P>
</DL>
<P>

<A NAME="doc-loglog"></A>
<A NAME="IDX491"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>loglog</B> <I>(<VAR>args</VAR>)</I>
<DD>Make a two-dimensional plot using log scales for both axes.  See the
description of <CODE>plot</CODE> for a description of the arguments that
<CODE>loglog</CODE> will accept.
</DL>
<P>

<A NAME="doc-polar"></A>
<A NAME="IDX492"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>polar</B> <I>(<VAR>theta</VAR>, <VAR>rho</VAR>, <VAR>fmt</VAR>)</I>
<DD>Make a two-dimensional plot given polar the coordinates <VAR>theta</VAR> and
<VAR>rho</VAR>.
<P>

The optional third argument specifies the line type.
</P>
</DL>
<P>

<A NAME="doc-semilogx"></A>
<A NAME="IDX493"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>semilogx</B> <I>(<VAR>args</VAR>)</I>
<DD>Make a two-dimensional plot using a log scale for the <VAR>x</VAR> axis.  See
the description of <CODE>plot</CODE> for a description of the arguments
that <CODE>semilogx</CODE> will accept.
</DL>
<P>

<A NAME="doc-semilogy"></A>
<A NAME="IDX494"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>semilogy</B> <I>(<VAR>args</VAR>)</I>
<DD>Make a two-dimensional plot using a log scale for the <VAR>y</VAR> axis.  See
the description of <CODE>plot</CODE> for a description of the arguments
that <CODE>semilogy</CODE> will accept.
</DL>
<P>

<A NAME="doc-stairs"></A>
<A NAME="IDX495"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>stairs</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>)</I>
<DD>Given two vectors of x-y data, bar produces a `stairstep' plot.
<P>

If only one argument is given, it is taken as a vector of y-values
and the x coordinates are taken to be the indices of the elements.
</P>
<P>

If two output arguments are specified, the data are generated but
not plotted.  For example,
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>stairs (x, y);
</pre></td></tr></table><P>

and
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>[xs, ys] = stairs (x, y);
plot (xs, ys);
</pre></td></tr></table><P>

are equivalent.
</P>
</DL>
<P>

<A NAME="doc-errorbar"></A>
<A NAME="IDX496"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>errorbar</B> <I>(<VAR>args</VAR>)</I>
<DD>This function produces two-dimensional plots with errorbars. Many
different combinations of arguments are possible.  The simplest form is
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>errorbar (<VAR>y</VAR>, <VAR>ey</VAR>)
</pre></td></tr></table><P>

where the first argument is taken as the set of <VAR>y</VAR> coordinates
and the second argument <VAR>ey</VAR> is taken as the errors of the
<VAR>y</VAR> values. <VAR>x</VAR> coordinates are taken to be the indices
of the elements, starting with 1.
</P>
<P>

If more than two arguments are given, they are interpreted as
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>errorbar (<VAR>x</VAR>, <VAR>y</VAR>, ..., <VAR>fmt</VAR> ...)
</pre></td></tr></table><P>

where after <VAR>x</VAR> and <VAR>y</VAR> there can be up to four error
parameters such as <VAR>ey</VAR>, <VAR>ex</VAR>, <VAR>ly</VAR>, <VAR>uy</VAR> etc.,
depending on the plot type. Any number of argument sets may appear,
as long as they are separated with a format string <VAR>fmt</VAR>.
</P>
<P>

If <VAR>y</VAR> is a matrix, <VAR>x</VAR> and error parameters must also be matrices
having same dimensions. The columns of <VAR>y</VAR> are plotted versus the
corresponding columns of <VAR>x</VAR> and errorbars are drawn from
the corresponding columns of error parameters.
</P>
<P>

If <VAR>fmt</VAR> is missing, yerrorbars (&quot;~&quot;) plot style
is assumed.
If the <VAR>fmt</VAR> argument is supplied, it is interpreted as in
normal plots (See __pltopt__). In addition the following
plot styles are supported by errorbar:
</P>
<P>

</P>
<DL COMPACT>
<DT>`<SAMP>~</SAMP>'
<DD>Set yerrorbars plot style (default).
<P>

</P>
<DT>`<SAMP>&gt;</SAMP>'
<DD>Set xerrorbars plot style.
<P>

</P>
<DT>`<SAMP>~&gt;</SAMP>'
<DD>Set xyerrorbars plot style.
<P>

</P>
<DT>`<SAMP>#</SAMP>'
<DD>Set boxes plot style.
<P>

</P>
<DT>`<SAMP>#~</SAMP>'
<DD>Set boxerrorbars plot style.
<P>

</P>
<DT>`<SAMP>#~&gt;</SAMP>'
<DD>Set boxxyerrorbars plot style.
<P>

</DL>
<P>

Examples:
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>errorbar(<VAR>x</VAR>, <VAR>y</VAR>, <VAR>ex</VAR>, &quot;&gt;&quot;)
</pre></td></tr></table><P>

xerrorbar plot of <VAR>y</VAR> versus <VAR>x</VAR> with <VAR>x</VAR> errorbars drawn from
<VAR>x</VAR>-<VAR>ex</VAR> to <VAR>x</VAR>+<VAR>ex</VAR>.
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>errorbar(<VAR>x</VAR>, <VAR>y1</VAR>, <VAR>ey</VAR>, &quot;~&quot;, <VAR>x</VAR>, <VAR>y2</VAR>, <VAR>ly</VAR>, <VAR>uy</VAR>)
</pre></td></tr></table><P>

Two yerrorbar plots with <VAR>y1</VAR> and <VAR>y2</VAR> versus <VAR>x</VAR>.
Errorbars for <VAR>y1</VAR> are drawn from <VAR>y1</VAR>-<VAR>ey</VAR> to
<VAR>y1</VAR>+<VAR>ey</VAR>, errorbars for <VAR>y2</VAR> from <VAR>y2</VAR>-<VAR>ly</VAR> to
<VAR>y2</VAR>+<VAR>uy</VAR>.
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>errorbar(<VAR>x</VAR>, <VAR>y</VAR>, <VAR>lx</VAR>, <VAR>ux</VAR>, <VAR>ly</VAR>, <VAR>uy</VAR>, &quot;~&gt;&quot;)
</pre></td></tr></table><P>

xyerrorbar plot of <VAR>y</VAR> versus <VAR>x</VAR> where <VAR>x</VAR> errorbars
are drawn from <VAR>x</VAR>-<VAR>lx</VAR> to <VAR>x</VAR>+<VAR>ux</VAR> and <VAR>y</VAR> errorbars
from <VAR>y</VAR>-<VAR>ly</VAR> to <VAR>y</VAR>+<VAR>uy</VAR>.
</P>
<P>

</P>
</DL>
<P>

<A NAME="doc-loglogerr"></A>
<A NAME="IDX497"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>loglogerr</B> <I>(<VAR>args</VAR>)</I>
<DD>This function produces two-dimensional plots on double logarithm axis 
with errorbars. Many different combinations of arguments are possible.  
The most used form is
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>loglogerr (<VAR>x</VAR>, <VAR>y</VAR>, <VAR>ey</VAR>, <VAR>fmt</VAR>)
</pre></td></tr></table><P>

which produces a double logarithm plot of <VAR>y</VAR> versus <VAR>x</VAR> 
with errors in the <VAR>y</VAR>-scale defined by <VAR>ey</VAR> and the plot
format defined by <VAR>fmt</VAR>. See errorbar for available formats and 
additional information.
</P>
<P>

</P>
</DL>
<P>

<A NAME="doc-semilogxerr"></A>
<A NAME="IDX498"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>semilogxerr</B> <I>(<VAR>args</VAR>)</I>
<DD>This function produces two-dimensional plots on a semilogarithm axis 
with errorbars. Many different combinations of arguments are possible.  
The most used form is
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>semilogxerr (<VAR>x</VAR>, <VAR>y</VAR>, <VAR>ey</VAR>, <VAR>fmt</VAR>)
</pre></td></tr></table><P>

which produces a semi-logarithm plot of <VAR>y</VAR> versus <VAR>x</VAR>
with errors in the <VAR>y</VAR>-scale defined by <VAR>ey</VAR> and the plot
format defined by <VAR>fmt</VAR>. See errorbar for available formats and 
additional information.
</P>
<P>

</P>
</DL>
<P>

<A NAME="doc-semilogyerr"></A>
<A NAME="IDX499"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>semilogyerr</B> <I>(<VAR>args</VAR>)</I>
<DD>This function produces two-dimensional plots on a semilogarithm axis 
with errorbars. Many different combinations of arguments are possible.  
The most used form is
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>semilogyerr (<VAR>x</VAR>, <VAR>y</VAR>, <VAR>ey</VAR>, <VAR>fmt</VAR>)
</pre></td></tr></table><P>

which produces a semi-logarithm plot of <VAR>y</VAR> versus <VAR>x</VAR>
with errors in the <VAR>y</VAR>-scale defined by <VAR>ey</VAR> and the plot
format defined by <VAR>fmt</VAR>. See errorbar for available formats and 
additional information.
</P>
<P>

</P>
</DL>
<P>

<A NAME="Three-Dimensional Plotting"></A>
<HR SIZE="6">
<A NAME="SEC141"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC140"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC142"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC138"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC138"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_19.html#SEC147"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_42.html#SEC245">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 17.3 Three-Dimensional Plotting </H2>
<!--docid::SEC141::-->
<P>

The MATLAB-style three-dimensional plotting commands are:
</P>
<P>

<A NAME="doc-mesh"></A>
<A NAME="IDX500"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>mesh</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>, <VAR>z</VAR>)</I>
<DD>Plot a mesh given matrices <VAR>x</VAR>, and <VAR>y</VAR> from <CODE>meshdom</CODE> and
a matrix <VAR>z</VAR> corresponding to the <VAR>x</VAR> and <VAR>y</VAR> coordinates of
the mesh.  If <VAR>x</VAR> and <VAR>y</VAR> are vectors, then a typical vertex
is (<VAR>x</VAR>(j), <VAR>y</VAR>(i), <VAR>z</VAR>(i,j)).  Thus, columns of <VAR>z</VAR>
correspond to different <VAR>x</VAR> values and rows of <VAR>z</VAR> correspond
to different <VAR>y</VAR> values.
</DL>
<P>

<A NAME="doc-meshgrid"></A>
<A NAME="IDX501"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>xx</VAR>, <VAR>yy</VAR>] = <B>meshgrid</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>)</I>
<DD><A NAME="IDX502"></A>
<DT><U>Function File:</U> [<VAR>xx</VAR>, <VAR>yy</VAR>] = <B>meshgrid</B> <I>(<VAR>x</VAR>)</I>
<DD>Given vectors of <VAR>x</VAR> and <VAR>y</VAR> coordinates, return two matrices corresponding
to the <VAR>x</VAR> and <VAR>y</VAR> coordinates of a mesh.  The rows of <VAR>xx</VAR> are copies of <VAR>x</VAR>,
and the columns of <VAR>yy</VAR> are copies of <VAR>y</VAR>.
</DL>
<P>

<A NAME="doc-meshdom"></A>
<A NAME="IDX503"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>meshdom</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>)</I>
<DD>Given vectors of <VAR>x</VAR> and <VAR>y</VAR> coordinates, return two matrices
corresponding to the <VAR>x</VAR> and <VAR>y</VAR> coordinates of the mesh.
<P>

Note: this function is provided for compatibility with older versions
of MATLAB.  You should use <CODE>meshgrid</CODE> instead.
</P>
</DL>
<P>

<A NAME="Plot Annotations"></A>
<HR SIZE="6">
<A NAME="SEC142"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC141"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC143"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC138"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC138"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_19.html#SEC147"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_42.html#SEC245">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 17.4 Plot Annotations </H2>
<!--docid::SEC142::-->
<P>

<A NAME="doc-grid"></A>
<A NAME="IDX504"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>grid</B> <I>(<VAR>arg</VAR>)</I>
<DD>For two-dimensional plotting, force the display of a grid on the plot.
The argument may be either <CODE>&quot;on&quot;</CODE> or <CODE>&quot;off&quot;</CODE>.  If it is
omitted, <CODE>&quot;on&quot;</CODE> is assumed.
</DL>
<P>

<A NAME="doc-title"></A>
<A NAME="IDX505"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>title</B> <I>(<VAR>string</VAR>)</I>
<DD>Specify a title for a plot.
</DL>
<P>

<A NAME="doc-xlabel"></A>
<A NAME="IDX506"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>xlabel</B> <I>(<VAR>string</VAR>)</I>
<DD><A NAME="IDX507"></A>
<DT><U>Function File:</U>  <B>ylabel</B> <I>(<VAR>string</VAR>)</I>
<DD><A NAME="IDX508"></A>
<DT><U>Function File:</U>  <B>zlabel</B> <I>(<VAR>string</VAR>)</I>
<DD>Specify x, y, and z axis labels for the plot.  If you already have a plot
displayed, use the command <CODE>replot</CODE> to redisplay it with the new
labels.
</DL>
<P>

<A NAME="doc-top_title"></A>
<A NAME="IDX509"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>top_title</B> <I>(<VAR>string</VAR>)</I>
<DD><A NAME="IDX510"></A>
<DT><U>Function File:</U>  <B>bottom_title</B> <I>(<VAR>string</VAR>)</I>
<DD>Makes a title with text <VAR>string</VAR> at the top (bottom) of the plot.
</DL>
<P>

<A NAME="Multiple Plots on One Page"></A>
<HR SIZE="6">
<A NAME="SEC143"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC142"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC144"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC138"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC138"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_19.html#SEC147"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_42.html#SEC245">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 17.5 Multiple Plots on One Page </H2>
<!--docid::SEC143::-->
<P>

The following functions all require a version of <CODE>gnuplot</CODE> that
supports the multiplot feature.
</P>
<P>

<A NAME="doc-mplot"></A>
<A NAME="IDX511"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>mplot</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>)</I>
<DD><A NAME="IDX512"></A>
<DT><U>Function File:</U>  <B>mplot</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>, <VAR>fmt</VAR>)</I>
<DD><A NAME="IDX513"></A>
<DT><U>Function File:</U>  <B>mplot</B> <I>(<VAR>x1</VAR>, <VAR>y1</VAR>, <VAR>x2</VAR>, <VAR>y2</VAR>)</I>
<DD>This is a modified version of the <CODE>plot</CODE> function that works with
the multiplot version of <CODE>gnuplot</CODE> to plot multiple plots per page.
This plot version automatically advances to the next subplot position
after each set of arguments are processed.
<P>

See the description of the <VAR>plot</VAR> function for the various options.
</P>
</DL>
<P>

<A NAME="doc-multiplot"></A>
<A NAME="IDX514"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>multiplot</B> <I>(<VAR>xn</VAR>, <VAR>yn</VAR>)</I>
<DD>Sets and resets multiplot mode.
<P>

If the arguments are non-zero, <CODE>multiplot</CODE> will set up multiplot
mode with <VAR>xn</VAR>, <VAR>yn</VAR> subplots along the <VAR>x</VAR> and <VAR>y</VAR>
axes.  If both arguments are zero, <CODE>multiplot</CODE> closes multiplot
mode.
</P>
</DL>
<P>

<A NAME="doc-oneplot"></A>
<A NAME="IDX515"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>oneplot</B> <I>()</I>
<DD>If in multiplot mode, switches to single plot mode.
</DL>
<P>

<A NAME="doc-plot_border"></A>
<A NAME="IDX516"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>plot_border</B> <I>(...)</I>
<DD>Multiple arguments allowed to specify the sides on which the border
is shown.  Allowed arguments include:
<P>

</P>
<DL COMPACT>
<DT><CODE>&quot;blank&quot;</CODE>
<DD>No borders displayed.
<P>

</P>
<DT><CODE>&quot;all&quot;</CODE>
<DD>All borders displayed
<P>

</P>
<DT><CODE>&quot;north&quot;</CODE>
<DD>North Border
<P>

</P>
<DT><CODE>&quot;south&quot;</CODE>
<DD>South Border
<P>

</P>
<DT><CODE>&quot;east&quot;</CODE>
<DD>East Border
<P>

</P>
<DT><CODE>&quot;west&quot;</CODE>
<DD>West Border
</DL>
<P>

The arguments may be abbreviated to single characters.  Without any
arguments, <CODE>plot_border</CODE> turns borders off.
</P>
</DL>
<P>

<A NAME="doc-subplot"></A>
<A NAME="IDX517"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>subplot</B> <I>(<VAR>rows</VAR>, <VAR>cols</VAR>, <VAR>index</VAR>)</I>
<DD><A NAME="IDX518"></A>
<DT><U>Function File:</U>  <B>subplot</B> <I>(<VAR>rcn</VAR>)</I>
<DD>Sets <CODE>gnuplot</CODE> in multiplot mode and plots in location
given by index (there are <VAR>cols</VAR> by <VAR>rows</VAR> subwindows).
<P>

The global variable <VAR>__multiplot_scale__</VAR> should be used when the
command <CODE>__gnuplot_set__ size xsize, ysize</CODE> has been used prior to calling
<CODE>subplot</CODE>.
</P>
<P>

The value of <VAR>__multiplot_scale__</VAR> should be a vector with two
elements, the first set equal to <VAR>xsize</VAR> and the second to
<VAR>ysize</VAR>.
</P>
<P>

Input:
</P>
<P>

</P>
<DL COMPACT>
<DT><VAR>rows</VAR>
<DD>Number of rows in subplot grid.
<P>

</P>
<DT><VAR>columns</VAR>
<DD>Number of columns in subplot grid.
<P>

</P>
<DT><VAR>index</VAR>
<DD>Index of subplot where to make the next plot.
</DL>
<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>
<P>

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

For example, a plot with 4 by 2 grid will have plot indices running as
follows:
<TABLE><tr><td>&nbsp;</td><td class=display><pre style="font-family: serif">+-----+-----+-----+-----+
|  1  |  2  |  3  |  4  |
+-----+-----+-----+-----+
|  5  |  6  |  7  |  8  |
+-----+-----+-----+-----+
</pre></td></tr></table></DL>
<P>

<A NAME="doc-subwindow"></A>
<A NAME="IDX519"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>subwindow</B> <I>(<VAR>xn</VAR>, <VAR>yn</VAR>)</I>
<DD>Sets the subwindow position in multiplot mode for the next plot.  The
multiplot mode has to be previously initialized using the
<CODE>multiplot</CODE> function, otherwise this command just becomes an alias
to <CODE>multiplot</CODE>
</DL>
<P>

<A NAME="Multiple Plot Windows"></A>
<HR SIZE="6">
<A NAME="SEC144"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC143"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC145"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC138"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC138"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_19.html#SEC147"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_42.html#SEC245">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 17.6 Multiple Plot Windows </H2>
<!--docid::SEC144::-->
<P>

<A NAME="doc-figure"></A>
<A NAME="IDX520"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>figure</B> <I>(<VAR>n</VAR>)</I>
<DD>Set the current plot window to plot window <VAR>n</VAR>.  This function
currently requires X11 and a version of gnuplot that supports multiple
frames.  If <VAR>n</VAR> is not specified, the next available window
number is chosen.
</DL>
<P>

<A NAME="Low-Level plotting commands"></A>
<HR SIZE="6">
<A NAME="SEC145"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC144"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC146"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC138"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC138"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_19.html#SEC147"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_42.html#SEC245">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 17.7 Low-Level plotting commands </H2>
<!--docid::SEC145::-->
<P>

<A NAME="IDX521"></A>
</P>
<DL>
<DT><U>Command:</U> <B>gplot</B> <I><VAR>ranges</VAR> <VAR>expression</VAR> <VAR>using</VAR> <VAR>title</VAR> <VAR>style</VAR></I>
<DD>Generate a 2-dimensional plot.
<P>

The <VAR>ranges</VAR>, <VAR>using</VAR>, <VAR>title</VAR>, and <VAR>style</VAR> arguments
are optional, and the <VAR>using</VAR>, <VAR>title</VAR> and <VAR>style</VAR>
qualifiers may appear in any order after the expression.  You may plot
multiple expressions with a single command by separating them with
commas.  Each expression may have its own set of qualifiers.
</P>
<P>

The optional item <VAR>ranges</VAR> has the syntax
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>[ x_lo : x_up ] [ y_lo : y_up ]
</pre></td></tr></table><P>

and may be used to specify the ranges for the axes of the plot,
independent of the actual range of the data.  The range for the y axis
and any of the individual limits may be omitted.  A range <CODE>[:]</CODE>
indicates that the default limits should be used.  This normally means
that a range just large enough to include all the data points will be
used.
</P>
<P>

The expression to be plotted must not contain any literal matrices
(e.g. <CODE>[ 1, 2; 3, 4 ]</CODE>) since it is nearly impossible to
distinguish a plot range from a matrix of data.
</P>
<P>

See the help for <CODE>gnuplot</CODE> for a description of the syntax for the
optional items.
</P>
<P>

By default, the <CODE>gplot</CODE> command plots the second column of a matrix
versus the first.  If the matrix only has one column, it is taken as a
vector of y-coordinates and the x-coordinate is taken as the element
index, starting with zero.  For example,
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>gplot rand (100,1) with linespoints
</pre></td></tr></table><P>

will plot 100 random values and connect them with lines.  When
<CODE>gplot</CODE> is used to plot a column vector, the indices of the
elements are taken as x values.
</P>
<P>

  If there are more than two columns, you can
choose which columns to plot with the <VAR>using</VAR> qualifier. For
example, given the data
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>x = (-10:0.1:10)';
data = [x, sin(x), cos(x)];
</pre></td></tr></table><P>

the command
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>gplot [-11:11] [-1.1:1.1] \
  data with lines, data using 1:3 with impulses
</pre></td></tr></table><P>

will plot two lines.  The first line is generated by the command
<CODE>data with lines</CODE>, and is a graph of the sine function over the
range -10 to 10.  The data is taken from the first two columns of
the matrix because columns to plot were not specified with the
<VAR>using</VAR> qualifier.
</P>
<P>

The clause <CODE>using 1:3</CODE> in the second part of this plot command
specifies that the first and third columns of the matrix <CODE>data</CODE>
should be taken as the values to plot.
</P>
<P>

In this example, the ranges have been explicitly specified to be a bit
larger than the actual range of the data so that the curves do not touch
the border of the plot.
</P>
</DL>
<P>

<A NAME="IDX522"></A>
</P>
<DL>
<DT><U>Command:</U> <B>gsplot</B> <I><VAR>ranges</VAR> <VAR>expression</VAR> <VAR>using</VAR> <VAR>title</VAR> <VAR>style</VAR></I>
<DD>Generate a 3-dimensional plot.
<P>

The <VAR>ranges</VAR>, <VAR>using</VAR>, <VAR>title</VAR>, and <VAR>style</VAR> arguments
are optional, and the <VAR>using</VAR>, <VAR>title</VAR> and <VAR>style</VAR>
qualifiers may appear in any order after the expression.  You may plot
multiple expressions with a single command by separating them with
commas.  Each expression may have its own set of qualifiers.
</P>
<P>

The optional item <VAR>ranges</VAR> has the syntax
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>[ x_lo : x_up ] [ y_lo : y_up ] [ z_lo : z_up ]
</pre></td></tr></table><P>

and may be used to specify the ranges for the axes of the plot,
independent of the actual range of the data.  The range for the y and z
axes and any of the individual limits may be omitted.  A range
<CODE>[:]</CODE> indicates that the default limits should be used.  This
normally means that a range just large enough to include all the data
points will be used.
</P>
<P>

The expression to be plotted must not contain any literal matrices (e.g.
<CODE>[ 1, 2; 3, 4 ]</CODE>) since it is nearly impossible to distinguish a
plot range from a matrix of data.
</P>
<P>

See the help for <CODE>gnuplot</CODE> for a description of the syntax for the
optional items.
</P>
<P>

By default, the <CODE>gsplot</CODE> command plots each column of the
expression as the z value, using the row index as the x value, and the
column index as the y value.  The indices are counted from zero, not
one.  For example,
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>gsplot rand (5, 2)
</pre></td></tr></table><P>

will plot a random surface, with the x and y values taken from the row
and column indices of the matrix.
</P>
<P>

If parametric plotting mode is set (using the command
<KBD>gset parametric</KBD>, then <CODE>gsplot</CODE> takes the columns of the
matrix three at a time as the x, y and z values that define a line in
three space.  Any extra columns are ignored, and the x and y values are
expected to be sorted.  For example, with <CODE>parametric</CODE> set, it
makes sense to plot a matrix like
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>1 1 3 2 1 6 3 1 9
1 2 2 2 2 5 3 2 8
1 3 1 2 3 4 3 3 7
</pre></td></tr></table><P>

but not <CODE>rand (5, 30)</CODE>.
</P>
</DL>
<P>

<A NAME="IDX523"></A>
</P>
<DL>
<DT><U>Command:</U> <B>gset</B> <I>options</I>
<DD><A NAME="IDX524"></A>
<DT><U>Command:</U> <B>gshow</B> <I>options</I>
<DD><A NAME="IDX525"></A>
<DT><U>Command:</U> <B>replot</B> <I>options</I>
<DD>In addition to the basic plotting commands, the whole range of
<CODE>gset</CODE> and <CODE>gshow</CODE> commands from <CODE>gnuplot</CODE> are available,
as is <CODE>replot</CODE>.
<P>

<A NAME="IDX526"></A>
<A NAME="IDX527"></A>
Note that in Octave 2.0, the <CODE>set</CODE> and <CODE>show</CODE> commands were
renamed to <CODE>gset</CODE> and <CODE>gshow</CODE> in order to allow for
compatibility with the MATLAB graphics and GUI commands in a future
version of Octave.  (For now, the old <CODE>set</CODE> and <CODE>show</CODE>
commands do work, but they print an annoying warning message to try to
get people to switch to using <CODE>gset</CODE> and <CODE>gshow</CODE>.)
</P>
<P>

The <CODE>gset</CODE> and <CODE>gshow</CODE> commands allow you to set and show
<CODE>gnuplot</CODE> parameters.  For more information about the <CODE>gset</CODE>
and <CODE>gshow</CODE> commands, see the documentation for <CODE>set</CODE> and
<CODE>show</CODE> in the <CODE>gnuplot</CODE> user's guide (also available on line
if you run <CODE>gnuplot</CODE> directly, instead of running it from Octave).
</P>
<P>

The <CODE>replot</CODE> command allows you to force the plot to be
redisplayed.  This is useful if you have changed something about the
plot, such as the title or axis labels.  The <CODE>replot</CODE> command also
accepts the same arguments as <CODE>gplot</CODE> or <CODE>gsplot</CODE> (except for
data ranges) so you can add additional lines to existing plots.  
</P>
<P>

For example,
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>gset term tek40
gset output &quot;/dev/plotter&quot;
gset title &quot;sine with lines and cosine with impulses&quot;
replot &quot;sin (x) w l&quot;
</pre></td></tr></table><P>

will change the terminal type for plotting, add a title to the current
plot, add a graph of
sin (x) 
to the plot, and force the new plot to be
sent to the plot device.  This last step is normally required in order
to update the plot.  This default is reasonable for slow terminals or
hardcopy output devices because even when you are adding additional
lines with a replot command, gnuplot always redraws the entire plot, and
you probably don't want to have a completely new plot generated every
time something as minor as an axis label changes.
</P>
<P>

<A NAME="IDX528"></A>
The command <CODE>shg</CODE> is equivalent to executing <CODE>replot</CODE> without
any arguments.
</P>
</DL>
<P>

Note that NaN values in the plot data are automatically omitted, and
Inf values are converted to a very large value before calling gnuplot.
</P>
<P>

<A NAME="Interaction with gnuplot"></A>
<HR SIZE="6">
<A NAME="SEC146"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC145"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_19.html#SEC147"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC138"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC138"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_19.html#SEC147"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_42.html#SEC245">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 17.8 Interaction with <CODE>gnuplot</CODE> </H2>
<!--docid::SEC146::-->
<P>

<A NAME="doc-gnuplot_binary"></A>
<A NAME="IDX529"></A>
</P>
<DL>
<DT><U>Built-in Variable:</U> <B>gnuplot_binary</B>
<DD>The name of the program invoked by the plot command.  The default value
is <CODE>&quot;gnuplot&quot;</CODE>.  See section <A HREF="octave_38.html#SEC233">C. Installing Octave</A>.
</DL>
<P>

<A NAME="doc-gnuplot_has_frames"></A>
<A NAME="IDX530"></A>
</P>
<DL>
<DT><U>Built-in Variable:</U> <B>gnuplot_has_frames</B>
<DD>If the value of this variable is nonzero, Octave assumes that your copy
of gnuplot has support for multiple frames that is included in recent
3.6beta releases.  Its initial value is determined by configure, but it
can be changed in your startup script or at the command line in case
configure got it wrong, or if you upgrade your gnuplot installation.
</DL>
<P>

<A NAME="doc-gnuplot_command_plot"></A>
<A NAME="IDX531"></A>
</P>
<DL>
<DT><U>Built-in Variable:</U> <B>gnuplot_command_plot</B>
<DD></DL>
<P>

<A NAME="doc-gnuplot_command_replot"></A>
<A NAME="IDX532"></A>
</P>
<DL>
<DT><U>Built-in Variable:</U> <B>gnuplot_command_replot</B>
<DD></DL>
<P>

<A NAME="doc-gnuplot_command_splot"></A>
<A NAME="IDX533"></A>
</P>
<DL>
<DT><U>Built-in Variable:</U> <B>gnuplot_command_splot</B>
<DD></DL>
<P>

<A NAME="doc-gnuplot_command_using"></A>
<A NAME="IDX534"></A>
</P>
<DL>
<DT><U>Built-in Variable:</U> <B>gnuplot_command_using</B>
<DD></DL>
<P>

<A NAME="doc-gnuplot_command_with"></A>
<A NAME="IDX535"></A>
</P>
<DL>
<DT><U>Built-in Variable:</U> <B>gnuplot_command_with</B>
<DD></DL>
<P>

<A NAME="doc-gnuplot_command_axes"></A>
<A NAME="IDX536"></A>
</P>
<DL>
<DT><U>Built-in Variable:</U> <B>gnuplot_command_axes</B>
<DD></DL>
<P>

<A NAME="doc-gnuplot_command_title"></A>
<A NAME="IDX537"></A>
</P>
<DL>
<DT><U>Built-in Variable:</U> <B>gnuplot_command_title</B>
<DD></DL>
<P>

<A NAME="doc-gnuplot_command_end"></A>
<A NAME="IDX538"></A>
</P>
<DL>
<DT><U>Built-in Variable:</U> <B>gnuplot_command_end</B>
<DD></DL>
<P>

<A NAME="Matrix Manipulation"></A>
<HR SIZE="6">
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_18.html#SEC138"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_19.html#SEC147"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_42.html#SEC245">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<BR>
<FONT SIZE="-1">
This document was generated
by <I>John W. Eaton</I> on <I>May, 18 2005</I>
using <A HREF="http://texi2html.cvshome.org"><I>texi2html</I></A>
</FONT>

</BODY>
</HTML>