File: maxima_8.html

package info (click to toggle)
maxima 5.10.0-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 44,268 kB
  • ctags: 17,987
  • sloc: lisp: 152,894; fortran: 14,667; perl: 14,204; tcl: 10,103; sh: 3,376; makefile: 2,202; ansic: 471; awk: 7
file content (1067 lines) | stat: -rw-r--r-- 44,182 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
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- Created on September, 20 2006 by texi2html 1.76 -->
<!--
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>Maxima Manual: 8. Plotting</title>

<meta name="description" content="Maxima Manual: 8. Plotting">
<meta name="keywords" content="Maxima Manual: 8. Plotting">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.76">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
body
{
    color: black;
    background: white; 
    margin-left: 8%;
    margin-right: 13%;
}

h1
{
    margin-left: +8%;
    font-size: 150%;
    font-family: sans-serif
}

h2
{
    font-size: 125%;
    font-family: sans-serif
}

h3
{
    font-size: 100%;
    font-family: sans-serif
}

h2,h3,h4,h5,h6 { margin-left: +4%; }

div.textbox
{
    border: solid;
    border-width: thin;
    /* width: 100%; */
    padding-top: 1em;
    padding-bottom: 1em;
    padding-left: 2em;
    padding-right: 2em
}

div.titlebox
{
    border: none;
    padding-top: 1em;
    padding-bottom: 1em;
    padding-left: 2em;
    padding-right: 2em;
    background: rgb(200,255,255);
    font-family: sans-serif
}

div.synopsisbox
{
    border: none;
    padding-top: 1em;
    padding-bottom: 1em;
    padding-left: 2em;
    padding-right: 2em;
     background: rgb(255,220,255);
    /*background: rgb(200,255,255); */
    /* font-family: fixed */
}

pre.example
{
    border: none;
    padding-top: 1em;
    padding-bottom: 1em;
    padding-left: 1em;
    padding-right: 1em;
    background: rgb(247,242,180); /* kind of sandy */
    /* background: rgb(200,255,255); */ /* sky blue */
    font-family: "Lucida Console", monospace
}

div.spacerbox
{
    border: none;
    padding-top: 2em;
    padding-bottom: 2em
}

div.image
{
    margin: 0;
    padding: 1em;
    text-align: center;
}
-->
</style>

<link rel="icon" href="http://maxima.sourceforge.net/favicon.ico"/>
</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">

<a name="Plotting"></a>
<a name="SEC33"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="maxima_7.html#SEC32" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC34" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima_7.html#SEC31" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_9.html#SEC35" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h1 class="chapter"> 8. Plotting </h1>

<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#SEC34">8.1 Definitions for Plotting</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">    
</td></tr>
</table>

<hr size="6">
<a name="Definitions-for-Plotting"></a>
<a name="SEC34"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC33" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="maxima_9.html#SEC35" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC33" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC33" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_9.html#SEC35" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 8.1 Definitions for Plotting </h2>

<dl>
<dt><u>Option variable:</u> <b>in_netmath</b>
<a name="IDX235"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>When <code>in_netmath</code> is <code>true</code>,
<code>plot3d</code> prints OpenMath output to the console if <code>plot_format</code> is <code>openmath</code>;
otherwise <code>in_netmath</code> (even if <code>true</code>) has no effect.
<code>in_netmath</code> has no effect on <code>plot2d</code>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>openplot_curves</b><i> (<var>list</var>, <var>rest_options</var>)</i>
<a name="IDX236"></a>
</dt>
<dd><p>Takes a list of curves such as
</p><table><tr><td>&nbsp;</td><td><pre class="example">[[x1, y1, x2, y2, ...], [u1, v1, u2, v2, ...], ..]
</pre></td></tr></table><p>or 
</p><table><tr><td>&nbsp;</td><td><pre class="example">[[[x1, y1], [x2, y2], ...], ...]
</pre></td></tr></table><p>and plots them.  This is similar to xgraph_curves, but uses the
open plot routines.
Addtional symbol arguments may be given such as
<code>&quot;{xrange -3 4}&quot;</code>
The following plots two curves, using big points, labeling the first one
<code>jim</code> and the second one <code>jane</code>.   
</p><table><tr><td>&nbsp;</td><td><pre class="example">(%i1) openplot_curves ([[&quot;{plotpoints 1} {pointsize 6}
      {label jim} {xaxislabel {joe is nice}}&quot;],
      [1, 2, 3, 4, 5, 6, 7, 8], [&quot;{label jane} {color pink }&quot;],
      [3, -1, 4, 2, 5, 7]]);
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting1.gif" alt="figures/plotting1"></div>
</p>
<p>Some other special keywords are <code>xfun</code>, <code>color</code>, <code>plotpoints</code>, <code>linecolors</code>,
<code>pointsize</code>, <code>nolines</code>, <code>bargraph</code>, <code>labelposition</code>, <code>xaxislabel</code>, and
<code>yaxislabel</code>.
</p>
</dd></dl>



<dl>
<dt><u>Function:</u> <b>plot2d</b><i> (<var>expr</var>, <var>range</var>, ..., <var>options</var>, ...)</i>
<a name="IDX237"></a>
</dt>
<dt><u>Function:</u> <b>plot2d</b><i> (<var>parametric_expr</var>)</i>
<a name="IDX238"></a>
</dt>
<dt><u>Function:</u> <b>plot2d</b><i> (<var>discrete_expr</var>)</i>
<a name="IDX239"></a>
</dt>
<dt><u>Function:</u> <b>plot2d</b><i> ([<var>expr_1</var>, ..., <var>expr_n</var>], <var>x_range</var>, <var>y_range</var>)</i>
<a name="IDX240"></a>
</dt>
<dt><u>Function:</u> <b>plot2d</b><i> ([<var>expr_1</var>, ..., <var>expr_n</var>], <var>x_range</var>)</i>
<a name="IDX241"></a>
</dt>
<dt><u>Function:</u> <b>plot2d</b><i> (<var>expr</var>, <var>x_range</var>, <var>y_range</var>)</i>
<a name="IDX242"></a>
</dt>
<dt><u>Function:</u> <b>plot2d</b><i> (<var>expr</var>, <var>x_range</var>)</i>
<a name="IDX243"></a>
</dt>
<dt><u>Function:</u> <b>plot2d</b><i> ([<var>name_1</var>, ..., <var>name_n</var>], <var>x_range</var>, <var>y_range</var>)</i>
<a name="IDX244"></a>
</dt>
<dt><u>Function:</u> <b>plot2d</b><i> ([<var>name_1</var>, ..., <var>name_n</var>], <var>x_range</var>)</i>
<a name="IDX245"></a>
</dt>
<dt><u>Function:</u> <b>plot2d</b><i> (<var>name</var>, <var>x_range</var>, <var>y_range</var>)</i>
<a name="IDX246"></a>
</dt>
<dt><u>Function:</u> <b>plot2d</b><i> (<var>name</var>, <var>x_range</var>)</i>
<a name="IDX247"></a>
</dt>
<dd>
<p>Displays a plot of one or more expressions
as a function of one variable.
</p>
<p>In all cases, <var>expr</var>
is an expression to be plotted on the vertical axis as
a function of one variable.
<var>x_range</var>, the range of the horizontal axis,
is a list of the form <code>[<var>variable</var>, <var>min</var>, <var>max</var>]</code>,
where <var>variable</var> is a variable which appears in <var>expr</var>.
<var>y_range</var>, the range of the vertical axis,
is a list of the form <code>[y, <var>min</var>, <var>max</var>]</code>.
</p>
<p><code>plot2d (<var>expr</var>, <var>x_range</var>)</code>
plots <var>expr</var> as a function of the variable named in <var>x_range</var>,
over the range specified in <var>x_range</var>.
If the vertical range is not otherwise specified by <code>set_plot_option</code>,
it is chosen automatically.
All options are assumed to have default values unless otherwise specified by <code>set_plot_option</code>.
</p>
<p><code>plot2d (<var>expr</var>, <var>x_range</var>, <var>y_range</var>)</code>
plots <var>expr</var> as a function of the variable named in <var>x_range</var>,
over the range specified in <var>x_range</var>.
The vertical range is set to <var>y_range</var>.
All options are assumed to have default values unless otherwise specified by <code>set_plot_option</code>.
</p>
<p><code>plot2d ([<var>expr_1</var>, ..., <var>expr_n</var>], <var>x_range</var>)</code>
plots <var>expr_1</var>, ..., <var>expr_n</var> as a function of the variable named in <var>x_range</var>,
over the range specified in <var>x_range</var>.
If the vertical range is not otherwise specified by <code>set_plot_option</code>,
it is chosen automatically.
All options are assumed to have default values unless otherwise specified by <code>set_plot_option</code>.
</p>
<p><code>plot2d ([<var>expr_1</var>, ..., <var>expr_n</var>], <var>x_range</var>, <var>y_range</var>)</code>
plots <var>expr_1</var>, ..., <var>expr_n</var> as a function of the variable named in <var>x_range</var>,
over the range specified in <var>x_range</var>.
The vertical range is set to <var>y_range</var>.
All options are assumed to have default values unless otherwise specified by <code>set_plot_option</code>.
</p>
<p>A function to be plotted
may be specified as the name of a Maxima or Lisp function or operator,
a Maxima lambda expression, or a general Maxima expression.
If specified as a name or a lambda expression,
the function must be a function of one argument.
</p>
<p><b>Examples:</b>
</p>
<p>Plotting an expression, and setting some commonly-used parameters.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) plot2d (sin(x), [x, -5, 5])$
(%i2) plot2d (sec(x), [x, -2, 2], [y, -20, 20], [nticks, 200])$
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting2.gif" alt="figures/plotting2"></div><div class="image"><img src="./figures/plotting3.gif" alt="figures/plotting3"></div>
</p>
<p><b>Plotting functions by name.</b>
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) F(x) := x^2 $

(%i2) :lisp (defun |$g| (x) (m* x x x))

$g
(%i2) H(x) := if x &lt; 0 then x^4 - 1 else 1 - x^5 $

(%i3) plot2d (F, [u, -1, 1])$

(%i4) plot2d ([F, G, H], [u, -1, 1])$
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting4.gif" alt="figures/plotting4"></div><div class="image"><img src="./figures/plotting5.gif" alt="figures/plotting5"></div>
</p>
<p>Anywhere there may be an ordinary expression, there may be a parametric expression: 
<var>parametric_expr</var> is a list of the form
<code>[parametric, <var>x_expr</var>, <var>y_expr</var>, <var>t_range</var>, <var>options</var>]</code>.
Here <var>x_expr</var> and <var>y_expr</var> are expressions of 1 variable <var>var</var> which is
the first element of the range <var>trange</var>.  
The plot is of the path traced out by the pair
<code>[<var>x_expr</var>, <var>y_expr</var>]</code> as <var>var</var> varies in <var>trange</var>.
</p>
<p>In the following example, we plot a circle, then we do
the plot with only a few points used, so that we get a star,
and finally we plot this together with an ordinary function of X.
</p>
<p><b>Parametric plot examples:</b>
</p>
<ul>
<li>
Plot a circle with a parametric plot.
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) plot2d ([parametric, cos(t), sin(t), [t, -%pi*2, %pi*2],
        [nticks, 80]])$
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting6.gif" alt="figures/plotting6"></div>
</p>
</li><li> 
Plot a star: join eight points on the circumference of a circle.
<table><tr><td>&nbsp;</td><td><pre class="example">(%i2) plot2d ([parametric, cos(t), sin(t), [t, -%pi*2, %pi*2],
        [nticks, 8]])$
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting7.gif" alt="figures/plotting7"></div>
</p>
</li><li>
Plot a cubic polynomial with an ordinary plot and a circle with a parametric
plot.
<table><tr><td>&nbsp;</td><td><pre class="example">(%i3) plot2d ([x^3+2, [parametric, cos(t), sin(t), [t, -5, 5],
        [nticks, 80]]], [x, -3, 3])$
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting8.gif" alt="figures/plotting8"></div>
</p>
</li></ul>

<p>Discrete expressions may also be used instead or ordinary or
parametric expressions:
<var>discrete_expr</var> is a list of the form
<code>[discrete, <var>x_list</var>, <var>y_list</var>]</code>
or
<code>[discrete, <var>xy_list</var>]</code>,
where <var>xy_list</var> is a list of <code>[<var>x</var>,<var>y</var>]</code> pairs.
</p>
<p><b>Discrete plot examples:</b>
</p>
<ul>
<li>
Create some lists.
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) xx:makelist(x,x,0,10)$
(%i2) yy:makelist(exp(-x*1.0),x,0,10)$
(%i3) xy:makelist([x,x*x],x,0,5)$
</pre></td></tr></table>
</li><li>
Plot with line segments.
<table><tr><td>&nbsp;</td><td><pre class="example">(%i4) plot2d([discrete,xx,yy])$
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting9.gif" alt="figures/plotting9"></div>
</p>
</li><li>
Plot with line segments, using a list of pairs.
<table><tr><td>&nbsp;</td><td><pre class="example">(%i5) plot2d([discrete,xy])$
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting10.gif" alt="figures/plotting10"></div>
</p>
</li><li>
Plot with points.
<table><tr><td>&nbsp;</td><td><pre class="example">(%i6) plot2d([discrete,xx,yy],[gnuplot_curve_styles,
      [&quot;with points&quot;]])$
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting11.gif" alt="figures/plotting11"></div>
</p>
</li><li>
Plot the curve <code>cos(<var>x</var>)</code> using lines and (<var>xx</var>,<var>yy</var>)
using points.
<table><tr><td>&nbsp;</td><td><pre class="example">(%i7) plot2d([cos(x),[discrete,xx,yy]],[x,0,10],
     [gnuplot_curve_styles,
     [&quot;with lines&quot;,&quot;with points pointsize 3&quot;]])$
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting12.gif" alt="figures/plotting12"></div>
</p>
</li></ul>

<p>See also <code>plot_options</code>, which describes plotting options and has more examples.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>xgraph_curves</b><i> (<var>list</var>)</i>
<a name="IDX248"></a>
</dt>
<dd><p>graphs the list of `point sets' given in list by using xgraph. If the program
xgraph is not installed, this command will fail.
</p>
<p>A point set may be of the form
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">[x0, y0, x1, y1, x2, y2, ...]
</pre></td></tr></table><p>or
</p><table><tr><td>&nbsp;</td><td><pre class="example">[[x0, y0], [x1, y1], ...]
</pre></td></tr></table><p>A point set may also contain symbols which give labels or other
information.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">xgraph_curves ([pt_set1, pt_set2, pt_set3]);
</pre></td></tr></table>
<p>graph the three point sets as three curves.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">pt_set: append ([&quot;NoLines: True&quot;, &quot;LargePixels: true&quot;],
                          [x0, y0, x1, y1, ...]);
</pre></td></tr></table>

<p>would make the point set [and subsequent ones], have  
no lines between points, and to use large pixels.
See the man page on xgraph for more options to specify.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">pt_set: append ([concat (&quot;\&quot;&quot;, &quot;x^2+y&quot;)], [x0, y0, x1, y1, ...]);
</pre></td></tr></table>

<p>would make there be a &quot;label&quot; of &quot;x^2+y&quot; for this particular
point set.    The <code>&quot;</code> at the beginning is what tells
xgraph this is a label.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">pt_set: append ([concat (&quot;TitleText: Sample Data&quot;)], [x0, ...])$
</pre></td></tr></table>

<p>would make the main title of the plot be &quot;Sample Data&quot; instead
of &quot;Maxima Plot&quot;.
</p>
<p>To make a bar graph with bars which are 0.2 units wide, and
to plot two possibly different such bar graphs:
</p><table><tr><td>&nbsp;</td><td><pre class="example">(%i1) xgraph_curves ([append ([&quot;BarGraph: true&quot;, &quot;NoLines: true&quot;,
      &quot;BarWidth: .2&quot;], create_list ([i - .2, i^2], i, 1, 3)),
      append ([&quot;BarGraph: true&quot;, &quot;NoLines: true&quot;, &quot;BarWidth: .2&quot;],
      create_list ([i + .2, .7*i^2], i, 1, 3))]);
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting13.gif" alt="figures/plotting13"></div>
</p>


<p>A temporary file <tt>`xgraph-out'</tt> is used.
</p>
</dd></dl>



<dl>
<dt><u>System variable:</u> <b>plot_options</b>
<a name="IDX249"></a>
</dt>
<dd><p>Elements of this list state the default options for plotting.
If an option is present in a <code>plot2d</code> or <code>plot3d</code> call,
that value takes precedence over the default option.
Otherwise, the value in <code>plot_options</code> is used.
Default options are assigned by <code>set_plot_option</code>.
</p>
<p>Each element of <code>plot_options</code> is a list of two or more items.
The first item is the name of an option, and the remainder comprises the value or values
assigned to the option.
In some cases the, the assigned value is a list, which may comprise several items.
</p>
<p>The plot options which are recognized by <code>plot2d</code> and <code>plot3d</code> are the following:
</p>
<ul>
<li>
Option: <code>plot_format</code> determines which plotting package is used by <code>plot2d</code> and <code>plot3d</code>.

<ul>
<li>
Default value: <code>gnuplot</code>
Gnuplot is the default, and most advanced, plotting package. It
requires an external gnuplot installation.
</li><li>
Value: <code>mgnuplot</code>
Mgnuplot is a Tk-based wrapper around gnuplot. It is included in the
Maxima distribution. Mgnuplot offers a rudimentary GUI for gnuplot,
but has fewer overall features than the plain gnuplot
interface. Mgnuplot requires an external gnuplot installation and
Tcl/Tk.
</li><li>
Value: <code>openmath</code>
Openmath is a Tcl/Tk GUI plotting program. It is included in the
Maxima distribution.
</li><li>
Value: <code>ps</code>
Generates simple PostScript files directly from
Maxima. Much more sophisticated PostScript output can be generated from gnuplot,
by leaving the option <code>plot_format</code> unspecified (to accept the default),
and setting the option <code>gnuplot_term</code> to <code>ps</code>.
</li></ul>

</li><li>
Option: <code>run_viewer</code> controls whether or not the appropriate viewer for the plot
format should be run.

<ul>
<li>
Default value: <code>true</code> Execute the viewer program.
</li><li>
Value: <code>false</code> Do not execute the viewer program.
</li></ul>

</li><li>
<code>gnuplot_term</code> Sets the output terminal type for gnuplot.
<ul>
<li>
Default value: <code>default</code>
Gnuplot output is displayed in a separate graphical window.

</li><li>
Value: <code>dumb</code>
Gnuplot output is displayed in the Maxima console by an &quot;ASCII art&quot; approximation to graphics.

</li><li>
Value: <code>ps</code>
Gnuplot generates commands in the PostScript page description language.
If the option
<code>gnuplot_out_file</code> is set to <var>filename</var>, gnuplot writes the PostScript commands to <var>filename</var>.
Otherwise, it is saved as <code>maxplot.ps</code> file.

</li><li>
Value: any other valid gnuplot term specification
Gnuplot can generate output in many other graphical formats such
as png, jpeg, svg etc.  To create plot in all these formats the
<code>gnuplot_term</code> can be set to any supported gnuplot term name (symbol) 
or even full gnuplot term specification with any valid options (string).
For example <code>[gnuplot_term,png]</code> creates output in PNG (Portable
Network Graphics) format while <code>[gnuplot_term,&quot;png size 1000,1000&quot;]</code>
creates PNG of 1000x1000 pixels size. 
If the option <code>gnuplot_out_file</code> is set to <var>filename</var>, gnuplot 
writes the output to <var>filename</var>. Otherwise, it is saved as 
<code>maxplot.<var>term</var></code> file, where <var>term</var> is gnuplot 
terminal name.

</li></ul>

</li><li>
Option: <code>gnuplot_out_file</code> Write gnuplot output to a file.

<ul>
<li>
Default value: <code>false</code> No output file specified.
</li><li>
Value: <var>filename</var>
Example: <code>[gnuplot_out_file, &quot;myplot.ps&quot;]</code>
This example sends PostScript output to the file <code>myplot.ps</code> when
used in conjunction with the PostScript gnuplot terminal.
</li></ul>

</li><li>
Option: <code>x</code>
The default horizontal range.
<table><tr><td>&nbsp;</td><td><pre class="example">[x, - 3, 3]
</pre></td></tr></table><p>Sets the horizontal range to [-3, 3].
</p>
</li><li>
Option: <code>y</code>
The default vertical range.
<table><tr><td>&nbsp;</td><td><pre class="example">[y, - 3, 3]
</pre></td></tr></table><p>Sets the vertical range to [-3, 3].
</p>
</li><li>
Option: <code>t</code>
The default range for the parameter in parametric plots.
<table><tr><td>&nbsp;</td><td><pre class="example">[t, 0, 10]
</pre></td></tr></table><p>Sets the parametric variable range to [0, 10].
</p>
</li><li>
Option: <code>nticks</code>
Initial number of points 
used by the adaptive plotting routine.
<table><tr><td>&nbsp;</td><td><pre class="example">[nticks, 20]
</pre></td></tr></table><p>The default for <code>nticks</code> is 10.
</p>
</li><li>
Option: <code>adapt_depth</code>
The maximum number of splittings used by the adaptive plotting routine.
<table><tr><td>&nbsp;</td><td><pre class="example">[adapt_depth, 5]
</pre></td></tr></table><p>The default for <code>adapt_depth</code> is 10.
</p>
</li><li>
Option: <code>grid</code>
Sets the number of grid points to use in the x- and y-directions
for three-dimensional plotting.
<table><tr><td>&nbsp;</td><td><pre class="example">[grid, 50, 50]
</pre></td></tr></table><p>sets the grid to 50 by 50 points. The default grid is 30 by 30.
</p>
</li><li>
Option: <code>transform_xy</code>
Allows transformations to be applied to three-dimensional plots.
<table><tr><td>&nbsp;</td><td><pre class="example">[transform_xy, false]
</pre></td></tr></table><p>The default <code>transform_xy</code> is <code>false</code>. If it is not <code>false</code>, it should be
the output of
</p><table><tr><td>&nbsp;</td><td><pre class="example">make_transform([x,y,z], f1(x,y,z), f2(x,y,z), f3(x,y,z))$
</pre></td></tr></table><p>The <code>polar_xy</code> transformation is built in. It gives the same
transformation as
</p><table><tr><td>&nbsp;</td><td><pre class="example">make_transform ([r, th, z], r*cos(th), r*sin(th), z)$
</pre></td></tr></table>
</li><li>
Option: <code>colour_z</code> is specific to the <code>ps</code> plot format.
<table><tr><td>&nbsp;</td><td><pre class="example">[colour_z, true]
</pre></td></tr></table><p>The default value for <code>colour_z</code> is <code>false</code>.
</p>
</li><li>
Option: <code>view_direction</code>
Specific to the <code>ps</code> plot format.
<table><tr><td>&nbsp;</td><td><pre class="example">[view_direction, 1, 1, 1]
</pre></td></tr></table><p>The default <code>view_direction</code> is [1, 1, 1].
</p></li></ul>

<p>There are several plot options specific to gnuplot.
All of these options (except <code>gnuplot_pm3d</code>) are raw
gnuplot commands, specified as strings. Refer to the gnuplot documentation for more details.
</p>
<ul>
<li>
Option: <code>gnuplot_pm3d</code> Controls the usage PM3D mode, which has advanced 3D
features. PM3D is only available in gnuplot versions after 3.7. The
default value for <code>gnuplot_pm3d</code> is <code>false</code>.

<p>Example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">[gnuplot_pm3d, true]
</pre></td></tr></table>
</li><li>
Option: <code>gnuplot_preamble</code> Inserts gnuplot commands before the plot is
drawn. Any valid gnuplot commands may be used. Multiple commands
should be separated with a semi-colon. The example shown produces a
log scale plot. The default value for <code>gnuplot_preamble</code> is the empty string <code>&quot;&quot;</code>.

<p>Example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">[gnuplot_preamble, &quot;set log y&quot;]
</pre></td></tr></table>
</li><li>
Option: <code>gnuplot_curve_titles</code> Controls the titles given in the plot key. The
default value is <code>[default]</code>, which automatically sets the title of each
curve to the function plotted. If not <code>[default]</code>, <code>gnuplot_curve_titles</code>
should contain a list of strings,
each of which is <code>&quot;title '<var>title_string</var>'&quot;</code>.
(To disable the plot key, add <code>&quot;set nokey&quot;</code> to <code>gnuplot_preamble</code>.)

<p>Example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">[gnuplot_curve_titles,
[&quot;title 'My first function'&quot;, &quot;title 'My second function'&quot;]]
</pre></td></tr></table>
</li><li>
Option: <code>gnuplot_curve_styles</code> A list of strings controlling the appearance
of curves, i.e., color, width, dashing, etc., to be sent to the
gnuplot plot command. The default value is
<code>[&quot;with lines 3&quot;, &quot;with lines 1&quot;, &quot;with lines 2&quot;, &quot;with lines 5&quot;, &quot;with lines 4&quot;, &quot;with lines 6&quot;, &quot;with lines 7&quot;]</code>, which cycles through different colors. See the
gnuplot documentation for <code>plot</code> for more information.

<p>Example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">[gnuplot_curve_styles, [&quot;with lines 7&quot;, &quot;with lines 2&quot;]]
</pre></td></tr></table>
</li><li>
Option: <code>gnuplot_default_term_command</code> The gnuplot command to set the
terminal type for the default terminal. The default value is the empty string <code>&quot;&quot;</code>,
i.e., use gnuplot's default.

<p>Example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">[gnuplot_default_term_command, &quot;set term x11&quot;]
</pre></td></tr></table>
</li><li>
Option: <code>gnuplot_dumb_term_command</code> The gnuplot command to set the
terminal type for the dumb terminal. The default value is <code>&quot;set term dumb 79 22&quot;</code>,
which makes the text output 79 characters by 22
characters.

<p>Example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">[gnuplot_dumb_term_command, &quot;set term dumb 132 50&quot;]
</pre></td></tr></table>
</li><li>
Option: <code>gnuplot_ps_term_command</code> The gnuplot command to set the terminal
type for the PostScript terminal. The default value is
<code>&quot;set size 1.5, 1.5;set term postscript eps enhanced color solid 24&quot;</code>,
which sets the
size to 1.5 times gnuplot's default, and the font size to 24, among
other things. See the gnuplot documentation for <code>set term postscript</code> for more information.

<p>Example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">[gnuplot_ps_term_command,
&quot;set term postscript eps enhanced color solid 18&quot;]
</pre></td></tr></table>
</li></ul>

<p><b>Examples:</b>
</p>
<ul>
<li>
Saves a plot of <code>sin(x)</code> to the file <code>sin.eps</code>.
</li></ul>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) plot2d (sin(x), [x, 0, 2*%pi], [gnuplot_term, ps],
                        [gnuplot_out_file, &quot;sin.eps&quot;])$
</pre></td></tr></table>
<ul>
<li>
Uses the y option to chop off singularities and the gnuplot_preamble
option to put the key at the bottom of the plot instead of the top.
</li></ul>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i2) plot2d ([gamma(x), 1/gamma(x)], [x, -4.5, 5], [y, -10, 10],
                     [gnuplot_preamble, &quot;set key bottom&quot;])$
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting14.gif" alt="figures/plotting14"></div>
</p>
<ul>
<li>
Uses a very complicated <code>gnuplot_preamble</code> to produce fancy x-axis labels.
(Note that the <code>gnuplot_preamble</code> string must be entered without any line breaks.)
</li></ul>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i3) my_preamble: &quot;set xzeroaxis; set xtics ('-2pi' -6.283, \
'-3pi/2' -4.712, '-pi' -3.1415, '-pi/2' -1.5708, '0' 0, \
'pi/2' 1.5708, 'pi' 3.1415,'3pi/2' 4.712, '2pi' 6.283)&quot;$

(%i4) plot2d([cos(x), sin(x), tan(x), cot(x)],
       [x, -2*%pi, 2.1*%pi], [y, -2, 2],
       [gnuplot_preamble, my_preamble]);
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting15.gif" alt="figures/plotting15"></div>
</p>
<ul>
<li>
Uses a very complicated <code>gnuplot_preamble</code> to produce fancy x-axis labels,
and produces PostScript
output that takes advantage of the advanced text formatting available
in gnuplot.
(Note that the <code>gnuplot_preamble</code> string must be entered without any line breaks.)
</li></ul>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i5) my_preamble: &quot;set xzeroaxis; set xtics ('-2{/Symbol p}' \
-6.283, '-3{/Symbol p}/2' -4.712, '-{/Symbol p}' -3.1415, \
'-{/Symbol p}/2' -1.5708, '0' 0,'{/Symbol p}/2' 1.5708, \
'{/Symbol p}' 3.1415,'3{/Symbol p}/2' 4.712, '2{/Symbol p}' \
6.283)&quot;$

(%i6) plot2d ([cos(x), sin(x), tan(x)], [x, -2*%pi, 2*%pi],
    [y, -2, 2], [gnuplot_preamble, my_preamble],
    [gnuplot_term, ps], [gnuplot_out_file, &quot;trig.eps&quot;]);
</pre></td></tr></table>
<ul>
<li>
A three-dimensional plot using the gnuplot pm3d terminal.
</li></ul>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i7) plot3d (atan (-x^2 + y^3/4), [x, -4, 4], [y, -4, 4],
        [grid, 50, 50], [gnuplot_pm3d, true])$
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting16.gif" alt="figures/plotting16"></div>
</p>
<ul>
<li>
A three-dimensional plot without a mesh and with contours
projected on the bottom plane.
</li></ul>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i8) my_preamble: &quot;set pm3d at s;unset surface;set contour;\
set cntrparam levels 20;unset key&quot;$
(%i9) plot3d(atan(-x^2 + y^3/4), [x, -4, 4], [y, -4, 4],
    [grid, 50, 50], [gnuplot_pm3d, true],
    [gnuplot_preamble, my_preamble])$
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting17.gif" alt="figures/plotting17"></div>
</p>
<ul>
<li>
A plot where the z-axis is represented by color only.
(Note that the <code>gnuplot_preamble</code> string must be entered without any line breaks.)
</li></ul>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i10) plot3d (cos (-x^2 + y^3/4), [x, -4, 4], [y, -4, 4],
    [gnuplot_preamble, &quot;set view map; unset surface&quot;],
    [gnuplot_pm3d, true], [grid, 150, 150])$
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting18.gif" alt="figures/plotting18"></div>
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>plot3d</b><i> (<var>expr</var>, <var>x_range</var>, <var>y_range</var>, ..., <var>options</var>, ...)</i>
<a name="IDX250"></a>
</dt>
<dt><u>Function:</u> <b>plot3d</b><i> (<var>name</var>, <var>x_range</var>, <var>y_range</var>, ..., <var>options</var>, ...)</i>
<a name="IDX251"></a>
</dt>
<dt><u>Function:</u> <b>plot3d</b><i> ([<var>expr_1</var>, <var>expr_2</var>, <var>expr_3</var>], <var>x_rge</var>, <var>y_rge</var>)</i>
<a name="IDX252"></a>
</dt>
<dt><u>Function:</u> <b>plot3d</b><i> ([<var>name_1</var>, <var>name_2</var>, <var>name_3</var>], <var>x_range</var>, <var>y_range</var>, ..., <var>options</var>, ...)</i>
<a name="IDX253"></a>
</dt>
<dd><p>Displays a plot of one or three expressions as functions of two variables.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) plot3d (2^(-u^2 + v^2), [u, -3, 3], [v, -2, 2]);
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting19.gif" alt="figures/plotting19"></div>
</p>
<p>plots <code>z = 2^(-u^2+v^2)</code> with <code>u</code> and <code>v</code> varying in [-3,3] and
[-2,2] respectively, and with <var>u</var> on the x axis, and <code>v</code> on the y
axis.
</p>
<p>The same graph can be plotted using openmath:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i2)  plot3d (2^(-u^2 + v^2), [u, -3, 3], [v, -2, 2],
               [plot_format, openmath]);
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting25.gif" alt="figures/plotting25"></div>
</p>

<p>in this case the mouse can be used to rotate the plot to look at the surface
from different sides.
</p>
<p>An example of the third pattern of arguments is
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i3) plot3d ([cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)),
   y*sin(x/2)], [x, -%pi, %pi], [y, -1, 1], ['grid, 50, 15]);
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting20.gif" alt="figures/plotting20"></div>
</p>
<p>which plots a Moebius band, parametrized by the three expressions given
as the first argument to <code>plot3d</code>.  An additional optional argument
<code>['grid, 50, 15]</code> gives the grid number of rectangles in the x direction and
y direction.
</p>
<p>The function to be plotted
may be specified as the name of a Maxima or Lisp function or operator,
a Maxima lambda expression, or a general Maxima expression.
In the form <code>plot3d (<var>f</var>, ...)</code> where <var>f</var> is the
name of a function or a lambda expression,
the function must be a function of two arguments.
In the form <code>plot3d ([<var>f_1</var>, <var>f_2</var>, <var>f_3</var>], ...)</code>
where <var>f_1</var>, <var>f_2</var>, and <var>f_3</var> are names of functions or lambda expressions,
each function must be a function of three arguments.
</p>
<p>This example shows a plot of the real part of <code>z^1/3</code>.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i4) plot3d (r^.33*cos(th/3), [r, 0, 1], [th, 0, 6*%pi],
      ['grid, 12, 80], ['transform_xy, polar_to_xy],
      ['view_direction, 1, 1, 1.4], ['colour_z, true]);
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting21.gif" alt="figures/plotting21"></div>
</p>

<p>Here the <code>view_direction</code> option indicates the direction from which we
take a projection.  We actually do this from infinitely far away,
but parallel to the line from <code>view_direction</code> to the origin.  This
is currently only used in <code>ps</code> plot_format, since the other viewers
allow interactive rotating of the object.
</p>
<p>Other examples are the Klein bottle:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i5) expr_1: 5*cos(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)
      + 3.0) - 10.0$
(%i6) expr_2: -5*sin(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)
      + 3.0)$
(%i7) expr_3: 5*(-sin(x/2)*cos(y) + cos(x/2)*sin(2*y))$

(%i8) plot3d ([expr_1, expr_2, expr_3], [x, -%pi, %pi],
      [y, -%pi, %pi], ['grid, 40, 40]);
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting22.gif" alt="figures/plotting22"></div>
</p>
<p>and a torus:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i9) expr_1: cos(y)*(10.0+6*cos(x))$
(%i10) expr_2: sin(y)*(10.0+6*cos(x))$
(%i11) expr_3: -6*sin(x)$
(%i12) plot3d ([expr_1, expr_2, expr_3], [x, 0, 2*%pi],
       [y, 0, 2*%pi], ['grid, 40, 40]);
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting23.gif" alt="figures/plotting23"></div>
</p>
<p>Sometimes it is necessary to define a function to plot the expression. All
the arguments to plot3d are evaluated before being passed to plot3d, and
so trying to make an expression which does just what is needed may be
difficult, and it is just easier to make a function.   
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i13) M: matrix([1, 2, 3, 4], [1, 2, 3, 2], [1, 2, 3, 4],
       [1, 2, 3, 3])$
(%i14) f(x, y) := float (M [?round(x), ?round(y)])$
(%i15) plot3d (f, [x, 1, 4], [y, 1, 4], ['grid, 4, 4])$
</pre></td></tr></table>
<p><div class="image"><img src="./figures/plotting24.gif" alt="figures/plotting24"></div>
</p>
<p>See <code>plot_options</code> for more examples.
</p>
</dd></dl>


<dl>
<dt><u>Function:</u> <b>make_transform</b><i> (<var>vars</var>, <var>fx</var>, <var>fy</var>, <var>fz</var>)</i>
<a name="IDX254"></a>
</dt>
<dd><p>Returns a function suitable for the transform function in plot3d. Use
with the plot option <code>transform_xy</code>.
</p><table><tr><td>&nbsp;</td><td><pre class="example">make_transform ([r, th, z], r*cos(th), r*sin(th), z)$
</pre></td></tr></table><p>is a transformation to polar coordinates.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>plot2d_ps</b><i> (<var>expr</var>, <var>range</var>)</i>
<a name="IDX255"></a>
</dt>
<dd><p>Writes to pstream a sequence of PostScript commands which
plot <var>expr</var> over <var>range</var>.
</p>
<p><var>expr</var> is an expression.
<var>range</var> is a list of the form <code>[<var>x</var>, <var>min</var>, <var>max</var>]</code>
in which <var>x</var> is a variable which appears in <var>expr</var>.
</p>
<p>See also <code>closeps</code>.
</p>
</dd></dl>


<dl>
<dt><u>Function:</u> <b>closeps</b><i> ()</i>
<a name="IDX256"></a>
</dt>
<dd><p>This should usually becalled at the end of a sequence of plotting
commands.   It closes the current output stream <var>pstream</var>, and sets
it to nil.   It also may be called at the start of a plot, to ensure
pstream is closed if it was open.    All commands which write to
pstream, open it if necessary.   <code>closeps</code> is separate from the other
plotting commands, since we may want to plot 2 ranges or superimpose
several plots, and so must keep the stream open.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>set_plot_option</b><i> (<var>option</var>)</i>
<a name="IDX257"></a>
</dt>
<dd><p>Assigns one of the global variables for plotting.
<var>option</var> is specified as a list of two or more elements,
in which the first element is one of the keywords
on the <code>plot_options</code> list.
</p>
<p><code>set_plot_option</code> evaluates its argument.
<code>set_plot_option</code> returns <code>plot_options</code> 
(after modifying one of its elements).
</p>
<p>See also <code>plot_options</code>, <code>plot2d</code>, and <code>plot3d</code>.
</p>
<p>Examples:
</p>
<p>Modify the <code>grid</code> and <code>x</code> values.
When a <code>plot_options</code> keyword has an assigned value,
quote it to prevent evaluation.
</p>

<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) set_plot_option ([grid, 30, 40]);
(%o1) [[x, - 1.755559702014E+305, 1.755559702014E+305], 
[y, - 1.755559702014E+305, 1.755559702014E+305], [t, - 3, 3], 
[grid, 30, 40], [view_direction, 1, 1, 1], [colour_z, false], 
[transform_xy, false], [run_viewer, true], 
[plot_format, gnuplot], [gnuplot_term, default], 
[gnuplot_out_file, false], [nticks, 10], [adapt_depth, 10], 
[gnuplot_pm3d, false], [gnuplot_preamble, ], 
[gnuplot_curve_titles, [default]], 
[gnuplot_curve_styles, [with lines 3, with lines 1, 
with lines 2, with lines 5, with lines 4, with lines 6, 
with lines 7]], [gnuplot_default_term_command, ], 
[gnuplot_dumb_term_command, set term dumb 79 22], 
[gnuplot_ps_term_command, set size 1.5, 1.5;set term postscript #
eps enhanced color solid 24]]
(%i2) x: 42;
(%o2)                          42
(%i3) set_plot_option (['x, -100, 100]);
(%o3) [[x, - 100.0, 100.0], [y, - 1.755559702014E+305, 
1.755559702014E+305], [t, - 3, 3], [grid, 30, 40], 
[view_direction, 1, 1, 1], [colour_z, false], 
[transform_xy, false], [run_viewer, true], 
[plot_format, gnuplot], [gnuplot_term, default], 
[gnuplot_out_file, false], [nticks, 10], [adapt_depth, 10], 
[gnuplot_pm3d, false], [gnuplot_preamble, ], 
[gnuplot_curve_titles, [default]], 
[gnuplot_curve_styles, [with lines 3, with lines 1, 
with lines 2, with lines 5, with lines 4, with lines 6, 
with lines 7]], [gnuplot_default_term_command, ], 
[gnuplot_dumb_term_command, set term dumb 79 22], 
[gnuplot_ps_term_command, set size 1.5, 1.5;set term postscript #
eps enhanced color solid 24]]
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>psdraw_curve</b><i> (<var>ptlist</var>)</i>
<a name="IDX258"></a>
</dt>
<dd><p>Draws a curve connecting the points in <var>ptlist</var>.   The latter
may be of the form <code>[x0, y0, x1, y1, ...]</code> or <code>[[x0, y0], [x1, y1], ...]</code>
</p>
<p>The function <code>join</code> is handy for taking a list of x's and a
list of y's and splicing them together.
</p>
<p><var>psdraw_curve</var> simply invokes the more primitive function
<var>pscurve</var>.   Here is the definition:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(defun $psdraw_curve (lis)
  (p &quot;newpath&quot;)
  ($pscurve lis)
  (p &quot;stroke&quot;))

</pre></td></tr></table>


</dd></dl>

<dl>
<dt><u>Function:</u> <b>pscom</b><i> (<var>cmd</var>)</i>
<a name="IDX259"></a>
</dt>
<dd><p><var>cmd</var> is inserted in the PostScript file.
Example:
</p><table><tr><td>&nbsp;</td><td><pre class="example">pscom (&quot;4.5 72 mul 5.5 72 mul translate 14 14 scale&quot;);
</pre></td></tr></table>
</dd></dl>




<hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC33" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="maxima_9.html#SEC35" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
 <font size="-1">
  This document was generated by <em>Robert Dodier</em> on <em>September, 20 2006</em> using <a href="http://texi2html.cvshome.org/"><em>texi2html 1.76</em></a>.
 </font>
 <br>

</p>
</body>
</html>