A complete reference to the Pmw.Blt plot widget



Table of Contents


1. Purpose

This reference to Pmw.Blt is basically a direct translation of the BLT Graph reference for Tcl programmers (included in the BLT package). To help navigation, the reference manual is divided into logical parts, though all the methods described are members the same Python class (the Pmw.Blt.Graph class).


Note: During the development of this Pmw.Blt manual, several differences between the original Tcl documentation and the Pmw.Blt package were discovered. As both the BLT and the Pmw.Blt package are under continuous development, this is not surprising. The core part of the testing of Pmw.Blt version 0.8.3 was done under Windows 98 using BLT version 2.4m. The differences between Windows 98 and Unix that we have encountered are reported for convenience (such differences may be due to different BLT versions on these two operating systems as well as different implementations of the underlying packages on different platforms).


2. The Graph part

A graph is composed of several components: coordinate axes, data elements, legend, grid, cross hairs, postscript, and annotation markers. Instead of one big set of configuration options and methods, the graph is partitioned, where each component has its own configuration options and methods that specifically control that aspect or part of the graph.

This part does however consider the more general methods that does not fit inside any of the above mentioned parts.

2.1. bar_create(...)

Synopsis

def bar_create(self, name, **kw):

Description

Creates a new bar-chart element named name. It is an error if an element named name already exists. See the Tk-manual for barchart for details about what option and value pairs are valid, or see the Hello Graph example.

See also

line_create(...), HelloGraph.py

2.2. line_create(...)

Synopsis

def line_create(self, name, **kw):

Description

Creates a new element named name. It is an error if an element named name already exists. If additional arguments are present, they specify options valid for the element_configure(...) method.

See also

element_configure(...), bar_create(...), HelloWorld.py

2.3. configure(...)

Synopsis

def configure(self, option = None, **kw):

Description

Queries or modifies the configuration options of the graph. If option=None, a tuple describing the current options for the graph is returned. If option is specified, then a tuple describing option is returned. If one or more option and value pairs are specified, then for each pair, the option is set to value. The following options are valid:

See also

element_configure(...), HelloGraph.py

2.4. extents(...)

Synopsis

def extents(self, item):

Description

Returns the size of a particular item in the graph. Item must be either "leftmargin", "rightmargin", "topmargin", "bottommargin", "plotwidth", or "plotheight". Be aware that this method does not function properly before the mainloop(...) method is entered because the widget is not yet drawn.

See also

HelloGraph.py

2.5. invtransform(...)

Synopsis

def invtransform(self, winX, winY):

Description

Performs an inverse coordinate transformation, mapping window coordinates back to graph coordinates, using the standard X-axis and Y-axis. Returns a tuple containing the X-Y graph coordinates.

Be aware that this method does not function properly before the mainloop(...) method is entered because the widget is not yet drawn.

See also

transform(...), HelloMagnifier.py

2.6. transform(...)

Synopsis

def transform(self, x, y)

Description

Performs a coordinate transformation, mapping graph coordinates to window coordinates, using the standard X-axis and Y-axis. Returns a tuple containing the X-Y screen coordinates.

Be aware that this method does not function properly before the mainloop(...) method is entered because the widget is not yet drawn.

See also

invtransform(...), HelloGraph.py

2.7. inside(...)

Synopsis

def inside(self, x, y)

Description

Returns 1 if the designated screen coordinate (x and y) is inside the plotting area and 0 otherwise.

Be aware that this method does not function properly before the mainloop(...) method is entered because the widget is not yet drawn.

See also

HelloGraph.py

2.8. snap(...)

Synopsis

def snap(self, photoName)

Description

Takes a snapshot of the graph and stores the contents in the photo image photoName. PhotoName must be an instance of the Tkinter.PhotoImage() class or the object's name.

See also

HelloGraph.py


3. Elements

A data element represents a set of data. It contains x and y vectors containing the coordinates of the data points. Elements can be displayed with a symbol at each data point and lines connecting the points. Elements also control the appearance of the data, such as the symbol type, line width, color etc.

When new data elements are created, they are automatically added to a list of displayed elements. The display list controls what elements are drawn and in what order.

The following methods are available for elements:

3.1. element_activate(...)

Synopsis

def element_activate(self, name, *args)

Description

Specifies the data points of element name to be drawn using active foreground and background colors. Name is the name of the element and args is a tuple of numbers representing the indexes of the data points. If no indices are present then all data points become active.

See also

element_deactivate(...), HelloElements.py

3.2. element_bind(...)

Synopsis

def element_bind(self, tagName, sequence = None, func = None, add = None)

Description

Associates function func with tagName such that whenever the event sequence given by sequence occurs for an element with this tag, func will be invoked. The syntax is similar to the bind command except that it operates on graph elements, rather than widgets. See the bind manual entry for complete details on sequence and the substitutions performed on func before invoking it.

If all arguments are specified, then a new binding is created, replacing any existing binding for the same sequence and tagName. If add=1 then command augments an existing binding rather than replacing it. If no func argument is provided then the function currently associated with tagName and sequence (an error occurs if there's no such binding) is returned. If both func and sequence are missing then a tuple of all the event sequences for which bindings have been defined for tagName are returned.

See also

element_unbind(...), HelloWaves.py

3.3. element_unbind(...)

Synopsis

def element_unbind(self, tagName, sequence, funcid = None)

Description

Unbinds functions previously bound to the tag tagName and event given by sequence.

See also

element_bind(...), HelloWaves.py

3.4. element_cget(...)

Synopsis

def element_cget(self, name, key)

Description

Returns the current value of the element configuration option given by key for element name. Key may be any of the options described below for the element_configure(...) method.

See also

element_configure(...), HelloElements.py

3.5. element_closest(...)

Synopsis

def element_closest(self, x, y, *args, **kw)

Description

Finds the data point closest to the window coordinates x and y among the elements specified by args. All elements in args must be visible. If no elements are specified, then all visible elements are searched. It returns the name of the closest element, the index of its closest point, and the graph coordinates of the point in a dictionary with the following keys: 'dist', 'x', 'y', 'index', 'name'. If no data point within the threshold distance can be found, None is returned. The following option-value pairs are legal.

See also

HelloWaves.py

3.6. element_configure(...)

Synopsis

def element_configure(self, names, option = None, **kw)

Description

Queries or modifies the configuration options for elements. Several elements can be modified at the same time. If option=None, a tuple describing all the current options for names is returned. If option is specified, then a tuple describing the option option is returned. If one or more option and value pairs are specified, then for each pair, the element option is set to value. The following options are valid for elements:

See also

line_create(...), HelloBLT.py, HelloUser.py

3.7. element_deactivate(...)

Synopsis

def element_deactivate(self, *args)

Description

Deactivates all the elements matching patterns specified in args. Elements whose names match any of the patterns given are redrawn using their normal colors.

See also

element_activate(...), HelloElements.py

3.8. element_delete(...)

Synopsis

def element_delete(self, *args)

Description

Deletes all the named elements. The graph is automatically redrawn.

See also

line_create(...), HelloElements.py

3.9. element_exists(...)

Synopsis

def element_exists(self, name)

Description

Returns 1 if an element named name currently exists and 0 otherwise.

See also

element_names(...), HelloElements.py

3.10. element_names(...)

Synopsis

def element_names(self, *args)

Description

Returns the names of all elements matching one or more pattern. If no pattern is given, the names of all elements are returned.

See also

element_exists(...), HelloElements.py

3.11. element_show(...)

Synopsis

def element_show(self, nameList=None)

Description

Queries or modifies the element display list. The element display list designates the elements drawn and in what order. NameList is a tuple of elements to be displayed in the order they are named. If there is no nameList argument, the current display list is returned.

See also

HelloElements.py

3.12. element_type(...)

Synopsis

def element_type(self, name)

Description

Returns the type of element named name. If the element is a bar element, the method returns the string "bar", otherwise it returns "line".

See also

element_names(...), element_exists(...), HelloElements.py


4. Axes

Four coordinate axes are automatically created: two X-coordinate axes (x and x2 ) and two Y-coordinate axes (y and y2 ). By default, the axis x is located in the bottom margin, y in the left margin, x2 in the top margin, and y2 in the right margin.

An axis consists of the axis line, title, major and minor ticks, and tick labels. Major ticks are drawn at uniform intervals along the axis. Each tick is labeled with its coordinate value. Minor ticks are drawn at uniform intervals within major ticks.

The range of the axis controls what region of data is plotted. Data points outside the minimum and maximum limits of the axis are not plotted. By default, the minimum and maximum limits are determined from the data, but you can reset either limit.

You can create and use several axes. To create an axis, invoke the axis_create(...) method.

4.1. axis_cget(...)

Synopsis

def axis_cget(self, axisName, key):

Description

Returns the current value of the option given by key for axisName. Key may be any option described below for the axis_configure(...) method.


Note: To operate on a standard axis you may alternatively use:

def xaxis_cget(self, key)
def yaxis_cget(self, key)
def x2axis_cget(self, key)
def y2axis_cget(self, key)

See also

axis_configure(...), HelloAxes.py

4.2. axis_configure(...)

Synopsis

def axis_configure(self, axes, option = None, **kw):

Description

Queries or modifies the configuration options of axisName. Several axes can be changed. If option=None, a tuple describing all the current options for axisName is returned. If option is specified, the value of the specified option is returned. If one or more option and value pairs are specified, then for each pair, the axis option option is set to value. The following options are valid for axes:


Note: To operate on a standard axis you may also use:

def xaxis_configure(self, option = None, **kw)
def yaxis_configure(self, option = None, **kw)
def x2axis_configure(self, option = None, **kw)
def y2axis_configure(self, option = None, **kw)

See also

axis_cget(...), HelloAxes.py

4.3. axis_create(...)

Synopsis

def axis_create(self, axisName, **kw)

Description

Creates a new axis by the name axisName. No axis with the same name can already exist. If additional arguments are present, they specify options valid for the axis_configure(...) method.

See also

axis_configure(...), HelloAxes.py

4.4. axis_delete(...)

Synopsis

def axis_delete(self, *args)

Description

Deletes the named axes (stored in args). An axis is not really deleted until it is not longer in use, so it's safe to delete axes mapped to elements.

See also

axis_create(...), HelloAxes.py

4.5. axis_invtransform(...)

Synopsis

def axis_invtransform(self, axisName, value)

Description

Performs the inverse transformation, changing the screen coordinate value to a graph coordinate, mapping the value mapped to axisName. Returns the graph coordinate.

Be aware that this method does not function properly before the mainloop(...) method is entered because the widget is not yet drawn.


Note: To operate on a standard axis you may also use:

def xaxis_invtransform(self, value)
def yaxis_invtransform(self, value)
def x2axis_invtransform(self, value)
def y2axis_invtransform(self, value)

See also

axis_transform(...), invtransform(...), HelloAxes.py

4.6. axis_limits(...)

Synopsis

def axis_limits(self, axisName)

Description

Returns a tuple of the minimum and maximum limits for axisName. The order of the tuple is (min, max).


Note: To operate on a standard axis, you may also use:

def xaxis_limits(self)
def yaxis_limits(self)
def x2axis_limits(self)
def y2axis_limits(self)

See also

axis_configure(...), HelloAxes.py

4.7. axis_names(...)

Synopsis

def axis_names(self, *args)

Description

Returns a tuple of axes matching zero or more patterns (stored in args). If no pattern argument is given, the names of all axes are returned.

See also

axis_configure(...), HelloAxes.py

4.8. axis_transform(...)

Synopsis

def axis_transform(self, axisName, value)

Description

Transforms the coordinate value to a screen coordinate by mapping it to axisName. Returns the transformed screen coordinate.

Be aware that this method does not function properly before the mainloop(...) method is entered because the widget is not yet drawn.


Note: To operate on a standard axis you may also use:

def xaxis_transform(self, value)
def yaxis_transform(self, value)
def x2axis_transform(self, value)
def y2axis_transform(self, value)

See also

axis_invtransform(...), transform(...), HelloAxes.py

4.9. xaxis_use(...)

Synopsis

def xaxis_use(self, axisName = None)

Description

Designates the axis axisName to be displayed as the xaxis. AxisName is not allowed to be in use at two locations at the same time. This method returns the name of the axis currently using this location.

See also

axis_create(...), yaxis_use(...), HelloAxes.py

4.10. yaxis_use(...)

Synopsis

def yaxis_use(self, axisName = None)

Description

Designates the axis axisName to be displayed as the yaxis. AxisName is not allowed to be in use at two locations at the same time. This method returns the name of the axis currently using this location.

See also

axis_create(...), xaxis_use(...), HelloAxes.py

4.11. x2axis_use(...)

Synopsis

def x2axis_use(self, axisName = None)

Description

Designates the axis axisName to be displayed as the second x-axis. AxisName is not allowed to be in use at two locations at the same time. This method returns the name of the axis currently using this location.

See also

axis_create(...), xaxis_use(...), HelloAxes.py

4.12. y2axis_use(...)

Synopsis

def y2axis_use(self, axisName = None)

Description

Designates the axis axisName to be displayed as the second y-axis. AxisName is not allowed to be in use at two locations at the same time. This method returns the name of the axis currently using this location.

See also

axis_create(...), yaxis_use(...), HelloAxes.py


5. Grids

Grid lines extend from the major and minor ticks of each axis horizontally or vertically across the plotting area. The following methods are available for grid lines.

5.1. grid_cget(...)

Synopsis

def grid_cget(self, key)

Description

Returns the current value of the grid line configuration option given by key. Key may be any option described below for the grid_configure(...) method.

See also

grid_configure(...), HelloUser.py, HelloGrid.py

5.2. grid_configure(...)

Synopsis

def grid_configure(self, option = None, **kw)

Description

Queries or modifies the configuration options for grid lines. If option=None, a tuple describing all the current grid options for pathName is returned. If option is specified, a tuple describing option is returned. If one or more option and value pairs are specified, then for each pair, the grid line option option is set to value. The following options are valid for grid lines:

See also

grid_cget(...), grid_on(...), HelloUser.py

5.3. grid_off(...)

Synopsis

def grid_off(self)

Description

Turns off the grid lines.

See also

grid_configure(...), HelloUser.py, HelloGrid.py

5.4. grid_on(...)

Synopsis

def grid_on(self)

Description

Turns on the grid lines.

See also

grid_configure(...), HelloUser.py, HelloGrid.py

5.5. grid_toggle(...)

Synopsis

def grid_toggle(self)

Description

Toggles the display of the grid.

See also

grid_configure(...), HelloUser.py, HelloGrid.py


6. Legends

The legend displays a list of the data elements. Each entry consists of the element's symbol and label. The legend can appear in any margin (the default location is in the right margin). It can also be positioned anywhere within the plotting area.

The following methods are valid for the legend.

6.1. legend_activate(...)

Synopsis

def legend_activate(self, *args)

Description

Selects legend entries to be drawn using the active legend colors and relief. All entries whose element names match a pattern specified in args are selected. To be selected, the element name must match at least one pattern.

See also

legend_deactivate(...), HelloLegends.py

6.2. legend_bind(...)

Synopsis

def legend_bind(self, tagName, sequence = None, func = None, add = None)

Description

Associates func with tagName such that whenever the event sequence given by sequence occurs for a legend entry with this tag, func will be invoked. Implicitly the element names in the entry are tags. The syntax is similar to the bind command except that it operates on legend entries, rather than widgets. See the bind manual entry for complete details on sequence and the substitutions performed on command before invoking it.

If all arguments are specified then a new binding is created, replacing any existing binding for the same sequence and tagName. If add=1 then func augments an existing binding rather than replacing it. If no func argument is provided then the command currently associated with tagName and sequence (an error occurs if there's no such binding) is returned. If both command and sequence are missing then a tuple of all the event sequences for which bindings have been defined for tagName are returned.

See also

legend_unbind(...), HelloLegends.py

6.3. legend_unbind(...)

Synopsis

def legend_unbind(self, tagName, sequence, funcid = None)

Description

Unbinds functions previously bound to the tag named tagName and event given by sequence.

See also

legend_bind(...), HelloLegends.py

6.4. legend_cget(...)

Synopsis

def legend_cget(self, key)

Description

Returns the current value of a legend configuration option. Key may be any option described below in the legend_configure(...) method.

See also

legend_configure(...), HelloUser.py

6.5. legend_configure(...)

Synopsis

def legend_configure(self, option = None, **kw)

Description

Queries or modifies the configuration options for the legend. If option=None, a tuple describing the current legend options for the graph is returned. If option is specified, then a tuple describing option is returned. If one or more option and value pairs are specified, then for each pair, the legend option option is set to value. The following options are valid for the legend:

See also

legend_cget(...), HelloUser.py, HelloLegends.py

6.6. legend_deactivate(...)

Synopsis

def legend_deactivate(self, *args)

Description

Selects legend entries to be drawn using the normal legend colors and relief. All entries whose element names match a pattern in args are selected. To be selected, the element name must match at least one pattern.

See also

legend_activate(...), HelloLegends.py

6.7. legend_get(...)

Synopsis

def legend_get(self, pos)

Description

Returns the name of the element whose entry is at the screen position pos in the legend. Pos must be in the form "@x,y", where x and y are window coordinates. If the given coordinates do not lie over a legend entry, "" is returned.

See also

legend_bind(...), HelloLegends.py


7. Crosshairs

Cross hairs consist of two intersecting lines (one vertical and one horizontal) drawn completely across the plotting area. They are normally used to position the mouse in relation to the coordinate axes. Cross hairs differ from line markers in that they are implemented using XOR drawing primitives. This means that they can be quickly drawn and erased without redrawing the entire graph.

The following methods are available for cross hairs:

7.1. crosshairs_cget(...)

Synopsis

def crosshairs_cget(self, key)

Description

Returns the current value of the cross hairs configuration option given by option. Key may be any option described below for the crosshairs_configure(...) method.

See also

crosshairs_configure(...), HelloCrosshairs.py

7.2. crosshairs_configure(...)

Synopsis

def crosshairs_configure(self, option = None, **kw)

Description

Queries or modifies the configuration options of the cross hairs. If option=Null, a tuple describing all the current options for the cross hairs is returned. If option is specified, the value of the specified option is returned. If one or more option and value pairs are specified, then for each pair, the cross hairs option option is set to value. The following options are available for cross hairs.

See also

HelloUser.py, HelloCrosshairs.py

7.3. crosshairs_off(...)

Synopsis

def crosshairs_off(self)

Description

Turns off the cross hairs.

See also

crosshairs_on(...), crosshairs_toggle(...), HelloCrosshairs.py

7.4. crosshairs_on(...)

Synopsis

def crosshairs_on(self)

Description

Makes the cross hairs visible.

See also

crosshairs_off(...), crosshairs_toggle(...), HelloCrosshairs.py

7.5. crosshairs_toggle(...)

Synopsis

def crosshairs_toggle(self)

Description

Toggles the current state of the cross hairs, alternately mapping and unmapping the cross hairs.

See also

crosshairs_on(...), crosshairs_toggle(...), HelloCrosshairs.py


8. Pens

Pens define attributes (both symbol and line style) for elements. Pens mirror the configuration options of data elements that pertain to how symbols and lines are drawn. Data elements use pens to determine how they are drawn. A data element may use several pens at once. In this case, the pen used for a particular data point is determined from each element's weight vector (see the element's weight and style options).

One pen, called activeLine, is automatically created. It's used as the default active pen for elements. So you can change the active attributes for all elements by simply reconfiguring this pen.

8.1. pen_cget(...)

Synopsis

def pen_cget(self, name, key)

Description

Returns the current value of the option given by key for the pen named name. Option may be any option described below for the pen_configure(...) method.

See also

pen_configure(...), HelloPens.py

8.2. pen_configure(...)

Synopsis

def pen_configure(self, names, option = None, **kw)

Description

Queries or modifies the configuration options of pens listed in names. Several pens can be modified at once. If option=None, a tuple describing the current options for names is returned. If option is specified, a tuple describing option is returned. If one or more option and value pairs are specified, then for each pair, the pen option is set to value. The following options are valid for pens.

See also

pen_cget(...), HelloPens.py

8.3. pen_create(...)

Synopsis

def pen_create(self, name, **kw)

Description

Creates a new pen named name. You can not have two pens with the same name. If additional arguments are present, they specify options valid for the pen_configure(...) method.

See also

pen_configure(...), pen_delete(...), HelloWeights.py

8.4. pen_delete(...)

Synopsis

def pen_delete(self, *args)

Description

Deletes the named pens listed in args. A pen is not really deleted until it is not longer in use, so it's safe to delete pens mapped to elements.

See also

pen_create(...), HelloPens.py

8.5. pen_names(...)

Synopsis

def pen_names(self, *args)

Description

Returns a tuple of pens matching zero or more patterns listed in args. If no pattern argument is given, the names of all pens are returned.

See also

pen_configure(...), HelloPens.py


9. Postscript

The graph can generate encapsulated PostScript output. There are several configuration options you can specify to control how the plot will be generated. You can change the page dimensions and borders. The plot itself can be scaled, centered, or rotated to landscape. The PostScript output can be written directly to a file or returned through the interpreter.

The following postscript methods are available:

9.1. postscript_cget(...)

Synopsis

def postscript_cget(self, key)

Description

Returns the current value of the postscript option given by key. Key may be any option described below for the postscript_configure(...) method.

See also

postscript_configure(...), HelloPostscript.py

9.2. postscript_configure(...)

Synopsis

def postscript_configure(self, option = None, **kw)

Description

Queries or modifies the configuration options for PostScript generation. If option = None, a tuple describing the current postscript options for the graph is returned. If option is specified, then a tuple describing option is returned. If one or more option and value pairs are specified, then for each pair, the postscript option option is set to value. The following postscript options are available:

See also

postscript_cget(...), HelloPostscript.py

9.3. postscript_output(...)

Synopsis

def postscript_output(self, fileName=None, **kw)

Description

Outputs a file of encapsulated PostScript. If a fileName argument isn't present, the method returns the PostScript. If any option-value pairs are present, they set configuration options controlling how the PostScript is generated. Option and value can be anything accepted by the postscript_configure(...) method above.

See also

HelloPostscript.py, HelloUser.py


10. Markers

Markers are simple drawing procedures used to annotate or highlight areas of the graph. Markers have various types: text strings, bitmaps, images, connected lines, windows, or polygons. They can be associated with a particular element, so that when the element is hidden or un-hidden, so is the marker. By default, markers are the last items drawn, so that data elements will appear in behind them. You can change this by configuring the under option.

Markers, in contrast to elements, don't affect the scaling of the coordinate axes. They can also have elastic coordinates (specified by "-Inf" and "Inf" respectively) that translate into the minimum or maximum limit of the axis. For example, you can place a marker so it always remains in the lower left corner of the plotting area, by using the coordinates ("-Inf", "-Inf").

The following methods are available for markers:

10.1. marker_after(...)

Synopsis

def marker_after(self, first, second = None)

Description

Changes the order of the markers, drawing the first marker after the second. If no argument second is specified, the marker is placed at the end of the display list. This method can be used to control how markers are displayed since markers are drawn in the order of this display list.

See also

marker_before(...), HelloMarkers.py

10.2. marker_before(...)

Synopsis

def marker_before(self, first, second = None)

Description

Changes the order of the markers, drawing the first marker before the second. If no argument second is specified, the marker is placed at the beginning of the display list. This method can be used to control how markers are displayed since markers are drawn in the order of this display list.

See also

marker_after(...), HelloMarkers.py

10.3. marker_bind(...)

Synopsis

def marker_bind(self, tagName, sequence = None, func = None, add = None)

Description

Associates func with tagName such that whenever the event sequence given by sequence occurs for a marker with this tag, func will be invoked. The syntax is similar to the bind command except that it operates on graph markers, rather than widgets. See the bind manual entry for complete details on sequence and the substitutions performed on func before invoking it.

If all arguments are specified, then a new binding is created, replacing any existing binding for the same sequence and tagName. If add = 1, func augments an existing binding rather than replacing it. If no command argument is provided then the command currently associated with tagName and sequence (an error occurs if there's no such binding) is returned. If both func and sequence are missing, a tuple of all the event sequences for which bindings have been defined for tagName is returned.

See also

marker_unbind(...), HelloMarkers.py

10.4. marker_unbind(...)

Synopsis

def marker_unbind(self, tagName, sequence, funcid = None)

Description

Unbinds functions previously bound to the tag named tagName and event given by sequence.

See also

marker_bind(...), HelloMarkers.py

10.5. marker_cget(...)

Synopsis

def marker_cget(self, name, key)

Description

Returns the current value of the marker configuration option given by key. Key may be any option described below in the marker_configure(...) method.

See also

marker_configure(...), HelloMarkers.py

10.6. marker_configure(...)

Synopsis

def marker_configure(self, names, option = None, **kw)

Description

Queries or modifies the configuration options for markers. If option = None, a tuple describing the current options for markers listed in names is returned. If option is specified, then a tuple describing option is returned. If one or more option and value pairs are specified, then for each pair, the marker option option is set to value.

The following options are valid for all markers. Each type of marker also has its own type-specific options. They are described in the sections below.

A bitmap marker displays a bitmap. The size of the bitmap is controlled by the number of coordinates specified. If two coordinates, they specify the position of the top-left corner of the bitmap. The bitmap retains its normal width and height. If four coordinates, the first and second pairs of coordinates represent the corners of the bitmap. The bitmap will be stretched or reduced as necessary to fit into the bounding rectangle.

The following options are specific to bitmap markers:

An image marker displays an image. The following options are specific to image markers:

A line marker displays one or more connected line segments. The following options are specific to line markers:

A polygon marker displays a closed region described as two or more connected line segments. It is assumed the first and last points are connected. The following options are supported for polygon markers:

A text marker displays a string of characters on one or more lines of text. Embedded newlines cause line breaks. They may be used to annotate regions of the graph. The following options are specific to text markers:

A window marker displays a widget at a given position. The following options are specific to window markers:

See also

marker_cget(...), HelloMagnifier.py, HelloMarkers.py

10.7. marker_create(...)

Synopsis

def marker_create(self, type, **kw)

Description

Creates a marker of the selected type. Type may be either "text", "line", "bitmap", "image", "polygon", or "window". This method returns the marker identifier, used as the name argument in the other marker-related methods. If the name option is used, this overrides the normal marker identifier. If the name provided is already used for another marker, the new marker will replace the old.

If additional arguments are present, they specify options valid for the marker_configure(...) method.

See also

marker_configure(...), HelloMagnifier.py, HelloMarkers.py

10.8. marker_delete(...)

Synopsis

def marker_delete(self, *args)

Description

Removes one of more markers listed in args. The graph will automatically be redrawn without the marker.

See also

marker_create(...), HelloMagnifier.py, HelloMarkers.py

10.9. marker_exists(...)

Synopsis

def marker_exists(self, name)

Description

Returns 1 if the marker name exists and 0 otherwise.

See also

marker_names(...), HelloMarkers.py

10.10. marker_names(...)

Synopsis

def marker_names(self, *args)

Description

Returns the names of all the markers that currently exist. If a tuple of patterns is supplied in args, only those markers whose names match it will be returned.

See also

marker_exists(...), HelloMarkers.py

10.11. marker_type(...)

Synopsis

def marker_type(self, name)

Description

Returns the type of the marker given by name, such as line or text. If name is not a valid marker identifier, "" is returned.

See also

marker_create(...), HelloMarkers.py