Previous Up Next

17.1.2  Graph and geometric objects attributes

There are two kinds of attributes for graphs and geometric objects: global attributes of a graphic scene and individual attributes for the specific geometric objects in the scene.

Individual attributes

Graphic attributes are optional arguments of the form display=value. They must be given as the last argument of a graphic instruction. Attributes are ordered in several categories: color, point shape, point width, line style, line thickness, legend value, position and presence. In addition, surfaces may be filled or not, 3D surfaces may be filled with a texture, 3D objects may also have properties with respect to the light. Attributes of different categories may be combined with +, e.g. in:

plotfunc(x^2+y^2,[x,y],display=red+line_width_3+filled)

The graphic attributes are:

Color
which is set with display=value or color=value. The values can be:
Point shape
which is set with display=value, where value can be one of: rhombus_point, plus_point, square_point, cross_point, triangle_point, star_point, point_point or invisible_point.
Point width
which is set with display=value. The values can be:

point_width_n where n is an integer between 1 and 7.

Line thickness
which is set with thickness=n or display=line_width_n where n is an integer between 1 and 7.
Line shape
which is set with display=value, where value can be one of: dash_line, solid_line, dashdot_line, dashdotdot_line, cap_flat_line, cap_square_line or cap_round_line.
Legend
where the text is set with legend="legendname" and the position is set with display=value, where value is quadrantn for some n∈{1,2,3,4}. These values correspond to the position of the legend of the object (using the trigonometric plane conventions). The legend is not displayed if the attribute display=hidden_name is added.
Filling
which is set with display=filled.
Image texture
which is set gl_texture="picture_filename" and fills a surface with a texture. See the interface manual for a more complete description and for gl_material options.

Examples

(See Section 24.9.3, Section 24.5.2, Section 24.3.3 and Section 24.6.3 for information on the commands used.)

polygon(-1,-i,1,2*i,legend="P")
point(1+i,legend="hello")
color(segment(0,1+i),red)

By entering

segment(0,1+i,color=red)

we get the same result as above.

Global attributes

The following attributes are shared by all objects of the same scene:

Examples

title="median_line";triangle(-1-i,1,1+i);median_line(-1-i,1,1+i); median_line(1,-1-i,1+i);median_line(1+i,1,-1-i)
labels=["u","v"];plotfunc(u+1,u)

Previous Up Next