## Archivi Categorie: maxima

### Maxima – 271 – draw – 18

Marco Bruno

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.838.

`transform`
Default value: `none`.

If `transform` is `none`, the space is not transformed and graphic objects are drawn as defined. When a space transformation is desired, a list must be assigned to option `transform`. In case of a 2D scene, the list takes the form `[f1(x,y), f2(x,y), x, y]`. In case of a 3D scene, the list is of the form `[f1(x,y,z), f2(x,y,z), f3(x,y,z), x, y, z]`.

The names of the variables defined in the lists may be different to those used in the definitions of the graphic objects.

``````(%i1) th : %pi / 4\$

(%i2) draw2d(
color = "#e245f0",
proportional_axes = 'xy,
line_width = 8,
triangle([3,2],[7,2],[5,5]),
border = false,
fill_color = yellow,
transform = [cos(th)*x - sin(th)*y,
sin(th)*x + cos(th)*y, x, y],
triangle([3,2],[7,2],[5,5]) )\$``````

Translation in 3D.

``````(%i3) draw3d(
color = "#a02c00",
explicit(20*exp(-x^2-y^2)-10,x,-3,3,y,-3,3),
transform = [x+10,y+10,z+10,x,y,z],
color = blue,
explicit(20*exp(-x^2-y^2)-10,x,-3,3,y,-3,3) )\$``````

`transparent`
Default value: `false`.

If `transparent` is `false`, interior regions of polygons are filled according to `fill_color`.

This option affects the following graphic objects in `gr2d`: `polygon`, `rectangle` and `ellipse`.

``````(%i4) draw2d(polygon([[3,2],[7,2],[5,5]]),
transparent = true,
color = blue,
polygon([[5,2],[9,2],[7,5]]) )\$``````

`unit_vectors`
Default value: `false`.

If `unit_vectors` is `true`, vectors are plotted with module `1`. This is useful for plotting vector fields. If `unit_vectors` is `false`, vectors are plotted with its original length. This option is relevant only for vector objects.

``````(%i5) draw2d(xrange = [-1,6],
yrange = [-1,6],
vector([0,0],[5,2]),
unit_vectors = true,
color = red,
vector([0,3],[5,2]))\$``````

`user_preamble`
Default value: `""` (empty string).

Expert Gnuplot users can make use of this option to fine tune Gnuplot’s behaviour by writing settings to be sent before the `plot` or `splot` command.

The value of this option must be a string or a list of strings (one per line).

Since this is a global graphics option, its position in the scene description does not
matter.

Tell Gnuplot to draw axes and grid on top of graphics objects:

``````(%i6) draw2d(
xaxis = true, xaxis_type=solid,
yaxis = true, yaxis_type=solid,
user_preamble = "set grid front",
region(x^2+y^2<1 ,x,-1.5,1.5,y,-1.5,1.5))\$``````

Tell gnuplot to draw all contour lines in black:

``````(%i7) draw3d(
contour=both,
surface_hide=true,enhanced3d=true,wired_surface=true,
contour_levels=10,
user_preamble="set for [i=1:8] linetype i dashtype i linecolor 0",
explicit(sin(x)*cos(y),x,1,10,y,1,10));
(%o7)                          [gr3d(explicit)]``````

### Maxima – 270 – draw – 17

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.836.

`terminal`
Default value: `screen`.

Selects the terminal to be used by Gnuplot; possible values are: `screen` (default), `png`, `pngcairo`, `jpg`, `gif`, `eps`, `eps_color`, `epslatex`, `epslatex_standalone`, `svg`, `canvas`, `dumb`, `dumb_file`, `pdf`, `pdfcairo`, `wxt`, `animated_gif`, `multipage_pdfcairo`, `multipage_pdf`, `multipage_eps`, `multipage_eps_color`, and `aquaterm`.

Terminals `screen`, `wxt`, `windows` and `aquaterm` can be also defined as a list with two elements: the name of the terminal itself and a non negative integer number. In this form, multiple windows can be opened at the same time, each with its corresponding number. This feature does not work in Windows platforms.

Since this is a global graphics option, its position in the scene description does not matter. It can be also used as an argument of function `draw`.

N.B. `pdfcairo` requires Gnuplot 4.3 or newer.`pdf` requires Gnuplot to be compiled with the option –enable-pdf and `libpdf` must be installed. The `pdf` library is available from here.

``````(%i1) /* screen terminal (default) */
draw2d(explicit(x^2,x,-1,1))\$

(%i2) /* png file */
draw2d(terminal = 'png,
explicit(x^2,x,-1,1))\$

(%i3) /* jpg file */
draw2d(terminal = 'jpg,
dimensions = [300,300],
explicit(x^2,x,-1,1))\$

(%i4) /* eps file */
draw2d(file_name = "myfile",
explicit(x^2,x,-1,1),
terminal = 'eps)\$

(%i5) /* pdf file */
draw2d(file_name = "mypdf",
dimensions = 100*[12.0,8.0],
explicit(x^2,x,-1,1),
terminal = 'pdf)\$

(%i6) /* wxwidgets window */
draw2d(explicit(x^2,x,-1,1),
terminal = 'wxt)\$``````

inoltre:

``````\$ ls my* maxima*
maxima_out.jpg  maxima_out.png  myfile.eps  mypdf.pdf``````

Multiple windows.

``````(%i7) draw2d(explicit(x^5,x,-2,2), terminal=[screen, 3])\$

(%i8) draw2d(explicit(x^2,x,-2,2), terminal=[screen, 0])\$``````

An animated gif file.

``````(%i9) draw(
delay = 100,
file_name = "zzz",
terminal = 'animated_gif,
gr2d(explicit(x^2,x,-1,1)),
gr2d(explicit(x^3,x,-1,1)),
gr2d(explicit(x^4,x,-1,1)));
3 frames in animation sequence
(%o9)          [gr2d(explicit), gr2d(explicit), gr2d(explicit)]``````

Option `delay` is only active in animated gif’s; it is ignored in any other case.

Multipage output in `eps` format.

``````(%i10) draw(
file_name = "parabol",
terminal = multipage_eps,
dimensions = 100*[10,10],
gr2d(explicit(x^2,x,-1,1)),
gr3d(explicit(x^2+y^2,x,-1,1,y,-1,1))) \$``````

OOPS! non ci sono riuscito, non ho capito perché.

See also `file_name`, `dimensions_draw` and `delay`.

`title`
Default value: `""` (empty string).

Option `title`, a string, is the main title for the scene. By default, no title is written. Since this is a global graphics option, its position in the scene description does not matter.

``````(%i13) draw2d(explicit(exp(u),u,-2,2),
title = "Exponential function")\$``````

### Maxima – 269 – draw – 16

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.832.

`point_type`
Default value: `1`.

`point_type` indicates how isolated points are displayed; the value of this option can be any integer index greater or equal than `-1`, or the name of a point style:

``````     \$none (-1)
dot (0)
plus (1)
multiply (2)
asterisk (3)
square (4)
filled_square (5)
circle (6)
filled_circle (7)
up_triangle (8)
filled_up_triangle (9)
down_triangle (10)
filled_down_triangle (11)
diamant (12) and filled_diamant (13)``````

This option affects the graphic objects `gr2d` and `gr3d`.

``````(%i1) draw2d(xrange = [0,10],
yrange = [0,10],
point_size = 3,
point_type = diamant,
points([[1,1],[5,1],[9,1]]),
point_type = filled_down_triangle,
points([[1,2],[5,2],[9,2]]),
point_type = asterisk,
points([[1,3],[5,3],[9,3]]),
point_type = filled_diamant,
points([[1,4],[5,4],[9,4]]),
point_type = 5,
points([[1,5],[5,5],[9,5]]),
point_type = 6,
points([[1,6],[5,6],[9,6]]),
point_type = filled_circle,
points([[1,7],[5,7],[9,7]]),
point_type = 8,
points([[1,8],[5,8],[9,8]]),
point_type = filled_diamant,
points([[1,9],[5,9],[9,9]]) )\$``````

`points_joined`
Default value: `false`.

When `points_joined` is `true`, points are joined by lines; when `false`, isolated points are drawn. A third possible value for this graphic option is `impulses`; in such case, vertical segments are drawn from points to the x-axis (2D) or to the xy-plane (3D).

``````(%i2) draw2d(xrange = [0,10],
yrange = [0,4],
point_size = 3,
point_type = up_triangle,
color = blue,
points([[1,1],[5,1],[9,1]]),
points_joined = true,
point_type = square,
line_type = dots,
points([[1,2],[5,2],[9,2]]),
point_type = circle,
color = red,
line_width = 7,
points([[1,3],[5,3],[9,3]]) )\$``````

`proportional_axes`
Default value: `none`.

When `proportional_axes` is equal to `xy` or `xyz`, the aspect ratio of the axis units will be set to `1:1` resulting in a 2D or 3D scene that will be drawn with axes proportional to their relative lengths. Since this is a global graphics option, its position in the scene description does not matter.

This option works with Gnuplot version 4.2.6 or greater.

Single 2D plot.

``````(%i3) draw2d(
ellipse(0,0,1,1,0,360),
transparent=true,
color = blue,
line_width = 4,
ellipse(0,0,2,1/2,0,360),
proportional_axes = 'xy) \$``````

Multiplot.

``````(%i4) draw(
terminal = wxt,
gr2d(proportional_axes = 'xy,
explicit(x^2, x, 0, 1)),
gr2d(explicit(x^2, x, 0, 1),
xrange = [0,1],
yrange = [0,2],
proportional_axes='xy),
gr2d(explicit(x^2, x, 0, 1)))\$``````

`surface_hide`
Default value: `false`.

If `surface_hide` is `true`, hidden parts are not plotted in 3d surfaces. Since this is a global graphics option, its position in the scene description does not matter.

``````(%i5) draw(columns=2,
gr3d(explicit(exp(sin(x)+cos(x^2)),x,-3,3,y,-3,3)),
gr3d(surface_hide = true,
explicit(exp(sin(x)+cos(x^2)),x,-3,3,y,-3,3)) )\$``````

### Maxima – 268 – draw – 15

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.829.

`palette`
Default value: `color`.

`palette` indicates how to map gray levels onto color components. It works together with option enhanced3d in 3D graphics, who associates every point of a surfaces to a real number or gray level. It also works with gray images. With `palette`, levels are transformed into colors.

There are two ways for defining these transformations.

First, palette can be a vector of length three with components ranging from `-36` to `+36`; each value is an index for a formula mapping the levels onto red, green and blue colors, respectively:

``````     0: 0               1: 0.5           2: 1
3: x               4: x^2           5: x^3
6: x^4             7: sqrt(x)       8: sqrt(sqrt(x))
9: sin(90x)       10: cos(90x)     11: |x-0.5|
12: (2x-1)^2       13: sin(180x)    14: |cos(180x)|
15: sin(360x)      16: cos(360x)    17: |sin(360x)|
18: |cos(360x)|    19: |sin(720x)|  20: |cos(720x)|
21: 3x             22: 3x-1         23: 3x-2
24: |3x-1|         25: |3x-2|       26: (3x-1)/2
27: (3x-2)/2       28: |(3x-1)/2|   29: |(3x-2)/2|
30: x/0.32-0.78125 31: 2*x-0.84     32: 4x;1;-2x+1.84;x/0.08-11.5
33: |2*x - 0.5|    34: 2*x          35: 2*x - 0.5
36: 2*x - 1``````

negative numbers mean negative colour component. `palette = gray` and `palette = color` are short cuts for `palette = [3,3,3]` and `palette = [7,5,15]`, respectively.

Second, `palette` can be a user defined lookup table. In this case, the format for building a lookup table of length `n` is `palette=[color_1, color_2, ..., color_n]`, where `color_i` is a well formed `color` (see option `color`) such that `color_1` is assigned to the lowest gray level and `color_n` to the highest. The rest of colors are interpolated.

Since this is a global graphics option, its position in the scene description does not matter.

It works together with option `enhanced3d` in 3D graphics.

``````(%i1) draw3d(
enhanced3d = [z-x+2*y, x, y, z],
palette = [32, -8, 17],
explicit(20*exp(-x^2-y^2)-10, x, -3, 3, y, -3, 3))\$``````

It also works with gray images.

``````(%i2) im: apply(
'matrix,
makelist(makelist(random(200), i, 1, 30), i, 1, 30))\$

(%i3) /* palette = color, default */
draw2d(image(im, 0, 0, 30, 30))\$``````

``(%i4) draw2d(palette = gray, image(im, 0, 0, 30, 30))\$``

``````(%i5) draw2d(palette = [15, 20, -4],
colorbox = false,
image(im, 0, 0, 30, 30))\$``````

`palette` can be a user defined lookup table. In this example, low values of `x` are colored in red, and higher values in yellow.

``````(%i6) draw3d(
palette = [red, blue, yellow],
enhanced3d = x,
explicit(x^2+y^2, x, -1, 1, y, -1, 1))\$``````

See also `colorbox` and `enhanced3d`.

`point_size`
Default value: `1`.

`point_size` sets the size for plotted points. It must be a non negative number. This option has no effect when graphic option `point_type` is set to `dot`.

This option affects the graphic object points in either `gr2d` and `gr3d`.

``````(%i7) draw2d(points(makelist([random(20), random(50)], k, 1, 10)),
point_size = 5,
points(makelist(k, k, 1, 20), makelist(random(30), k, 1, 20)))\$``````

### Maxima – 267 – draw – 14

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.825.

`line_width`
Default value: `1`.

`line_width` is the width of plotted lines. Its value must be a positive number.

This option affects the following graphic objects:

• `gr2d`: `points`, `polygon`, `rectangle`, `ellipse`, `vector`, `explicit`, `implicit`, `parametric` and `polar`.
• `gr3d`: `points` and `parametric`.
``````(%i1) draw2d(explicit(x^2, x, -1, 1), /* default width */
line_width = 5.5,
explicit(1 + x^2, x, -1, 1),
line_width = 10,
explicit(2 + x^2, x, -1, 1))\$``````

`logcb`
Default value: `false`.

If `logcb` is `true`, the tics in the colorbox will be drawn in the logarithmic scale. When `enhanced3d` or `colorbox` is false, option logcb has no effect. Since this is a global graphics option, its position in the scene description does not matter.

``````(%i2) draw3d (
enhanced3d = true,
color = green,
logcb = true,
logz = true,
palette = [-15, 24, -9],
explicit(exp(x^2-y^2), x, -2, 2, y, -2, 2)) \$``````

See also `enhanced3d`, `colorbox` and `cbrange`.

`logx`
Default value: `false`.

If `logx` is `true`, the `x` axis will be drawn in the logarithmic scale. Since this is a global graphics option, its position in the scene description does not matter, with the exception that it should be written before any 2D explicit object, so that draw can produce a better plot.

``````(%i3) draw2d(logx = true,
explicit(log(x), x, 0.01, 5))\$``````

See also `logy`, `logx_secondary`, `logy_secondary`, and `logz`.

`logx_secondary`
Default value: `false`.

If `logx_secondary` is `true`, the secondary `x` axis will be drawn in the logarithmic scale. This option is relevant only for 2d scenes. Since this is a global graphics option, its position in the scene description does not matter.

``````(%i4) draw2d(
grid = true,
key="x^2, linear scale",
color=red,
explicit(x^2, x, 1, 100),
xaxis_secondary = true,
xtics_secondary = true,
logx_secondary = true,
key = "x^2, logarithmic x scale",
color = blue,
explicit(x^2, x, 1, 100))\$``````

See also `logx_draw`, `logy_draw`, `logy_secondary`, and `logz`.

`logy`
Default value: `false`.

If `logy` is `true`, the `y` axis will be drawn in the logarithmic scale. Since this is a global graphics option, its position in the scene description does not matter.

``````(%i5) draw2d(logy = true,
explicit(exp(x), x, 0, 5))\$``````

See also `logx_draw`, `logx_secondary`, `logy_secondary`, and `logz`.

`logy_secondary`
Default value: `false`.

If `logy_secondary` is `true`, the secondary `y` axis will be drawn in the logarithmic scale. This option is relevant only for 2d scenes. Since this is a global graphics option, its position in the scene description does not matter.

``````(%i6) draw2d(
grid = true,
key="x^2, linear scale",
color=red,
explicit(x^2, x, 1, 100),
yaxis_secondary = true,
ytics_secondary = true,
logy_secondary = true,
key = "x^2, logarithmic y scale",
color = blue,
explicit(x^2, x, 1, 100))\$``````

See also `logx_draw`, `logy_draw`, `logx_secondary`, and `logz`.

`logz`
Default value: `false`.

If `logz` is `true`, the `z` axis will be drawn in the logarithmic scale. Since this is a global graphics option, its position in the scene description does not matter.

``````(%i7) draw3d(logz = true,
explicit(exp(u^2+v^2), u, -2, 2, v, -2, 2))\$``````

See also `logx_draw` and `logy_draw`.

`nticks`
Default value: `29`.

In 2d, `nticks` gives the initial number of points used by the adaptive plotting routine for explicit objects. It is also the number of points that will be shown in parametric and polar curves.

This option affects the following graphic objects:

• `gr2d`: `ellipse`, `explicit`, `parametric` and `polar`.
• `gr3d`: `parametric`.

See also `adapt_depth`.

``````(%i8) draw2d(transparent = true,
ellipse(0, 0, 4, 2, 0, 180),
nticks = 5,
ellipse(0, 0, 4, 2, 180, 180))\$``````

### Maxima – 266 – draw – 13

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.821.

`key`
Default value: `""` (empty string).

`key` is the name of a function in the legend. If `key` is an empty string, no key is assigned to the function.

This option affects the following graphic objects:

• `gr2d`: `points`, `polygon`, `rectangle`, `ellipse`, `vector`, `explicit`, `implicit`, `parametric` and `polar`.
• `gr3d`: `points`, `explicit`, `parametric` and `parametric_surface`.
``````(%i1) draw2d(key = "Sinus",
explicit(sin(x),x,0,10),
key = "Cosinus",
color = red,
explicit(cos(x),x,0,10) )\$``````

`key_pos`
Default value: `""` (empty string).

`key_pos` defines at which position the legend will be drawn. If key is an empty string, `"top_right"` is used. Available position specifiers are: `top_left`, `top_center`, `top_right`, `center_left`, `center`, center_right, `bottom_left`, `bottom_center`, and `bottom_right`.

Since this is a global graphics option, its position in the scene description does not
matter.

``````(%i2) draw2d(
key_pos = top_left,
key = "x",
explicit(x, x,0,10),
color= red,
key = "x squared",
explicit(x^2,x,0,10))\$

(%i3) draw3d(
key_pos = center,
key = "x",
explicit(x+y,x,0,10,y,0,10),
color= red,
key = "x squared",
explicit(x^2+y^2,x,0,10,y,0,10))\$``````

`label_alignment`
Default value: `center`.

`label_alignment` is used to specify where to write labels with respect to the given coordinates. Possible values are: `center`, `left`, and `right`.

This option is relevant only for `label` objects.

``````(%i4) draw2d(xrange = [0,10],
yrange = [0, 10],
points_joined = true,
points([[5, 0], [5, 10]]),
color = blue,
label(["Centered alignment (default)", 5, 2]),
label_alignment = 'left,
label(["Left alignment", 5, 5]),
label_alignment = 'right,
label(["Right alignment", 5, 8]))\$``````

See also `label_orientation`, and `color`.

`label_orientation`
Default value: `horizontal`.

`label_orientation` is used to specify orientation of labels. Possible values are: `horizontal`, and `vertical`.

This option is relevant only for `label` objects.

In this example, a dummy point is added to get an image. Package `draw` needs always data to draw an scene.

``````(%i5) draw2d(xrange = [0, 10],
yrange = [0, 10],
point_size = 0,
points([[5, 5]]),
color = navy,
label(["Horizontal orientation (default)", 5, 2]),
label_orientation = 'vertical,
color = "#654321",
label(["Vertical orientation", 1, 5]))\$``````

See also `label_alignment` and `color`.

`line_type`
Default value: `solid`.

`line_type` indicates how lines are displayed; possible values are `solid` and `dots`, both available in all terminals, and `dashes`, `short_dashes`, `short_long_dashes`, `short_short_long_dashes`, and `dot_dash`, which are not available in `png`, `jpg`, and `gif` terminals.

This option affects the following graphic objects:

• `gr2d`: `points`, `polygon`, `rectangle`, `ellipse`, `vector`, `explicit`, `implicit`, `parametric` and `polar`.
• `gr3d`: `points`, `explicit`, `parametric` and `parametric_surface`.
``````(%i6) draw2d(line_type = dots,
explicit(1 + x^2, x, -1, 1),
line_type = solid, /* default */
explicit(2 + x^2, x, -1, 1))\$``````

See also `line_width`.

### Maxima – 265 – draw – 12

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.817.

`interpolate_color`
Default value: `false`.

This option is relevant only when `enhanced3d` is not `false`.

When `interpolate_color` is `false`, surfaces are colored with homogeneous quadrangles. When `true`, color transitions are smoothed by interpolation.

`interpolate_color` also accepts a list of two numbers, `[m, n]`. For positive `m` and `n`, each quadrangle or triangle is interpolated `m` times and `n` times in the respective direction. For negative `m` and `n`, the interpolation frequency is chosen so that there will be at least `|m|` and `|n|` points drawn; you can consider this as a special gridding function. Zeros, i.e. `interpolate_color=[0, 0]`, will automatically choose an optimal number of interpolated surface points.

Also, `interpolate_color = true` is equivalent to `interpolate_color = [0, 0]`.

Color interpolation with explicit functions.

``````(%i1) draw3d(
enhanced3d = sin(x*y),
explicit(20*exp(-x^2-y^2)-10, x , -3, 3, y, -3, 3)) \$``````

``````(%i2) draw3d(
interpolate_color = true,
enhanced3d = sin(x*y),
explicit(20*exp(-x^2-y^2)-10, x , -3, 3, y, -3, 3)) \$``````

``````(%i3) draw3d(
interpolate_color = [-10, 0],
enhanced3d = sin(x*y),
explicit(20*exp(-x^2-y^2)-10, x , -3, 3, y, -3, 3)) \$``````

Color interpolation with the mesh graphic object.

Interpolating colors in parametric surfaces can give unexpected results.

``````(%i4) draw3d(
enhanced3d = true,
mesh([[1, 1, 3],
[7, 3, 1], [12, -2, 4], [15, 0, 5]],
[[2, 7, 8],
[4, 3, 1], [10, 5, 8], [12, 7, 1]],
[[-2, 11, 10], [6, 9, 5], [6, 15, 1], [20, 15, 2]])) \$``````

``````(%i5) draw3d(
enhanced3d = true,
interpolate_color = [0, 0],
mesh([[1, 1, 3],
[7, 3, 1], [12, -2, 4], [15, 0, 5]],
[[2, 7, 8],
[4, 3, 1], [10, 5, 8], [12, 7, 1]],
[[-2, 11, 10], [6, 9, 5], [6, 15, 1], [20, 15, 2]])) \$``````

ho avuto qualche difficoltà a riuscirci, probabilmente per via della versione non aggiornata.

``````(%i8) draw3d(
enhanced3d = true,
interpolate_color = true,
view=map,
mesh([[1, 1, 3],
[7, 3, 1], [12, -2, 4], [15, 0, 5]],
[[2, 7, 8],
[4, 3, 1], [10, 5, 8], [12, 7, 1]],
[[-2, 11, 10], [6, 9, 5], [6, 15, 1], [20, 15, 2]])) \$``````

`ip_grid`
Default value: `[50, 50]`.

`ip_grid` sets the grid for the first sampling in `implicit` plots. This option is relevant only for `implicit` objects.

`ip_grid_in`
Default value: `[5, 5]`.

`ip_grid_in` sets the grid for the second sampling in `implicit` plots. This option is relevant only for `implicit` objects.

### Maxima – 264 – draw – 11

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.813.

`gnuplot_file_name`
Default value: “`maxout_xxx.gnuplot`” with “`xxx`” being a number that is unique to
each concurrently-running maxima process.

This is the name of the file with the necessary commands to be processed by Gnuplot. Since this is a global graphics option, its position in the scene description does not
matter. It can be also used as an argument of function `draw`.

``````(%i1) draw2d(
file_name = "my_file",
gnuplot_file_name = "my_commands_for_gnuplot",
data_file_name = "my_data_for_gnuplot",
terminal = png,
explicit(x^2, x, -1, 1)) \$``````

See also `data_file_name`.

`grid`
Default value: `false`.

If `grid` is not `false`, a grid will be drawn on the xy plane. If `grid` is assigned `true`, one grid line per tick of each axis is drawn. If `grid` is assigned a list `nx, ny` with `[nx,ny] > [0,0]` instead `nx` lines per tick of the `x` axis and `ny` lines per tick of the `y` axis are drawn.

Since this is a global graphics option, its position in the scene description does not
matter.

``````(%i2) draw2d(grid = true,
explicit(exp(u), u, -2, 2))\$``````

``````(%i3) draw2d(grid = [2, 2],
explicit(sin(x), x, 0, 2*%pi))\$``````

`head_angle`
Default value: `45`.

`head_angle` indicates the angle, in degrees, between the arrow heads and the segment. This option is relevant only for vector objects.

``````(%i4) draw2d(xrange = [0, 10],
yrange = [0, 9],
vector([1, 1], 0, 6]),
vector([2, 1], [0, 6]),
vector([3, 1], [0, 6]),
vector([4, 1], [0, 6]),
vector([5, 1], [0, 6]),
vector([6, 1], [0, 6]),
vector([7, 1], [0, 6]),
vector([8, 1], [0, 6]),
vector([9, 1], [0, 6]) )\$``````

See also `head_both`, `head_length`, and `head_type`.

`head_both`
Default value: `false`.

If `head_both` is `true`, vectors are plotted with two arrow heads. If `false`, only one arrow is plotted. This option is relevant only for vector objects.

``````(%i5) draw2d(xrange = [0, 8],
yrange = [0, 8],
vector([1, 1], [6, 0]),
vector([1, 7], [6, 0]) )\$``````

See also `head_length`, `head_angle`, and `head_type`.

`head_length`
Default value: `2`.

`head_length` indicates, in x-axis units, the length of arrow heads. This option is relevant only for vector objects.

``````(%i6) draw2d(xrange = [0, 12],
yrange = [0, 8],
vector([0, 1], [5, 5]),
vector([2, 1], [5, 5]),
vector([4, 1], [5, 5]),
vector([6, 1], [5, 5]))\$``````

See also `head_both`, `head_angle`, and `head_type`.

`head_type`
Default value: `filled`.

`head_type` is used to specify how arrow heads are plotted. Possible values are: `filled` (closed and filled arrow heads), `empty` (closed but not filled arrow heads), and `nofilled` (open arrow heads). This option is relevant only for vector objects.

``````(%i7) draw2d(xrange = [0, 12],
yrange = [0, 10],
vector([0, 1], [5, 5]), /* default type */
vector([3, 1], [5, 5]),
vector([6, 1], [5, 5]))\$``````

See also `head_both`, `head_angle`, and `head_length`.

### Maxima – 263 – draw – 10

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.810.

`filled_func`
Default value: `false`.

Option `filled_func` controls how regions limited by functions should be filled. When `filled_func` is `true`, the region bounded by the function defined with object `explicit` and the bottom of the graphic window is filled with `fill_color`. When `filled_func` contains a function expression, then the region bounded by this function and the function defined with object `explicit` will be filled. By default, `explicit` functions are not filled.

A useful special case is `filled_func = 0`, which generates the region bond by the horizontal axis and the explicit function.

This option affects only the 2d graphic object `explicit`.

Region bounded by an explicit object and the bottom of the graphic window.

``````(%i1) draw2d(fill_color = red,
filled_func = true,
explicit(sin(x), x, 0, 10))\$``````

Region bounded by an `explicit` object and the function defined by option `filled_func`. Note that the variable in `filled_func` must be the same as that used in `explicit`.

``````(%i2) draw2d(fill_color = grey,
filled_func = sin(x),
explicit(-sin(x), x, 0, %pi));
(%o2)                          [gr2d(explicit)]``````

See also `fill_color` and `explicit`.

`font`
Default value: `""` (empty string).

This option can be used to set the font face to be used by the terminal. Only one font face and size can be used throughout the plot.

Since this is a global graphics option, its position in the scene description does not matter.

See also `font_size`.

Gnuplot doesn’t handle fonts by itself, it leaves this task to the support libraries of the different terminals, each one with its own philosophy about it. A brief summary follows:

x11 : Uses the normal `x11` font server mechanism.

``````(%i3) draw2d(font = "Arial",
font_size = 20,
label(["Arial font, size 20", 1, 1]))\$``````

(dalle prove fatte `font_size` non funziona)

windows: The windows terminal doesn’t support changing of fonts from inside the plot. Once the plot has been generated, the font can be changed right-clicking on the menu of the graph window.

`png`, `jpeg`, `gif` : The `libgd` library uses the font path stored in the environment variable `GDFONTPATH`; in this case, it is only necessary to set option `font` to the font’s name. It is also possible to give the complete path to the font file. Nota: la variabile `GDFONTPATH` per me è vuota.

Option `font` can be given the complete path to the font file:

``````(%i4) path: "/usr/share/fonts/truetype/freefont/" \$

(%i5) file: "FreeSerifBoldItalic.ttf" \$

(%i6) draw2d(
font = concat(path, file),
font_size = 20,
color = red,
label(["FreeSerifBoldItalic font, size 20",1,1]),
terminal = png)\$``````

If environment variable `GDFONTPATH` is set to the path where font files are allocated, it is possible to set graphic option font to the name of the font.

`Postscript`: Standard Postscript fonts are: `"Times-Roman"`, `"Times-Italic"`, `"Times-Bold"`, `"Times-BoldItalic"`, `"Helvetica"`, `"Helvetica-Oblique"`, `"Helvetica-Bold"`, `"Helvetica-BoldOblique"`, `"Courier"`, `"Courier-Oblique"`, `"Courier-Bold"`, and `"Courier-BoldOblique"`.

``````(%i9) draw2d(
font = "Courier-Oblique",
font_size = 15,
label(["Courier-Oblique, size 15",1,1]),
terminal = eps)\$``````

`pdf` : Uses same fonts as `Postscript`.

`pdfcairo`: Uses same fonts as `wxt`.

`wxt`: The `pango` library finds fonts via the `fontconfig` utility.

`aqua`: Default is `"Times-Roman"`.

The `gnuplot` documentation is an important source of information about terminals and fonts.

`font_size`
Default value: `10`.

This option can be used to set the font size to be used by the terminal. Only one font face and size can be used throughout the plot. `font_size` is active only when option `font` is not equal to the empty string.

Since this is a global graphics option, its position in the scene description does not matter. See also `font`.

### Maxima – 262 – draw – 9

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.807.

Continuo con gli esempi di `enhanced3d`.

`tube` object with coloring defined by the [f(x,y,z), x, y, z] model.

``````(%i1) draw3d(
enhanced3d = [cos(x-y),x,y,z],
palette = gray,
xu_grid = 50,
tube(cos(a), a, 0, 1, a, 0, 4*%pi) )\$``````

`tube` object with coloring defined by the `[f(u), u]` model. Here, `enhanced3d = -a` would be the shortcut for `enhanced3d = [-foo,foo]`.

``````(%i2) draw3d(
capping = [true, false],
palette = [26,15,-2],
enhanced3d = [-foo, foo],
tube(a, a, a^2, 1, a, -2, 2) )\$``````

`implicit` and points objects with coloring defined by the `[f(x,y,z), x, y, z]` model.

``````(%i3) draw3d(
enhanced3d = [x-y,x,y,z],
implicit((x^2+y^2+z^2-1)*(x^2+(y-1.5)^2+z^2-0.5)=0.015,
x,-1,1,y,-1.2,2.3,z,-1,1)) \$``````

`points`

``````(%i4) m: makelist([random(1.0),random(1.0),random(1.0)],k,1,2000)\$

(%i5) draw3d(
point_type = filled_circle,
point_size = 2,
enhanced3d = [u+v-w,u,v,w],
points(m) ) \$``````

When points have a chronological nature, model `[f(k), k]` is also valid, being `k` an ordering parameter.

``````(%i10) m:makelist([random(1.0), random(1.0), random(1.0)],k,1,100)\$

(%i11) draw3d(
enhanced3d = [sin(j), j],
point_size = 3,
point_type = filled_circle,
points_joined = true,
points(m)) \$``````

`error_type`
Default value: `y`.

Depending on its value, which can be `x`, `y`, or `xy`, graphic object `errors` will draw points with horizontal, vertical, or both, error bars. When `error_type=boxes`, boxes will be drawn instead of crosses. See also `errors`.

`file_name`
Default value: `"maxima_out"`.

This is the name of the file where terminals `png`, `jpg`, `gif`, `eps`, `eps_color`, `pdf`, `pdfcairo` and `svg` will save the graphic.

Since this is a global graphics option, its position in the scene description does not matter. It can be also used as an argument of function `draw`.

``````(%i12) draw2d(file_name = "myfile",
explicit(x^2, x, -1, 1),
terminal = 'png)\$``````

crea `myfile.png`.

See also `terminal`, `dimensions_draw`.

`fill_color`
Default value: `"red"`.

`fill_color` specifies the color for filling polygons and 2d explicit functions. See `color` to learn how colors are specified.

`fill_density`
Default value: 0.

`fill_density` is a number between `0` and `1` that specifies the intensity of the `fill_color` in bars objects. See `bars` for examples.