Markers

Markers are very simple objects; they make marks on the drawing canvas. Markers draw marks relative to a point, usually around the center of the mark. This mark is referred to as the origin of the mark for the rest of this chapter.

Markers are categorized by the shape of the marks they draw. Markers are most often used indirectly, by specifying a marker label. An example of this is the marker_shape axis of the scatter plot. Markers are created directly when creating labeled markers, or in more advanced applications, such as when writing a custom plot.

darrow

toolbox.new_marker('darrow'[, rotation=0, angle=90, size=5, stroke_color="#000000FF", stroke_width=1])
toolbox.new_marker('arrow'[, rotation=0, angle=90, size=5, stroke_color="#000000FF", stroke_width=1])

Draws a chevron, or simple arrow head – two line segments coming together in an angle. Arrows pointing to the left, right, top or bottom with varying degress of “sharpness” may be obtained by manipulating the rotation and angle parameters.

rotation is a measure (in degrees) of rotation the arrow should have from its default position (with the point of the arrow pointing straight up).

angle is the measure (in degrees) of the lower angle formed by the two legs of the chevron. Values greater than 180 degrees will result in an inverted v-shape, with the point facing up. Values less than 180 degress will result in a v-shape, with the point facing down.

For horizontal orientation, angle refers to the right-hand angle of the arrow head; thus, values less than 180 degrees will produce a left-pointing arrow and values greater than 180 will produce a right-pointing arrow.

size is the size in points/pixels of the edges of the arrow head; stroke_width is their width in points/pixels. stroke_color is a color specification (see Specifying Colors) indicating the color of the arrow.

uarrow

toolbox.new_marker('uarrow'[, angle=90, size=5, stroke_color="#000000FF", stroke_width=1])

An Arrow class customized for pointing straight up.

larrow

toolbox.new_marker('larrow'[, angle=90, size=5, stroke_color="#000000FF", stroke_width=1])

An Arrow class customized for pointing to the left.

rarrow

toolbox.new_marker('rarrow'[, angle=90, size=5, stroke_color="#000000FF", stroke_width=1])

An Arrow class customized for pointing to the right.

circle

toolbox.new_marker('circle'[, radius=.5, stroke_color="#000000FF", fill_color="#00000000", stroke_width=1])

Draws a circle. The origin of the mark is the center of the circle.

radius is the radius of the circle in device units (points/pixels).

stroke_color is the color of the edge of the circle.

fill_color is the color of the circle’s interior.

stroke_width is the width (in points or pixels) of the edge of the circle.

cross

toolbox.new_marker('cross'[, below=5, above=5, before=5, after=5, color="#000000FF", width=1])

Draws a cross. (i.e., An equally-sized horizontal line and a vertical line crossing at their respective midpoints.) The origin of the mark is the point at which the vertical and horizontal line segments intersect.

below is the length of the vertical line segment below the origin, in points/pixels.

above is the length of the vertical line segment above the origin, in points/pixels.

before is the length of the horizontal line segment to the left of the origin, in points/pixels.

after is the length of the horizontal line segment to the right of the origin, in points/pixels.

color is a color specification (see Specifying Colors) of both the horizontal and vertical line segments.

width is the width of both the horizontal and vertical line segments in points/pixels.

dot

toolbox.new_marker('dot'[, radius=.5, color="#000000FF"])

Draws a filled circle. The origin is the center of the circle.

radius is the radius of the circle in device units (points/pixels).

color is a color specification (see Specifying Colors) of the dot.

hline

toolbox.new_marker('hline'[, before=5, after=5, color="#000000FF", width=1])

Draws a horizontal line segment. The origin of the mark is a point along the line. (The exact point depends on the values of the before and after parameters.)

before is the length of the line segment to the left of the origin, in points/pixels.

after is the length of the line segment to the right of the origin, in points/pixels.

color is a color specification (see Specifying Colors) of both line segments.

width is the width of both line segments in points/pixels.

none

toolbox.new_marker('none')

Makes no mark. This can be used as the marker argument a LabeledMarker, which can in turn be passed to something which expects a LabeledMarker, if the intent is to only draw a label.

vline

toolbox.new_marker('vline'[, below=5, above=5, color="#000000FF", width=1])

Draws a vertical line segment. The origin of the mark is a point along the line. (The exact point depends on the values of the below and above parameters.

below is the length of the line segment below the origin, in points/pixels.

above is the length of the line segment above the origin, in points/pixels.

color is a color specification (see Specifying Colors) of both line segments.

width is the width of both line segments in points/pixels.