/usr/share/doc/python-pychart-doc/pychart/module-line-plot.html is in python-pychart-doc 1.39-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head><style type="text/css">
pre {background-color: #e0e0e0}
</style>
<link rel="STYLESHEET" href="pychart.css" type='text/css' />
<link rel="first" href="pychart.html" title='PyChart' />
<link rel='index' href='genindex.html' title='Index' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="module-range-plot.html" />
<link rel="prev" href="module-interval-bar-plot.html" />
<link rel="parent" href="pychart.html" />
<link rel="next" href="module-tick-mark.html" />
<meta name='aesop' content='information' />
<title>9 Line and scatter plots</title>
</head>
<body>
<DIV CLASS="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="8 Interval bar plots"
href="module-interval-bar-plot.html"><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></A></td>
<td class='online-navigation'><a rel="parent" title="PyChart"
href="pychart.html"><img src='up.png'
border='0' height='32' alt='Up One Level' width='32' /></A></td>
<td class='online-navigation'><a rel="next" title="9.1 Tick marks"
href="module-tick-mark.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></A></td>
<td align="center" width="100%">PyChart</td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><a rel="index" title="Index"
href="genindex.html"><img src='index.png'
border='0' height='32' alt='Index' width='32' /></A></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-interval-bar-plot.html">8 Interval bar plots</A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="pychart.html">PyChart</A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="module-tick-mark.html">9.1 Tick marks</A>
</div>
<hr /></div>
</DIV>
<!--End of Navigation Panel-->
<H1><A NAME="SECTION000900000000000000000"></A><a id='l2h-141' xml:id='l2h-141'></a>
<BR>
9 Line and scatter plots
</H1>
<A NAME="module-line-plot"></A>
<P>
<dl><dt><b><span class="typelabel">class</span> <tt id='l2h-143' xml:id='l2h-143' class="class">line_plot.T</tt></b>
<dd>
This class raws a line plot. By specifying None to its line style,
you can also draw a scatter plot.
<P>
<IMG
WIDTH="798" HEIGHT="397" ALIGN="BOTTOM" BORDER="0"
SRC="./linetest3.png"
ALT="Image linetest3">
<P>
<b> Sample line plot </b>
<P>
Below is the source code that produces the above chart.
../demos/linetest3.py
<P>
<div class="verbatim"><pre>
from pychart import *
<a href="options.html"><a href="options.html">theme.</a>get_options</a>()
data = <a href="module-chart-data.html">chart_data.</a>read_csv("lines.csv")
xaxis=<a href="module-axis.html">axis.</a>X(label="X", tic_interval=10)
yaxis=<a href="module-axis.html">axis.</a>Y(label="Y", tic_interval=10)
ar = <a href="module-area.html">area.T</a>(x_range=(0,100), y_range=(0,100), x_axis=xaxis, y_axis=yaxis)
eb = <a href="module-error-bar.html">error_bar.</a>error_bar2(tic_len=5, hline_style=<a href="module-line-style.html">line_style.</a>gray50)
ar.add_plot(<a href="module-line-plot.html">line_plot.T</a>(label="foo", data=data, error_bar=eb, y_error_minus_col=3),
<a href="module-line-plot.html">line_plot.T</a>(label="bar", data=data, ycol=2, error_bar=eb, y_error_minus_col=3))
ar.draw()
tb = <a href="module-text-box.html">text_box.T</a>(loc=(40, 130), text="This is\nimportant!", line_style=None)
tb.add_arrow((ar.x_pos(data[6][0]), ar.y_pos(data[6][1])), "cb")
tb.draw()
ar = <a href="module-area.html">area.T</a>(loc=(200, 0), x_range=(0,100), y_range=(0,100),
x_axis=xaxis, y_axis=yaxis, legend=<a href="module-legend.html">legend.</a>T())
ar.add_plot(<a href="module-line-plot.html">line_plot.T</a>(label="foo", data=data, data_label_format="/8{}%d"),
<a href="module-line-plot.html">line_plot.T</a>(label="bar", data=data, ycol=2))
ar.draw()
</pre></div>
<IMG
WIDTH="858" HEIGHT="337" ALIGN="BOTTOM" BORDER="0"
SRC="./scattertest.png"
ALT="Image scattertest">
<P>
<b> Sample scatter plot </b>
<P>
Below is the source code that produces the above chart.
../demos/scattertest.py
<P>
<div class="verbatim"><pre>
from pychart import *
import random
random.seed(0)
def randomdata():
data = []
for i in range(0, 30):
data.append((random.random() * 1000, random.random() * 1000))
return data
<a href="options.html"><a href="options.html">theme.</a>get_options</a>()
chart_object.set_defaults(<a href="module-line-plot.html">line_plot.T</a>, line_style=None)
tick1 = <a href="module-tick-mark.html">tick_mark.</a>Circle(size=2)
tick2 = <a href="module-tick-mark.html">tick_mark.</a>Circle(size=2, fill_style=<a href="module-fill-style.html">fill_style.</a>black)
xaxis = <a href="module-axis.html">axis.</a>X(label="foo", format="/a-60{}%d")
yaxis = <a href="module-axis.html">axis.</a>Y(label="bar")
ar = <a href="module-area.html">area.T</a>(x_axis=xaxis, y_axis=yaxis,
x_grid_interval=100, x_grid_style=<a href="module-line-style.html">line_style.</a>gray70_dash3,
legend = <a href="module-legend.html">legend.</a>T(loc=(350, 50)), loc = (0, 0))
ar.add_plot(<a href="module-line-plot.html">line_plot.T</a>(label="plot1", data=randomdata(), tick_mark=tick1))
ar.add_plot(<a href="module-line-plot.html">line_plot.T</a>(label="plot2", data=randomdata(), tick_mark=tick2))
ar.draw()
xaxis = <a href="module-axis.html">axis.</a>X(label="foo", format="/a-30{}%d")
yaxis = <a href="module-axis.html">axis.</a>Y(label="bar")
ar = <a href="module-area.html">area.T</a>(x_axis=xaxis, y_axis=yaxis,
x_coord=<a href="module-coord.html">log_coord.T</a>(), y_coord=<a href="module-coord.html">log_coord.T</a>(), loc = (200, 0),
legend = None)
ar.add_plot(<a href="module-line-plot.html">line_plot.T</a>(label="plot1", data=randomdata(), tick_mark=tick1))
ar.add_plot(<a href="module-line-plot.html">line_plot.T</a>(label="plot2", data=randomdata(), tick_mark=tick2))
ar.draw()
</pre></div>
<P>
</dl>
<P>
<dl><dt><b><tt id='l2h-144' xml:id='l2h-144' class="member">data</tt></b></dt>
<dd>
<b>Type:</b> any
<b>Default:</b> None.
<P>
Specifies the data points. See Section <A href="module-chart-data.html#module-chart-data">5</A>
</dl>
<dl><dt><b><tt id='l2h-145' xml:id='l2h-145' class="member">data_label_format</tt></b></dt>
<dd>
<b>Type:</b> printf format string
<b>Default:</b> None.
<P>
The format string for the label printed
beside a sample point.
It can be a `printf' style format string, or
a two-parameter function that takes the (x, y)
values and returns a string. The appearance of the string produced here can be
controlled using escape sequences. See Section <A href="module-font.html#module-font">17</A>
</dl>
<dl><dt><b><tt id='l2h-146' xml:id='l2h-146' class="member">data_label_offset</tt></b></dt>
<dd>
<b>Type:</b> (x,y) or None
<b>Default:</b> (0, 5).
<P>
The location of data labels relative to the sample point. Meaningful only when data_label_format != None.
</dl>
<dl><dt><b><tt id='l2h-147' xml:id='l2h-147' class="member">error_bar</tt></b></dt>
<dd>
<b>Type:</b> error_bar.T
( see Section <A href="module-error-bar.html#module-error-bar">9.2</A>)
<b>Default:</b> None.
<P>
The style of the error bar. See Section <A href="module-error-bar.html#module-error-bar">9.2</A>
</dl>
<dl><dt><b><tt id='l2h-148' xml:id='l2h-148' class="member">label</tt></b></dt>
<dd>
<b>Type:</b> str
<b>Default:</b> "???".
<P>
The label to be displayed in the legend. See Section <A href="module-legend.html#module-legend">6.3</A>, See Section <A href="module-font.html#module-font">17</A>
</dl>
<dl><dt><b><tt id='l2h-149' xml:id='l2h-149' class="member">line_style</tt></b></dt>
<dd>
<b>Type:</b> line_style.T
(see Section <A href="module-line-style.html#module-line-style">14</A>)
<b>Default:</b> By default, a style is picked from standard styles round-robin. See Section <A href="module-line-style.html#module-line-style">14</A>.
<P>
The style of the line.
</dl>
<dl><dt><b><tt id='l2h-150' xml:id='l2h-150' class="member">tick_mark</tt></b></dt>
<dd>
<b>Type:</b> tick_mark.T
( see Section <A href="module-tick-mark.html#module-tick-mark">9.1</A>)
<b>Default:</b> None.
<P>
Tick marks to be displayed at each sample point. See Section <A href="module-tick-mark.html#module-tick-mark">9.1</A>
</dl>
<dl><dt><b><tt id='l2h-151' xml:id='l2h-151' class="member">xcol</tt></b></dt>
<dd>
<b>Type:</b> int
<b>Default:</b> 0.
<P>
The column, within attribute "data", from which the X values of sample points are extracted. See Section <A href="module-chart-data.html#module-chart-data">5</A>
</dl>
<dl><dt><b><tt id='l2h-152' xml:id='l2h-152' class="member">y_error_minus_col</tt></b></dt>
<dd>
<b>Type:</b> int
<b>Default:</b> 2.
<P>
The column (within "data") from which the depth of the errorbar is extracted. Meaningful only when error_bar != None. See Section <A href="module-error-bar.html#module-error-bar">9.2</A>
</dl>
<dl><dt><b><tt id='l2h-153' xml:id='l2h-153' class="member">y_error_plus_col</tt></b></dt>
<dd>
<b>Type:</b> int
<b>Default:</b> -1.
<P>
The column (within "data") from which the height of the errorbar is extracted. Meaningful only when error_bar != None. See Section <A href="module-error-bar.html#module-error-bar">9.2</A>
</dl>
<dl><dt><b><tt id='l2h-154' xml:id='l2h-154' class="member">y_qerror_minus_col</tt></b></dt>
<dd>
<b>Type:</b> int
<b>Default:</b> -1.
<P>
See Section <A href="module-error-bar.html#module-error-bar">9.2</A>
</dl>
<dl><dt><b><tt id='l2h-155' xml:id='l2h-155' class="member">y_qerror_plus_col</tt></b></dt>
<dd>
<b>Type:</b> int
<b>Default:</b> -1.
<P>
See Section <A href="module-error-bar.html#module-error-bar">9.2</A>
</dl>
<dl><dt><b><tt id='l2h-156' xml:id='l2h-156' class="member">ycol</tt></b></dt>
<dd>
<b>Type:</b> int
<b>Default:</b> 1.
<P>
The column, within attribute "data", from which the Y values of sample points are extracted. See Section <A href="module-chart-data.html#module-chart-data">5</A>
</dl>
<P>
<p><br /></p><hr class='online-navigation' />
<div class='online-navigation'>
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></a>
<UL CLASS="ChildLinks">
<LI><A href="module-tick-mark.html">9.1 Tick marks</a>
<LI><A href="module-error-bar.html">9.2 Error bars</a>
</ul>
<!--End of Table of Child-Links-->
</div>
<DIV CLASS="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="8 Interval bar plots"
href="module-interval-bar-plot.html"><img src='previous.png'
border='0' height='32' alt='Previous Page' width='32' /></A></td>
<td class='online-navigation'><a rel="parent" title="PyChart"
href="pychart.html"><img src='up.png'
border='0' height='32' alt='Up One Level' width='32' /></A></td>
<td class='online-navigation'><a rel="next" title="9.1 Tick marks"
href="module-tick-mark.html"><img src='next.png'
border='0' height='32' alt='Next Page' width='32' /></A></td>
<td align="center" width="100%">PyChart</td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><img src='blank.png'
border='0' height='32' alt='' width='32' /></td>
<td class='online-navigation'><a rel="index" title="Index"
href="genindex.html"><img src='index.png'
border='0' height='32' alt='Index' width='32' /></A></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-interval-bar-plot.html">8 Interval bar plots</A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="pychart.html">PyChart</A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="module-tick-mark.html">9.1 Tick marks</A>
</div>
</div>
<hr />
<span class="release-info">Documentation released on July 2, 2005.</span>
</DIV>
<!--End of Navigation Panel-->
</BODY>
</HTML>
|