Archivi Categorie: maxima

Maxima – 268 – draw – 15

w9u2

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))$

268-1

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))$

268-2

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

268-3

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

268-4

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))$

268-5

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)))$

268-6

Maxima – 267 – draw – 14

cll2

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))$

267-0

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)) $

267-1

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))$

267-2

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))$

267-3

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))$

267-4

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))$

267-5

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))$

267-6

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))$

267-7

Maxima – 266 – draw – 13

sl106

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) )$

266-0

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))$

266-1
266-1-1

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]))$

266-2

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]))$

266-3

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))$

266-4

See also line_width.

Maxima – 265 – draw – 12

1DfC

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)) $

265-0

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

265-1

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

265-2

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]])) $

265-3

(%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.

265-4

(%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]])) $

265-5

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

sl107

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)) $

my_file

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))$

264-1

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

264-2

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],
        head_length = 0.7,
        head_angle = 10,
        vector([1, 1], 0, 6]),
        head_angle = 20,
        vector([2, 1], [0, 6]),
        head_angle = 30,
        vector([3, 1], [0, 6]),
        head_angle = 40,
        vector([4, 1], [0, 6]),
        head_angle = 60,
        vector([5, 1], [0, 6]),
        head_angle = 90,
        vector([6, 1], [0, 6]),
        head_angle = 120,
        vector([7, 1], [0, 6]),
        head_angle = 160,
        vector([8, 1], [0, 6]),
        head_angle = 180,
        vector([9, 1], [0, 6]) )$

264-3

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],
        head_length = 0.7,
        vector([1, 1], [6, 0]),
        head_both = true,
        vector([1, 7], [6, 0]) )$

264-4

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]),
        head_length = 1,
        vector([2, 1], [5, 5]),
        head_length = 0.5,
        vector([4, 1], [5, 5]),
        head_length = 0.25,
        vector([6, 1], [5, 5]))$

264-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],
        head_length = 1,
        vector([0, 1], [5, 5]), /* default type */
        head_type = 'empty,
        vector([3, 1], [5, 5]),
        head_type = 'nofilled,
        vector([6, 1], [5, 5]))$

264-6

See also head_both, head_angle, and head_length.

Maxima – 263 – draw – 10

D2HY

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))$

263-0

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)]

263-1

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]))$

263-2

(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)$

maxima_out

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)$

263-4

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

marisa

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) )$

262-0

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) )$

262-1

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)) $

262-2

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) ) $

262-3

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)) $

262-4

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.

myfile

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.

Maxima – 261 – draw – 8

cll1

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

enhanced3d
Default value: none.

If enhanced3d is none, surfaces are not colored in 3D plots. In order to get a colored surface, a list must be assigned to option enhanced3d, where the first element is an expression and the rest are the names of the variables or parameters used in that expression. A list such [f(x,y,z), x, y, z] means that point [x,y,z] of the surface is assigned number f(x,y,z), which will be colored according to the actual palette. For those 3D graphic objects defined in terms of parameters, it is possible to define the color number in terms of the parameters, as in [f(u), u], as in objects parametric and tube, or [f(u,v), u, v], as in object parametric_surface. While all 3D objects admit the model based on absolute coordinates, [f(x,y,z), x, y, z], only two of them, namely explicit and elevation_grid, accept also models defined on the [x,y] coordinates, [f(x,y), x, y]. 3D graphic object implicit accepts only the [f(x,y,z), x, y, z] model. Object points accepts also the [f(x,y,z), x, y, z] model, but when points have a chronological nature, model [f(k), k] is also valid, being k an ordering parameter.

When enhanced3d is assigned something different to none, options color and surface_hide are ignored.

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

In order to maintain back compatibility, enhanced3d = false is equivalent to enhanced3d = none, and enhanced3d = true is equivalent to enhanced3d = [z, x, y, z]. If an expression is given to enhanced3d, its variables must be the same used in the surface definition. This is not necessary when using lists.

See option palette to learn how palettes are specified.

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

(%i1) draw3d(
        enhanced3d = [x-z/10, x, y, z],
        palette = gray,
        explicit(20*exp(-x^2-y^2)-10, x, -3, 3, y, -3, 3))$

261-0

explicit object with coloring defined by the [f(x,y), x, y] model. The names of the variables defined in the lists may be different to those used in the definitions of the graphic objects; in this case, r corresponds to x, and s to y.

(%i2) draw3d(
        enhanced3d = [sin(r*s), r, s],
        explicit(20*exp(-x^2-y^2)-10, x, -3, 3, y, -3, 3))$

261-1

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

(%i3) draw3d(
        nticks = 100,
        line_width = 2,
        enhanced3d = [if y>= 0 then 1 else 0, x, y, z],
        parametric(sin(u)^2,cos(u), u, u, 0, 4*%pi))$

261-2

parametric object with coloring defined by the [f(u), u] model. In this case, (u-1)^2 is a shortcut for [(u-1)^2,u].

(%i4) draw3d(
        nticks = 60,
        line_width = 3,
        enhanced3d = (u-1)^2,
        parametric(cos(5*u)^2,sin(7*u), u-2, u, 0, 2))$

261-3

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

(%i5) m: apply(matrix,
        makelist(makelist(cos(i^2/80-k/30), k, 1, 30), i, 1, 20))$

(%i6) draw3d(
        enhanced3d = [cos(x*y*10), x, y],
        elevation_grid(m, -1, -1, 2, 2),
        xlabel = "x",
        ylabel = "y");
(%o6)                       [gr3d(elevation_grid)]

261-4

Pausa; altri esempi prossimamente.

Maxima – 260 – draw – 7

art-ma-5

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

data_file_name
Default value: "data.gnuplot".

This is the name of the file with the numeric data needed by Gnuplot to build the requested plot.

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.

See example in gnuplot_file_name.

delay
Default value: 5.

This is the delay in 1/100 seconds of frames in animated gif files.

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) 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
(%o1)          [gr2d(explicit), gr2d(explicit), gr2d(explicit)]

res-zzz

Option delay is only active in animated gif’s; it is ignored in any other case. See also terminal, and dimensions.

dimensions
Default value: [600,500].

Dimensions of the output terminal. Its value is a list formed by the width and the height. The meaning of the two numbers depends on the terminal you are working with.

With terminals gif, animated_gif, png, jpg, svg, screen, wxt, and aquaterm, the integers represent the number of points in each direction. If they are not intergers, they are rounded.

With terminals eps, eps_color, pdf, and pdfcairo, both numbers represent hundredths of cm, which means that, by default, pictures in these formats are 6 cm in width and 5 cm in height.

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.

Option dimensions applied to file output and to wxt canvas.

(%i2) draw2d(
        dimensions = [300,300],
        terminal = 'png,
        explicit(x^4,x,-1,1)) $

(%i3) draw2d(
        dimensions = [300,300],
        terminal = 'wxt,
        explicit(x^4,x,-1,1)) $

260-1

Il file maxima_out.png è uguale alla window prodotta da wxt.

Option dimensions applied to eps output. We want an eps file with A4 portrait dimensions.

(%i4) A4portrait: 100*[21, 29.7]$

(%i5) draw3d(
        dimensions = A4portrait,
        terminal = 'eps,
        explicit(x^2-y^2,x,-2,2,y,-2,2)) $
$ file maxima_out.eps
maxima_out.eps: PostScript document text conforming DSC level 2.0, type EPS

When true, functions to be drawn are considered as complex functions whose real part value should be plotted; when false, nothing will be plotted when the function does not give a real value.

This option affects objects explicit and parametric in 2D and 3D, and parametric_surface.

(%i6) draw2d(
        draw_realpart = false,
        explicit(sqrt(x^2 - 4*x) - x, x, -1, 5),
        color = red,
        draw_realpart = true,
        parametric(x,sqrt(x^2 - 4*x) - x + 1, x, -1, 5));
(%o6)                    [gr2d(explicit, parametric)]

260-4

Maxima – 259 – draw – 6

k2xytTZf

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

colorbox
Default value: true.

If colorbox is true, a color scale without label is drawn together with image 2D objects, or coloured 3d objects. If colorbox is false, no color scale is shown. If colorbox is a string, a color scale with label is drawn.

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

Color scale and images.

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

(%i2) draw(
        gr2d(image(im, 0, 0, 30, 30)),
        gr2d(colorbox = false, image(im, 0, 0, 30, 30))
      )$

259-0

Color scale and 3D coloured object.

(%i3) draw3d(
        colorbox = "Magnitude",
        enhanced3d = true,
        explicit(x^2+y^2, x, -1, 1, y, -1, 1))$

259-1

See also palette_draw.

columns
columns is the number of columns in multiple plots.

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.

(%i4) scene1: gr2d(title = "Ellipse",
                nticks = 30,
                parametric(2*cos(t), 5*sin(t), t, 0, 2*%pi))$

(%i5) scene2: gr2d(title = "Triangle",
                polygon([4, 5, 7], [6, 4, 2]))$
(%i6) draw(scene1, scene2, columns = 2)$

259-2

contour
Default value: none.

Option contour enables the user to select where to plot contour lines. Possible values are:

  • none: no contour lines are plotted.
  • base: contour lines are projected on the xy plane.
  • surface: contour lines are plotted on the surface.
  • both: two contour lines are plotted: on the xy plane and on the surface.
  • map: contour lines are projected on the xy plane, and the view point is set just in the vertical.

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

(%i7) draw3d(explicit(20*exp(-x^2-y^2)-10, x, 0, 2, y, -3, 3),
             contour_levels = 15,
             contour = both,
             surface_hide = true) $

259-3

(%i8) draw3d(explicit(20*exp(-x^2-y^2)-10, x, 0, 2, y, -3, 3),
             contour_levels = 15,
             contour = map) $

259-4

contour_levels
Default value: 5.

This graphic option controls the way contours are drawn. contour_levels can be set to a positive integer number, a list of three numbers or an arbitrary set of numbers:

  • When option contour_levels is bounded to positive integer n, n contour lines will be drawn at equal intervals. By default, five equally spaced contours are plotted.
  • When option contour_levels is bounded to a list of length three of the form [lowest, s, highest], contour lines are plotted from lowest to highest in steps of s.
  • When option contour_levels is bounded to a set of numbers of the form {n1, n2, ...}, contour lines are plotted at values n1, n2, ....

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

Ten equally spaced contour lines. The actual number of levels can be adjusted to give simple labels.

(%i9) draw3d(color = green,
             explicit(20*exp(-x^2-y^2)-10, x, 0, 2, y, -3, 3),
             contour_levels = 10,
             contour = both,
             surface_hide = true) $

259-5

From -8 to 8 in steps of 4.

(%i10) draw3d(color = green,
              explicit(20*exp(-x^2-y^2)-10, x, 0, 2, y, -3, 3),
              contour_levels = [-8, 4, 8],
              contour = both,
              surface_hide = true) $

259-6

Isolines at levels -7, -6, 0.8 and 5.

(%i11) draw3d(color = green,
              explicit(20*exp(-x^2-y^2)-10, x, 0, 2, y, -3, 3),
              contour_levels = {-7, -6, 0.8, 5},
              contour = both,
              surface_hide = true) $

259-7