Next / Previous / Contents / TCC Help System / NM Tech homepage

6.6. The canvas line object

In general, a line can consist of any number of segments connected end to end, and each segment can be straight or curved. To create a canvas line object on a canvas C, use:

    id = C.create_line ( x0, y0, x1, y1, ..., xn, yn, option, ... )

The line goes through the series of points (x0, y0), (x1, y1), … (xn, yn). Options include:

arrowThe default is for the line to have no arrowheads. Use arrow=FIRST to get an arrowhead at the (x0, y0) end of the line. Use arrow=LAST to get an arrowhead at the far end. Use arrow=BOTH for arrowheads at both ends.
arrowshapeA tuple (d1, d2, d3) that describes the shape of the arrowheads added by the arrow option. Default is (8,10,3).

fillThe color to use in drawing the line. Default is fill="black".
smoothIf true, the line is drawn as a series of parabolic splines fitting the point set. Default is false, which renders the line as a set of straight segments.
splinestepsIf the smooth option is true, each spline is rendered as a number of straight line segments. The splinesteps option specifies the number of segments used to approximate each section of the line; the default is splinesteps=12.
stippleTo draw a stippled line, set this option to a bitmap that specifies the stippling pattern, such as stipple="gray25". See Section 4.7, “Bitmaps” for the possible values.
tagsThe tags to be associated with the object, as a sequence of strings. See Section 6.1.4, “Canvas tags”.
widthThe line's width. Default is 1 pixel. See Section 4.1, “Dimensions” for possible values.