'draw' package
Gnuplot interface
Introduction
This is a Maxima-Gnuplot interface.
There are three functions to be used at Maxima level: draw2d, draw3d and draw. To read the available documentation about functions, variables and graphic options, type as usual something as ? point_type.
More or less, this package works as follows. Scenes are described in gr2d or gr3d objects, which are then passed to function draw. If more than one scene is described, a multiplot will be generated, as in draw(gr2d(...),gr3d(...))
but if you want only one scene, draw2d(...) and draw3d(...) are equivalent to draw(gr2d(...)) and draw(gr3d(...)), respectively. See examples bellow.
Type ? gr2d and ? gr3d to know available graphic objects in two and three dimensions.
To make use of this package, type
load(draw) $
Graphic objects
Click on the items below to see examples of graphic objects plotted with the VTK libraries.
Programming graphics
The objects listed above are the basic elements to build more complex scenes.
Global options
Global options are those which are related to the whole plot. They can be written anywhere in the scene description.
- allocation. Used in multiplots. Some examples:
(1,
2)
- axis_3d. Removes all the axes in 3D scenes. Example:
(1,
2,
3)
- axis_top, axis_right. Show and hide axes. Some examples:
(1,
2,
3)
- background_color. Sets the background color. Example:
(1,
2,
3,
4,
5)
- cbrange. Sets the range of the color box. Example:
(1)
- cbtics. Sets the tics of the color box. Example:
(1)
- colorbox. Shows and hides the color box. Some examples:
(1,
2,
3,
4)
- columns. Number of columns in multiplots. Some examples:
(1,
2,
3,
4)
- contour. Plots contour lines on explicit surfaces. Some examples:
(1)
- contour_levels. Defines the levels to be plotted. Some examples:
(1)
- delay. Used in animations. Some examples:
(1,
2,
3)
- dimensions. Sets the dimensions of the plot in format [width, height]. Some examples:
(1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13)
- file_name. Sets the name of the graphic file. Some examples:
(1,
2,
3,
4,
5)
- font. Sets the font type. Example:
(1,
2,
3,
4)
- font_size. Sets the size of the fonts. Example:
(1,
2,
3,
4)
- grid. Used to draw grid lines on the plane. Some examples:
(1,
2,
3,
4,
5,
6,
7,
8)
- logcb. Sets the logarithmic scale in the color box. Example:
(1)
- logx, logy, logz. Indicates which axes must be transformed in logarithmic scales. Some examples:
(1,
2,
3)
- palette. In 3D scenes, selects the palette. Some examples:
(1,
2,
3,
4,
5,
6)
- proportional_axes. Proportional axes. Example:
(1,
2,
3,
4,
5,
6,
7)
- surface_hide. Hides the surface. Some examples:
(1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11)
- terminal. By default, the output terminal is the screen. Other terminals are:
PNG (1,
2),
SVG (1,
2),
WXT (1,
2,
3,
4,
5),
EPS (1,
2,
3,
4),
EPS_COLOR (1,
2,
3,
4,
5,
6),
GIF (1),
animated GIF (1,
2,
3,
4),
Multimode plots (1),
EPSLATEX_STANDALONE (1)
- title. Writes a title on the scene. Some examples:
(1,
2,
3,
4,
5,
6,
7,
8,
9,
10)
- user_preamble. Let's the user write his own Gnuplot code. Some examples:
(1,
2,
3)
- view. Positions the viewer in 3D scenes. Some examples:
(1,
2,
3)
- xaxis, xaxis_secondary, yaxis, yaxis_secondary, zaxis. Show and hide the axes. Some examples:
(1,
2,
3,
4,
5)
- xaxis_color, yaxis_color, zaxis_color. Set axes colors. Some examples:
(1,
2)
- xaxis_type, yaxis_type, zaxis_type. Set axes types. Some examples:
(1,
2)
- xaxis_width, yaxis_width, zaxis_width. Set axes widths. Some examples:
(1,
2)
- xlabel, ylabel, zlabel. Sets axes labels. Some examples:
(1,
2,
3,
4,
5,
6,
7)
- xrange, yrange, zrange. Sets the ranges of the axes. Example:
(1,
2,
3,
4)
- xtics, xtics_secondary, ytics, ytics_secondary, ztics. Show and hide axes tics. Some examples:
(1,
2,
3,
4,
5,
6,
7)
- xtics_axis. Show and hide axes tics. Some examples:
(1,
2)
- xtics_rotate, ytics_rotate. Rotates tics. Example:
(1)
- xy_file. Name of file where coordinates are saved. Example:
(1)
Local options
Local options are those which affect the appearance of individual graphic objects. They must be declared before the objects in the scene description.
- border. Shows and hides borders of polygons and ellipses. Example:
(1,
2,
3)
- capping. Declares if circles must be drawn at the extrems of a tube. Example:
(1)
- color. Sets the plotting color. Some examples:
(1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14)
- enhanced3d. In 3D scenes, defines a colored pattern to project on a surface. Some examples:
(1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11)
- error_type. Option for error plots. Some examples:
(1)
- filled_func. Indicates whether a 2d function must be filled or not. Default is not (false). Some examples:
(1,
2,
3)
- fill_color. Sets the color to fill an area. Some examples:
(1,
2,
3,
4,
5,
6,
7,
8,
9,
10)
- fill_density. Sets the color density. Example:
(1,
2)
- head_both. Option for vectors. Example:
(1)
- head_angle. Option for vector heads. Example:
(1)
- head_length. Option for vector heads. Example:
(1,
2,
3)
- key. Defines the label of an object to be written in the legend. Some examples:
(1,
2,
3,
4,
5,
6,
7,
8,
9,
10)
- label_alignment. Sets label alignment. Example:
(1,
2)
- label_orientation. Sets label orientation. Example:
(1)
- line_type. Sets the type of lines. Example:
(1,
2,
3,
4)
- line_width. Sets the width of lines. Some examples:
(1,
2,
3,
4,
5,
6,
7,
8,
9)
- nticks. Declares the number of points to be calculated for plotting curves. Some examples:
(1,
2,
3,
4,
5,
6)
- points_joined. true, false, or impulses. Some examples:
(1,
2,
3,
4,
5)
- point_size. Sets the size of points. Some examples:
(1,
2,
3)
- point_type. Sets the type of points. Some examples:
(1,
2,
3,
4,
5)
- transform. Allows to perform geometric transformations. Example:
(1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13)
- transparent. Makes 2D polygons transparent. Example:
(1,
2,
3,
4,
5,
6,
7)
- unit_vectors. Plot vector of unit length. Example:
(1)
- x_voxel, y_voxel, z_voxel. Sets the resolution in 2D regions and implicit 3D objects. Example:
(1,
2,
3,
4)
- xu_grid, yv_grid. Defines the resolution for plotting surfaces. Some examples:
(1,
2,
3,
4,
5,
6,
7,
8,
9)
© 2011-2016, TecnoStats