[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

47. draw


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

47.1 Introduction to draw

draw is a Maxima-Gnuplot interface.

There are three functions to be used at Maxima level: draw2d, draw3d and draw.

Follow this link for more elaborated examples of this package:

http://www.telefonica.net/web2/biomates/maxima/gpdraw

You need Gnuplot 4.2 to run this program.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

47.2 Definitions for draw

Graphic option: xrange

Default value: false

If xrange is false, the range for the x coordinate is computed automatically.

If the user wants a specific interval for x, it must be given as a Maxima list, as in xrange=[-2, 3].

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

Example:

 
(%i1) load(draw)$
(%i2) draw2d(xrange = [-3,5],
             explicit(x^2,x,-1,1))$

See also yrange and zrange.

Graphic option: yrange

Default value: false

If yrange is false, the range for the y coordinate is computed automatically.

If the user wants a specific interval for y, it must be given as a Maxima list, as in yrange=[-2, 3].

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

Example:

 
(%i1) load(draw)$
(%i2) draw2d(yrange = [-2,3],
             explicit(x^2,x,-1,1),
             xrange = [-3,3])$

See also xrange and zrange.

Graphic option: zrange

Default value: false

If zrange is false, the range for the z coordinate is computed automatically.

If the user wants a specific interval for z, it must be given as a Maxima list, as in zrange=[-2, 3].

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

Example:

 
(%i1) load(draw)$
(%i2) draw3d(yrange = [-3,3],
             zrange = [-2,5],
             explicit(x^2+y^2,x,-1,1,y,-1,1),
             xrange = [-3,3])$

See also yrange and zrange.

Graphic option: 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.

Example:

 
(%i1) load(draw)$
(%i2) draw2d(explicit(log(x),x,0.01,5),
             logx = true)$

See also logy and logz.

Graphic option: 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.

Example:

 
(%i1) load(draw)$
(%i2) draw2d(logy = true,
             explicit(exp(x),x,0,5))$

See also logx and logz.

Graphic option: 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.

Example:

 
(%i1) load(draw)$
(%i2) draw3d(logz = true,
             explicit(exp(u^2+v^2),u,-2,2,v,-2,2))$

See also logx and logy.

Graphic option: terminal

Default value: screen

Selects the terminal to be used by Gnuplot; possible values are: screen (default), png, jpg, eps, and eps_color.

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.

Examples:

 
(%i1) load(draw)$
(%i2) /* screen terminal (default) */
      draw2d(explicit(x^2,x,-1,1))$
(%i3) /* png file */
      draw2d(terminal  = 'png,
             pic_width = 300,
             explicit(x^2,x,-1,1))$
(%i4) /* jpg file */
      draw2d(terminal   = 'jpg,
             pic_width  = 300,
             pic_height = 300,
             explicit(x^2,x,-1,1))$
(%i5) /* eps file */
      draw2d(file_name = "myfile",
             explicit(x^2,x,-1,1),
             terminal  = 'eps)$

See also file_name, pic_width, and pic_height.

Graphic option: grid

Default value: false

If grid is true, a grid will be drawn on the xy plane.

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

Example:

 
(%i1) load(draw)$
(%i2) draw2d(grid = true,
             explicit(exp(u),u,-2,2))$
Graphic option: title

Default value: "" (empty string)

Option title stores a Maxima string with 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.

Example:

 
(%i1) load(draw)$
(%i2) draw2d(explicit(exp(u),u,-2,2),
             title = "Exponential function")$
Graphic option: xlabel

Default value: "" (empty string)

Option xlabel stores a Maxima string with the label for the x axis. By default, no label is written.

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

Example:

 
(%i1) load(draw)$
(%i2) draw2d(xlabel = "Time",
             explicit(exp(u),u,-2,2),
             ylabel = "Population")$

See also ylabel, and zlabel.

Graphic option: ylabel

Default value: "" (empty string)

Option ylabel stores a Maxima string with the label for the y axis. By default, no label is written.

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

Example:

 
(%i1) load(draw)$
(%i2) draw2d(xlabel = "Time",
             ylabel = "Population",
             explicit(exp(u),u,-2,2) )$

See also xlabel, and zlabel.

Graphic option: zlabel

Default value: "" (empty string)

Option zlabel stores a Maxima string with the label for the z axis. By default, no label is written.

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

Example:

 
(%i1) load(draw)$
(%i2) draw3d(zlabel = "Z variable",
             ylabel = "Y variable",
             explicit(sin(x^2+y^2),x,-2,2,y,-2,2),
             xlabel = "X variable" )$

See also xlabel, and ylabel.

Graphic option: xtics

Default value: true

If xtics is true, tics will be written in the x axis.

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

Example:

 
(%i1) load(draw)$
(%i2) /* No tics in the x-axis */
      draw2d(xtics = false,
             explicit(exp(u),u,-2,2))$

See also ytics, and ztics.

Graphic option: ytics

Default value: true

If ytics is true, tics will be written in the y axis.

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

Example:

 
(%i1) load(draw)$
(%i2) draw2d(ytics = false,
             explicit(exp(u),u,-2,2),
             xtics = false)$

See also xtics, and ztics.

Graphic option: ztics

Default value: true

If ztics is true, tics will be written in the z axis.

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

Example:

 
(%i1) load(draw)$
(%i2) /* No tics in the z-axis */
      draw3d(ztics = false,
             explicit(sin(x^2+y^2),x,-2,2,y,-2,2) )$

See also xtics, and ytics.

Graphic option: rot_vertical

Default value: 60

rot_vertical is the angle (in degrees) of vertical rotation (around the x axis) to set the view point in 3d scenes.

The angle is bounded to the [0, 180] interval.

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

Example:

 
(%i1) load(draw)$
(%i2) draw3d(rot_vertical = 170,
             explicit(sin(x^2+y^2),x,-2,2,y,-2,2) )$

See also rot_horizontal.

Graphic option: rot_horizontal

Default value: 30

rot_horizontal is the angle (in degrees) of horizontal rotation (around the z axis) to set the view point in 3d scenes.

The angle is bounded to the [0, 360] interval.

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

Example:

 
(%i1) load(draw)$
(%i2) draw3d(rot_vertical = 170,
             rot_horizontal = 360,
             explicit(sin(x^2+y^2),x,-2,2,y,-2,2) )$

See also rot_vertical.

Graphic option: xy_file

Default value: "" (empty string)

xy_file is the name of the file where the coordinates will be saved after clicking with the mouse button and hitting the 'x' key. By default, no coordinates are saved.

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

Graphic option: 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.

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

Example:

The dumb terminal is not supported by package draw, but it is possible to set it by making use of option user_preamble,

 
(%i1) load(draw)$
(%i2) draw2d(explicit(exp(x)-1,x,-1,1),
             parametric(cos(u),sin(u),u,0,2*%pi),
             user_preamble="set terminal dumb")$
Graphic option: file_name

Default value: "maxima_out"

This is the name of the file where terminals png, jpg, eps and eps_color 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.

Example:

 
(%i1) load(draw)$
(%i2) draw2d(file_name = "myfile",
             explicit(x^2,x,-1,1),
             terminal  = 'png)$

See also terminal, pic_width, and pic_height.

Graphic option: pic_width

Default value: 640

This is the width of the bitmap file generated by terminals png and jpg.

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.

Example:

 
(%i1) load(draw)$
(%i2) draw2d(terminal   = 'png,
             pic_width  = 300,
             pic_height = 300,
             explicit(x^2,x,-1,1))$

See also terminal, file_name, and pic_height.

Graphic option: pic_height

Default value: 640

This is the height of the bitmap file generated by terminals png and jpg.

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.

Example:

 
(%i1) load(draw)$
(%i2) draw2d(terminal   = 'png,
             pic_width  = 300,
             pic_height = 300,
             explicit(x^2,x,-1,1))$

See also terminal, file_name, and pic_width.

Graphic option: eps_width

Default value: 12

This is the width (measured in cm) of the Postscipt file generated by terminals eps and eps_color.

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.

Example:

 
(%i1) load(draw)$
(%i2) draw2d(terminal   = 'eps,
             eps_width  = 3,
             eps_height = 3,
             explicit(x^2,x,-1,1))$

See also terminal, file_name, and eps_height.

Graphic option: eps_height

Default value: 8

This is the height (measured in cm) of the Postscipt file generated by terminals eps and eps_color.

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.

Example:

 
(%i1) load(draw)$
(%i2) draw2d(terminal   = 'eps,
             eps_width  = 3,
             eps_height = 3,
             explicit(x^2,x,-1,1))$

See also terminal, file_name, and eps_width.

Graphic option: axis_bottom

Default value: true

If axis_bottom is true, the bottom axis is shown in 2d scenes.

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

Example:

 
(%i1) load(draw)$
(%i2) draw2d(axis_bottom = false,
             explicit(x^3,x,-1,1))$

See also axis_left, axis_top, axis_right, and axis_3d.

Graphic option: axis_left

Default value: true

If axis_left is true, the left axis is shown in 2d scenes.

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

Example:

 
(%i1) load(draw)$
(%i2) draw2d(axis_left = false,
             explicit(x^3,x,-1,1))$

See also axis_bottom, axis_top, axis_right, and axis_3d.

Graphic option: axis_top

Default value: true

If axis_top is true, the top axis is shown in 2d scenes.

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

Example:

 
(%i1) load(draw)$
(%i2) draw2d(axis_top = false,
             explicit(x^3,x,-1,1))$

See also axis_bottom, axis_left, axis_right, and axis_3d.

Graphic option: axis_right

Default value: true

If axis_right is true, the right axis is shown in 2d scenes.

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

Example:

 
(%i1) load(draw)$
(%i2) draw2d(axis_right = false,
             explicit(x^3,x,-1,1))$

See also axis_bottom, axis_left, axis_top, and axis_3d.

Graphic option: axis_3d

Default value: true

If axis_3d is true, the x, y and z axis are shown in 3d scenes.

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

Example:

 
(%i1) load(draw)$
(%i2) draw3d(axis_3d = false,
             explicit(sin(x^2+y^2),x,-2,2,y,-2,2) )$

See also axis_bottom, axis_left, axis_top, and axis_right for axis in 2d.

Graphic option: palette

Default value: color

palette indicates how to map the real values of a matrix passed to object image onto color components.

palette is 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.

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

Examples:

 
(%i1) load(draw)$
(%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))$

See also colorbox.

Graphic option: colorbox

Default value: true

If colorbox is true, a color scale is drawn together with image objects.

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

Example:

 
(%i1) load(draw)$
(%i2) im: apply('matrix,
                 makelist(makelist(random(200),i,1,30),i,1,30))$
(%i3) draw2d(image(im,0,0,30,30))$
(%i4) draw2d(colorbox=false, image(im,0,0,30,30))$

See also palette.

Graphic option: enhanced3d

Default value: false

If enhanced3d is true, surfaces are colored in 3d plots; in other words, it sets Gnuplot's pm3d mode.

See option palette to learn how palettes are specified.

Example:

 
(%i1) load(draw)$
(%i2) draw3d(surface_hide = true,
             enhanced3d   = true,
             palette      = gray,
             explicit(20*exp(-x^2-y^2)-10,x,-3,3,y,-3,3))$
Graphic option: point_size

Default value: 1

point_size sets the size for plotted points. It must be a non negative number.

This option affects the following graphic objects:

Example:

 
(%i1) load(draw)$
(%i2) 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)))$
Graphic option: point_type

Default value: 1

point_type is an index (greater or equal than -1) to specify how points are displayed. Point colors are controlled with this option.

This option affects the following graphic objects:

Example:

 
(%i1) load(draw)$
(%i2) draw2d(xrange = [0,10],
             yrange = [0,10],
             point_size = 3,
             point_type = 1,
             points([[1,1],[5,1],[9,1]]),
             point_type = 2,
             points([[1,2],[5,2],[9,2]]),
             point_type = 3,
             points([[1,3],[5,3],[9,3]]),
             point_type = 4,
             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 = 7,
             points([[1,7],[5,7],[9,7]]),
             point_type = 8,
             points([[1,8],[5,8],[9,8]]),
             point_type = 9,
             points([[1,9],[5,9],[9,9]]) )$
Graphic option: points_joined

Default value: false

If points_joined is true, points are joined by lines.

This option affects the following graphic objects:

Example:

 
(%i1) load(draw)$
(%i2) draw2d(xrange        = [0,10],
             yrange        = [0,4],
             point_size    = 3,
             point_type    = 1,
             line_type     = 3,
             points([[1,1],[5,1],[9,1]]),
             points_joined = true,
             point_type    = 3,
             line_type     = 5,
             points([[1,2],[5,2],[9,2]]),
             point_type    = 5,
             line_type     = 8,
             line_width    = 7,
             points([[1,3],[5,3],[9,3]]) )$
Graphic option: filled_func

Default value: false

filled_func indicates whether a function is filled (true) or not (false).

This option affects only the 2d graphic object explicit.

Example:

 
(%i1) load(draw)$
(%i2) draw2d(fill_color  = red,
             filled_func = true,
             explicit(sin(x),x,0,10) )$

See also fill_color.

Graphic option: transparent

Default value: false

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

This option affects the following graphic objects:

Example:

 
(%i1) load(draw)$
(%i2) draw2d(polygon([[3,2],[7,2],[5,5]]),
             transparent = true,
             color       = blue,
             polygon([[5,2],[9,2],[7,5]]) )$
Graphic option: border

Default value: true

If border is true, borders of polygons are painted according to line_type and line_width.

This option affects the following graphic objects:

Example:

 
(%i1) load(draw)$
(%i2) draw2d(color       = brown,
             line_width  = 8,
             polygon([[3,2],[7,2],[5,5]]),
             border      = false,
             fill_color  = blue,
             polygon([[5,2],[9,2],[7,5]]) )$
Graphic option: 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.

Example:

 
(%i1) load(draw)$
(%i2) draw2d(xrange      = [0,8],
             yrange      = [0,8],
             head_length = 0.7,
             vector([1,1],[6,0]),
             head_both   = true,
             vector([1,7],[6,0]) )$

See also head_length, head_angle, and head_type.

Graphic option: 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.

Example:

 
(%i1) load(draw)$
(%i2) 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]))$

See also head_both, head_angle, and head_type.

Graphic option: 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.

Example:

 
(%i1) load(draw)$
(%i2) 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]) )$

See also head_both, head_length, and head_type.

Graphic option: 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.

Example:

 
(%i1) load(draw)$
(%i2) 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]))$

See also head_both, head_angle, and head_length.

Graphic option: 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.

Example:

 
(%i1) load(draw)$
(%i2) 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.

Graphic option: 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.

Example:

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

 
(%i1) load(draw)$
(%i2) 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.

Graphic option: color

Default value: "black"

color specifies the color for plotting lines, points, borders of polygons and labels.

Colors can be given as names or in hexadecimal rgb code.

Available color names are: "white", "black", "gray0", "grey0", "gray10", "grey10", "gray20", "grey20", "gray30", "grey30", "gray40", "grey40", "gray50", "grey50", "gray60", "grey60", "gray70", "grey70", "gray80", "grey80", "gray90", "grey90", "gray100", "grey100", "gray", "grey", "light-gray", "light-grey", "dark-gray", "dark-grey", "red", "light-red", "dark-red", "yellow", "light-yellow", "dark-yellow", "green", "light-green", "dark-green", "spring-green", "forest-green", "sea-green", "blue", "light-blue", "dark-blue", "midnight-blue", "navy", "medium-blue", "royalblue", "skyblue", "cyan", "light-cyan", "dark-cyan", "magenta", "light-magenta", "dark-magenta", "turquoise", "light-turquoise", "dark-turquoise", "pink", "light-pink", "dark-pink", "coral", "light-coral", "orange-red", "salmon", "light-salmon", "dark-salmon", "aquamarine", "khaki", "dark-khaki", "goldenrod", "light-goldenrod", "dark-goldenrod", "gold", "beige", "brown", "orange", "dark-orange", "violet", "dark-violet", "plum" and "purple".

Cromatic componentes in hexadecimal code are introduced in the form "#rrggbb".

Example:

 
(%i1) load(draw)$
(%i2) draw2d(explicit(x^2,x,-1,1), /* default is black */
             color = "red",
             explicit(0.5 + x^2,x,-1,1),
             color = blue,
             explicit(1 + x^2,x,-1,1),
             color = "light-blue", /* double quotes if - is used */
             explicit(1.5 + x^2,x,-1,1),
             color = "#23ab0f",
             label("This is a label",0,1.2)  )$

See also fill_color.

Graphic option: 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.

Graphic option: 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:

Example:

 
(%i1) load(draw)$
(%i2) 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))$

See also line_type.

Graphic option: line_type

Default value: solid

line_type indicates how lines are displayed; possible values are solid and dots.

This option affects the following graphic objects:

Example:

 
(%i1) load(draw)$
(%i2) 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.

Graphic option: nticks

Default value: 30

nticks is the number of sample points used by the plotting routine.

This option affects the following graphic objects:

Example:

 
(%i1) load(draw)$
(%i2) draw2d(transparent = true,
             ellipse(0,0,4,2,0,180),
             nticks = 5,
             ellipse(0,0,4,2,180,180) )$
Graphic option: adapt_depth

Default value: 10

adapt_depth is the maximum number of splittings used by the adaptive plotting routine.

This option is relevant only for 2d explicit functions.

Graphic option: 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:

Example:

 
(%i1) load(draw)$
(%i2) draw2d(key = "Sinus",
             explicit(sin(x),x,0,10),
             key = "Cosinus",
             line_type = 3,
             explicit(cos(x),x,0,10) )$
Graphic option: xu_grid

Default value: 30

xu_grid is the number of coordinates of the first variable (x in explicit and u in parametric 3d surfaces) to build the grid of sample points.

This option affects the following graphic objects:

Example:

 
(%i1) load(draw)$
(%i2) draw3d(xu_grid = 10,
             yv_grid = 50,
             explicit(x^2+y^2,x,-3,3,y,-3,3) )$

See also yv_grid.

Graphic option: yv_grid

Default value: 30

yv_grid is the number of coordinates of the second variable (y in explicit and v in parametric 3d surfaces) to build the grid of sample points.

This option affects the following graphic objects:

Example:

 
(%i1) load(draw)$
(%i2) draw3d(xu_grid = 10,
             yv_grid = 50,
             explicit(x^2+y^2,x,-3,3,y,-3,3) )$

See also xu_grid.

Graphic option: 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.

Example:

 
(%i1) load(draw)$
(%i2) 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)) )$
Graphic option: contour

Default value: none

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

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

Example:

 
(%i1) load(draw)$
(%i2) draw3d(explicit(20*exp(-x^2-y^2)-10,x,0,2,y,-3,3),
             contour_levels = 15,
             contour        = both,
             surface_hide   = true) $
Graphic option: contour_levels

Default value: 5

contour_levels is the number of levels in contour plots.

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

Example:

 
(%i1) load(draw)$
(%i2) draw3d(explicit(20*exp(-x^2-y^2)-10,x,0,2,y,-3,3),
             contour_levels = 15,
             contour        = both,
             surface_hide   = true) $
Graphic option: columns

Default value: 1

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.

Example:

 
(%i1) load(draw)$
(%i2) scene1: gr2d(title="Ellipse",
                   nticks=30,
                   parametric(2*cos(t),5*sin(t),t,0,2*%pi))$
(%i3) scene2: gr2d(title="Triangle",
                   polygon([4,5,7],[6,4,2]))$
(%i4) draw(scene1, scene2, columns = 2)$
Graphic option: 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.

Graphic option: 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.

Scene constructor: gr2d (graphic option, ..., graphic object, ...)

Function gr2d builds an object describing a 2d scene. Arguments are graphic options and graphic objects. This scene is interpreted sequentially: graphic options affect those graphic objects placed on its right.

To make use of this function, write first load(draw).

This is the list of graphic objects available for scenes in two dimensions:

See also the following graphic options: xrange, yrange, logx, logy, terminal, grid, title, xlabel, ylabel, xtics, ytics, xy_file, file_name, pic_width, pic_height, eps_width, eps_height, user_preamble, axis_bottom, axis_left, axis_top, and axis_right.

Scene constructor: gr3d (graphic option, ..., graphic object, ...)

Function gr3d builds an object describing a 3d scene. Arguments are graphic options and graphic objects. This scene is interpreted sequentially: graphic options affect those graphic objects placed on its right.

To make use of this function, write first load(draw).

This is the list of graphic objects available for scenes in three dimensions:

See also the following graphic options: xrange, yrange, zrange, logx, logy, logz, terminal, grid, title, xlabel, ylabel, zlabel, xtics, ytics, ztics, xy_file, user_preamble, axis_bottom, axis_left, axis_top, file_name, pic_width, pic_height, eps_width, eps_height, axis_right, rot_vertical, rot_horizontal, axis_3d, xu_grid, yv_grid, surface_hide, contour, contour_levels, palette, colorbox and enhanced3d.

Function: draw (gr2d, ..., gr3d, ..., options, ...)

Plots a series of scenes; its arguments are gr2d and gr3d objects, together with some options. By default, the scenes are put together in one column.

Function draw accepts two possible options: terminal and columns.

Functions draw2d and draw3d are short cuts to be used when only one scene is required, in two or three dimensions, respectively.

To make use of this function, write first load(draw).

Example:

 
(%i1) load(draw)$
(%i2) scene1: gr2d(title="Ellipse",
                   nticks=30,
                   parametric(2*cos(t),5*sin(t),t,0,2*%pi))$
(%i3) scene2: gr2d(title="Triangle",
                   polygon([4,5,7],[6,4,2]))$
(%i4) draw(scene1, scene2, columns = 2)$
Function: draw2d (option, graphic object, ...)

This function is a short cut for draw2d(gr2d(options, ..., graphic object, ...)).

It can be used to plot a unique scene in 2d.

To make use of this function, write first load(draw).

Function: draw3d (option, graphic object, ...)

This function is a short cut for draw3d(gr3d(options, ..., graphic object, ...)).

It can be used to plot a unique scene in 3d.

To make use of this function, write first load(draw).

Variable: draw_pipes

Default value: true

When draw_pipes is true, Maxima communicates with Gnuplot via pipes. If draw_pipes is false, Maxima communicates with Gnuplot via files. This is only useful in non Windows systems.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Robert Dodier on May, 2 2007 using texi2html 1.76.