1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
|
<a name="Module:Scientific.TkWidgets.TkPlotCanvas"><h1>Module Scientific.TkWidgets.TkPlotCanvas</h1></a>
<hr width=70%>
<a name="Class:Scientific.TkWidgets.TkPlotCanvas.PolyLine"><h2>Class PolyLine: Multiple connected lines</h2></a>
<p>Constructor: PolyLine(<i>points</i>, **|attr|)</p>
<p><dl>
<dt><i>points</i></dt>
<dd><p>
any sequence of (x, y) number pairs</p></dd>
<dt><i>attr</i></dt>
<dd><p>
line attributes specified by keyword arguments:<ul>
<li> <p>
<tt>width</tt>: the line width (default: 1)
</p><li> <p>
<tt>color</tt>: a string whose value is one of the color names defined in Tk
(default: "black")
</p><li> <p>
<tt>stipple</tt>: a string whose value is the name of a bitmap defined in Tk,
or <tt>None</tt> for no bitmap (default: <tt>None</tt>)
</p></ul>
</p></dd>
</dl>
</p>
<hr width=70%>
<a name="Class:Scientific.TkWidgets.TkPlotCanvas.PolyMarker"><h2>Class PolyMarker: Series of markers</h2></a>
<p>Constructor: PolyPoints(<i>points</i>, **|attr|)</p>
<p><dl>
<dt><i>points</i></dt>
<dd><p>
any sequence of (x, y) number pairs</p></dd>
</dl>
</p>
<p><i>attr</i> marker attributes specified by keyword arguments:<ul>
<li> <p>
<tt>width</tt>: the line width for drawing the marker (default: 1)
</p><li> <p>
<tt>color</tt>: a string whose value is one of the color names defined in Tk,
defines the color of the line forming the marker
(default: black)
</p><li> <p>
<tt>fillcolor</tt>: a string whose value is one of the color names defined
in Tk, defines the color of the interior of the marker
(default: black)
</p><li> <p>
<tt>marker</tt>: one of <tt>circle</tt> (default), <tt>dot</tt>, <tt>square</tt>, <tt>triangle</tt>,
<tt>triangle_down</tt>, <tt>cross</tt>, <tt>plus</tt>
</p></ul>
</p>
<hr width=70%>
<a name="Class:Scientific.TkWidgets.TkPlotCanvas.PlotGraphics"><h2>Class PlotGraphics: Compound graphics object</h2></a>
<p>Constructor: PlotGraphics(<i>objects</i>)</p>
<p><dl>
<dt><i>objects</i></dt>
<dd><p>
a list whose elements can be instances of the classes
PolyLine, PolyPoint, and PlotGraphics.
</p></dd>
</dl>
</p>
<hr width=70%>
<a name="Class:Scientific.TkWidgets.TkPlotCanvas.PlotCanvas"><h2>Class PlotCanvas: Tk plot widget</h2></a>
<p>Constructor: PlotCanvas(<i>master</i>, <i>width</i>, <i>height</i>, **|attributes|).</p>
<p>The arguments have the same meaning as for a standard Tk canvas.
The default background color is white and the default font is
Helvetica at 10 points.</p>
<p>PlotCanvas objects support all operations of Tk widgets.</p>
<p>There are two attributes in addition to the standard Tk attributes:</p>
<p><dl>
<dt><i>zoom</i></dt>
<dd><p>
a logical variable that indicates whether interactive
zooming (using the left mouse button) is enabled; the
default is 0 (no zoom)</p></dd>
<dt><i>select</i></dt>
<dd><p>
enables the user to select a range along the x axis
by dragging the mouse (with the left button pressed)
in the area <i>under</i> the x axis. If <i>select</i> is 0,
no selection is possible. Otherwise the value of <i>select</i>
must be a callable object that is called whenever the
selection changes, with a single argument that can be
None (no selection) or a tuple containing two
x values.
</p></dd>
</dl>
</p>
<b>Methods:</b><br>
<ul>
<li> <b><i>draw</i></b>(<i>graphics</i>, <i>xaxis</i>=<tt>None</tt>, <i>yaxis</i>=<tt>None</tt>)
<p>Draws the graphics object <i>graphics</i>, which can be
a PolyLine, PolyMarker, or PlotGraphics object. The
arguments <i>xaxis</i> and <i>yaxis</i> specify how axes are
drawn: <tt>None</tt> means that no axis is drawn and the graphics
objects are scaled to fill the canvas optimally. <tt>"automatic"</tt>
means that the axis is drawn and a suitable value range is
determined automatically. A sequence of two numbers means
that the axis is drawn and the value range is the interval
specified by the two numbers.
</p>
<li> <b><i>clear</i></b>()
<p>Clears the canvas.</p>
<li> <b><i>redraw</i></b>()
<p>Redraws the last canvas contents.</p>
<li> <b><i>select</i></b>(<i>range</i>)
<p>Shows the given <i>range</i> as highlighted. <i>range</i> can be
None (no selection) or a sequence of two values on the
x-axis.</p>
</ul>
|