| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| 47.1 Introduction to draw | ||
| 47.2 Definitions for draw |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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] | [ ? ] |
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.
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.
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.
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.
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.
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.
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.
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))$
|
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")$
|
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.
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.
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.
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.
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.
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.
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.
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.
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.
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")$
|
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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))$
|
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:
gr2d: points.
gr3d: points.
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)))$
|
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:
gr2d: points.
gr3d: points.
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]]) )$
|
Default value: false
If points_joined is true, points are joined by lines.
This option affects the following graphic objects:
gr2d: points.
gr3d: points.
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]]) )$
|
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.
Default value: false
If transparent is true, interior regions of polygons are
filled according to fill_color.
This option affects the following graphic objects:
gr2d: polygon, rectangle, and ellipse.
Example:
(%i1) load(draw)$
(%i2) draw2d(polygon([[3,2],[7,2],[5,5]]),
transparent = true,
color = blue,
polygon([[5,2],[9,2],[7,5]]) )$
|
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:
gr2d: polygon, rectangle, and ellipse.
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]]) )$
|
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.
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.
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.
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.
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.
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.
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.
Default value: "red"
fill_color specifies the color for filling polygons and
2d explicit functions.
See color to learn how colors are specified.
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.
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.
Default value: solid
line_type indicates how lines are displayed; possible values are
solid and dots.
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.
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.
Default value: 30
nticks is the number of sample points used by the plotting routine.
This option affects the following graphic objects:
gr2d: ellipse, explicit, parametric and polar.
gr3d: parametric.
Example:
(%i1) load(draw)$
(%i2) draw2d(transparent = true,
ellipse(0,0,4,2,0,180),
nticks = 5,
ellipse(0,0,4,2,180,180) )$
|
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.
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.
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) )$
|
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:
gr3d: explicit and parametric_surface.
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.
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:
gr3d: explicit and parametric_surface.
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.
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)) )$
|
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.
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) $
|
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) $
|
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)$
|
Default value: [50, 50]
ip_grid sets the grid for the first sampling in implicit plots.
This option is relevant only for implicit objects.
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.
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:
points([[x1,y1], [x2,y2], [x3,y3],...]) or points([x1,x2,x3,...], [y1,y2,y3,...]):
allocates points [x1,y1], [x2,y2], [x2,y2], ....
This object is affected by the following graphic options: point_size,
point_type, points_joined, line_width, key,
line_type and color.
Example:
(%i1) load(draw)$
(%i2) draw2d(key = "Small points",
points(makelist([random(20),random(50)],k,1,10)),
point_type = 6,
point_size = 3,
points_joined = true,
key = "Great points",
points(makelist(k,k,1,20),makelist(random(30),k,1,20)))$
|
polygon([[x1,y1], [x2,y2], [x3,y3],...]) or polygon([x1,x2,x3,...], [y1,y2,y3,...]):
plots a polygon with vertices [x1,y1], [x2,y2], [x2,y2], ... on the plane.
This object is affected by the following graphic options: transparent,
fill_color, border, line_width, key,
line_type and color.
Example:
(%i1) load(draw)$
(%i2) draw2d(color = "#e245f0",
line_width = 8,
polygon([[3,2],[7,2],[5,5]]),
border = false,
fill_color = yellow,
polygon([[5,2],[9,2],[7,5]]) )$
|
rectangle([x1,y1], [x2,y2]):
plots a rectangle with opposite vertices [x1,y1] and [x2,y2].
This object is affected by the following graphic options: transparent,
fill_color, border, line_width, key,
line_type and color.
Example:
(%i1) load(draw)$
(%i2) draw2d(fill_color = red,
line_width = 6,
line_type = dots,
transparent = false,
fill_color = blue,
rectangle([-2,-2],[8,-1]), /* opposite vertices */
transparent = true,
line_type = solid,
line_width = 1,
rectangle([9,4],[2,-1.5]),
xrange = [-3,10],
yrange = [-3,4.5] )$
|
ellipse(xc, yc, a, b, ang1, ang2):
plots an ellipse centered at [xc, yc] with horizontal and vertical
semi axis a and b, respectively, from angle ang1 to angle
ang2.
This object is affected by the following graphic options: nticks,
transparent, fill_color, border, line_width,
line_type, key and color.
Example:
(%i1) load(draw)$
(%i2) draw2d(transparent = false,
fill_color = red,
color = gray30,
transparent = false,
line_width = 5,
ellipse(0,6,3,2,270,-270), /* center (x,y), a, b, start & end in degrees */
transparent = true,
color = blue,
line_width = 3,
ellipse(2.5,6,2,3,30,-90),
xrange = [-3,6],
yrange = [2,9] )$
|
label(string,x,y):
writes the string at point [x,y].
This object is affected by the following graphic options: label_alignment,
label_orientation and color.
Example:
In this example, a dummy point is added to get an image.
Package draw needs always data to draw an scene.
These colors may change in different terminals.
(%i1) load(draw)$
(%i2) draw2d(explicit(x^2,x,-1,1),
color = "red",
label("Label in red",0,0.3),
color = "#0000ff",
label("Label in blue",0,0.6),
color = "light-blue", /* double quotes if - is used */
label("Label in light-blue",0,0.9) )$
|
vector([x,y], [dx,dy]):
plots vector [dx,dy] with origin in [x,y].
This object is affected by the following graphic options: head_both,
head_length, head_angle, head_type, line_width,
line_type, key and color.
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_both = true,
head_type = 'nofilled,
line_type = dots,
vector([6,1],[5,5]))$
|
explicit(fcn,var,minval,maxval):
plots explicit function fcn, with variable var taking values
from minval to maxval.
This object is affected by the following graphic options: nticks,
adapt_depth, line_width, line_type, key,
filled_func, fill_color and color.
Example:
(%i1) load(draw)$
(%i2) draw2d(line_width = 3,
color = blue,
explicit(x^2,x,-3,3) )$
(%i3) draw2d(fill_color = brown,
filled_func = true,
explicit(x^2,x,-3,3) )$
|
implicit(fcn,x-var,x-minval,x-maxval,y-var,y-minval,y-maxval):
plots the implicit function defined by fcn, with variable x-var taking values
from x-minval to x-maxval, and variable y-var taking values
from y-minval to y-maxval.
This object is affected by the following graphic options: ip_grid,
ip_grid_in, line_width, line_type, key and color.
Example:
(%i1) load(draw)$
(%i2) draw2d(terminal = eps,
grid = true,
line_type = solid,
key = "y^2=x^3-2*x+1",
implicit(y^2=x^3-2*x+1, x, -4,4, y, -4,4),
line_type = dots,
key = "x^3+y^3 = 3*x*y^2-x-1",
implicit(x^3+y^3 = 3*x*y^2-x-1, x, -4,4, y, -4,4),
title = "Two implicit functions" )$
|
polar(radius,ang,minang,maxang):
plots function radius(ang) defined in polar coordinates, with variable ang
taking values from minang to maxang.
This object is affected by the following graphic options: nticks,
line_width, line_type, key and color.
Example:
(%i1) load(draw)$
(%i2) draw2d(user_preamble = "set grid polar",
nticks = 200,
xrange = [-5,5],
yrange = [-5,5],
line_type = 6,
line_width = 3,
title = "Hyperbolic Spiral",
polar(10/theta,theta,1,10*%pi) )$
|
parametric(xfun,yfun,par,parmin,parmax):
plots parametric function [xfun,yfun], with parameter par
taking values from parmin to parmax.
This object is affected by the following graphic options: nticks,
line_width, line_type, keyand color.
Example:
(%i1) load(draw)$
(%i2) draw2d(explicit(exp(x),x,-1,3),
color = red,
key = "This is the parametric one!!",
parametric(2*cos(rrr),rrr^2,rrr,0,2*%pi))$
|
image(im,x0,y0,width,height):
plots image im in the rectangular region from vertex (x0,y0) to
(x0+width,y0+height) on the real plane. Argument im must be a
matrix of real numbers, or a matrix of vectors of length three.
If im is a matrix of real numbers, pixel values are interpreted according
to graphic option palette, which 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.
If im is a matrix of vectors of length three, they are interpreted
as red, green and blue color components.
Examples:
If im is a matrix of real numbers, pixel values are interpreted according
to graphic option palette.
(%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.
If im is a matrix of vectors of length three, they are interpreted
as red, green and blue color components.
(%i1) load(draw)$
(%i2) im: apply(
'matrix,
makelist(
makelist([random(300),
random(300),
random(300)],i,1,30),i,1,30))$
(%i3) draw2d(image(im,0,0,30,30))$
|
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.
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:
points([[x1,y1,z1], [x2,y2,z2], [x3,y3,z3],...]) or
points([x1,x2,x3,...], [y1,y2,y3,...], [z1,z2,z3,...]):
allocates points [x1,y1,z1], [x2,y2,z2], [x2,y2,z3], ....
This object is affected by the following graphic options: point_size,
point_type, points_joined, line_width, key, line_type
and color.
Examples:
One tridimensional sample,
(%i1) load(draw)$
(%i2) load (numericalio)$
(%i3) s2 : read_matrix (file_search ("wind.data"))$
(%i4) draw3d(title = "Daily average wind speeds",
point_size = 2,
points(args(submatrix (s2, 4, 5))) )$
|
Two tridimensional samples,
(%i1) load(draw)$
(%i2) load (numericalio)$
(%i3) s2 : read_matrix (file_search ("wind.data"))$
(%i4) draw3d(title = "Daily average wind speeds. Two data sets",
point_size = 2,
key = "Sample from stations 1, 2 and 3",
points(args(submatrix (s2, 4, 5))),
point_type = 4,
key = "Sample from stations 1, 4 and 5",
points(args(submatrix (s2, 2, 3))) )$
|
label(string,x,y,z):
writes the string at point [x,y,z].
This object is affected by the following graphic options: label_alignment,
label_orientation and color.
Example:
(%i1) load(draw)$
(%i2) draw3d(explicit(exp(sin(x)+cos(x^2)),x,-3,3,y,-3,3),
color = red,
label("UP",-2,0,3),
color = blue,
label("DOWN",2,0,-3) )$
|
explicit(fcn,var1,minval1,maxval1,var2,minval2,maxval2):
plots explicit function fcn, with variable var1 taking values
from minval1 to maxval1 and variable var2 taking values
from minval2 to maxval2.
This object is affected by the following graphic options: xu_grid,
yv_grid, line_type, key and color.
Example:
(%i1) load(draw)$
(%i2) draw3d(key = "Gauss",
color = "#a02c00",
explicit(20*exp(-x^2-y^2)-10,x,-3,3,y,-3,3),
yv_grid = 10,
color = blue,
key = "Plane",
explicit(x+y,x,-5,5,y,-5,5),
surface_hide = true)$
|
parametric(xfun,yfun,zfun,par,parmin,parmax):
plots parametric curve [xfun,yfun,zfun], with parameter par
taking values from parmin to parmax.
This object is affected by the following graphic options: nticks,
line_width, line_type, key and color.
Example:
(%i1) load(draw)$
(%i2) draw3d(explicit(exp(sin(x)+cos(x^2)),x,-3,3,y,-3,3),
color = royalblue,
parametric(cos(5*u)^2,sin(7*u),u-2,u,0,2),
color = turquoise,
line_width = 2,
parametric(t^2,sin(t),2+t,t,0,2),
surface_hide = true,
title = "Surface & curves" )$
|
parametric_surface(xfun,yfun,zfun,par1,par1min,par1max,par2,par2min,par2max):
plots parametric surface [xfun,yfun,zfun], with parameter par1
taking values from par1min to par1max and parameter par2
taking values from par2min to par2max.
This object is affected by the following graphic options: xu_grid,
yv_grid, line_type, key and color.
Example:
(%i1) load(draw)$
(%i2) draw3d(title = "Sea shell",
xu_grid = 100,
yv_grid = 25,
rot_vertical = 100,
rot_horizontal = 20,
surface_hide = true,
parametric_surface(0.5*u*cos(u)*(cos(v)+1),
0.5*u*sin(u)*(cos(v)+1),
u*sin(v) - ((u+3)/8*%pi)^2 - 20,
u, 0, 13*%pi, v, -%pi, %pi) )$
|
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.
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)$
|
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).
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).
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.