/usr/share/doc/pyxplot/html/sect0220.html is in pyxplot-doc 0.8.4-3.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="generator" content="plasTeX" />
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
<title>PyXPlot Users' Guide: tabulate</title>
<link href="sect0221.html" title="text" rel="next" />
<link href="sect0219.html" title="swap" rel="prev" />
<link href="ch-reference.html" title="Command Reference" rel="up" />
<link rel="stylesheet" href="styles/styles.css" />
</head>
<body>
<div class="navigation">
<table cellspacing="2" cellpadding="0" width="100%">
<tr>
<td><a href="sect0219.html" title="swap"><img alt="Previous: swap" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>
<td><a href="ch-reference.html" title="Command Reference"><img alt="Up: Command Reference" border="0" src="icons/up.gif" width="32" height="32" /></a></td>
<td><a href="sect0221.html" title="text"><img alt="Next: text" border="0" src="icons/next.gif" width="32" height="32" /></a></td>
<td class="navtitle" align="center">PyXPlot Users' Guide</td>
<td><a href="index.html" title="Table of Contents"><img border="0" alt="" src="icons/contents.gif" width="32" height="32" /></a></td>
<td><a href="sect0255.html" title="Index"><img border="0" alt="" src="icons/index.gif" width="32" height="32" /></a></td>
<td><img border="0" alt="" src="icons/blank.gif" width="32" height="32" /></td>
</tr>
</table>
</div>
<div class="breadcrumbs">
<span>
<span>
<a href="index.html">PyXPlot Users' Guide</a> <b>:</b>
</span>
</span><span>
<span>
<a href="sect0075.html">Reference Manual</a> <b>:</b>
</span>
</span><span>
<span>
<a href="ch-reference.html">Command Reference</a> <b>:</b>
</span>
</span><span>
<span>
<b class="current">tabulate</b>
</span>
</span>
<hr />
</div>
<div><h1 id="a0000000221">1.52 tabulate</h1>
<p><a name="a0000001346" id="a0000001346"></a> </p><pre>
tabulate [ <range> ] ( <expression> | <filename> )
[ every <expression> {:<expression>} ]
[ index <value> ]
[ select <expression> ]
[ sortby <expression> ]
[ using <expression> {:<expression>} ]
[ with <output format> ]
</pre><p>PyXPlot’s <tt class="tt">tabulate</tt> command<a name="a0000001347" id="a0000001347"></a> is similar to its <tt class="tt">plot</tt> command, but instead of plotting a series of datapoints onto a graph, it outputs them to datafiles. This can be used to produce text files containing samples of functions, to rearrange/filter the columns in datafiles, to change the units in which data is expressed in datafiles, and so forth. The following example would produce a datafile called <tt class="tt">gamma.dat</tt> containing a list of values of the gamma function: </p><pre>
set output 'gamma.dat'
tabulate [1:5] gamma(x)
</pre><p>Multiple functions may be tabulated into the same file, either by using the <tt class="tt">using</tt><a name="a0000001348" id="a0000001348"></a> modifier: </p><pre>
tabulate [0:2*pi] sin(x):cos(x):tan(x) u 1:2:3:4
</pre><p>or by placing them in a comma-separated list, as in the <tt class="tt">plot</tt> command: </p><pre>
tabulate [0:2*pi] sin(x), cos(x), tan(x)
</pre><p>In the former case, the functions are tabulated horizontally alongside one another in a series of columns. In the latter case, the functions are tabulated one after another in a series of index blocks separated by double linefeeds (see Section <a href="sec-plot_datafiles.html">3.8</a>). </p><p>The setting <tt class="tt">samples</tt> can be used to control the number of points that are produced when tabulating functions, in the same way that it controls the <tt class="tt">plot</tt> command:<a name="a0000001349" id="a0000001349"></a> </p><pre>
set samples 200
</pre><p>If the ordinate axis is set to be logarithmic then the points at which functions are evaluated are spaced logarithmically, otherwise they are spaced linearly. </p><p>The <tt class="tt">select</tt><a name="a0000001350" id="a0000001350"></a>, <tt class="tt">using</tt><a name="a0000001351" id="a0000001351"></a> and <tt class="tt">every</tt><a name="a0000001352" id="a0000001352"></a> modifiers operate in the same manner in the <tt class="tt">tabulate</tt> command as in the <tt class="tt">plot</tt> command. Thus, the following example would write out the third, sixth and ninth columns of the datafile <tt class="tt">input.dat</tt>, but only when the arcsine of the value in the fourth column is positive: </p><pre>
set output 'filtered.dat'
tabulate 'input.dat' u 3:6:9 select (asin($4)>0)
</pre><p>The numerical display format used in each column of the output file is chosen automatically to preserve accuracy whilst simultaneously being as easily human readable as possible. Thus, columns which contain only integers are displayed as such, and scientific notation is only used in columns which contain very large or very small values. If desired, however, a format statement may be specified using the <tt class="tt">with format</tt> specifier. The syntax for this is similar to that expected by the string substitution operator (<tt class="tt">%</tt>; see Section <a href="sec-stringsubop.html">6.1.1</a>). As an example, to tabulate the values of <img src="images/img-0164.png" alt="$x^2$" style="vertical-align:0px;
width:17px;
height:16px" class="math gen" /> to very many significant figures with some additional text, one could use: </p><pre>
tabulate x**2 with format "x = %f ; x**2 = %27.20e"
</pre><p>This might produce the following output: </p><pre>
x = 0.000000 ; x**2 = 0.00000000000000000000e+00
x = 0.833333 ; x**2 = 6.94444444444442421371e-01
x = 1.666667 ; x**2 = 2.77777777777778167589e+00
</pre><p>The data produced by the <tt class="tt">tabulate</tt> command can be sorted in order of any arbitrary metric by supplying an expression after the <tt class="tt">sortby</tt> modifier; where such expressions are supplied, the data is sorted in order from the smallest value of the expression to the largest. </p></div>
<div class="navigation">
<table cellspacing="2" cellpadding="0" width="100%">
<tr>
<td><a href="sect0219.html" title="swap"><img alt="Previous: swap" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>
<td><a href="ch-reference.html" title="Command Reference"><img alt="Up: Command Reference" border="0" src="icons/up.gif" width="32" height="32" /></a></td>
<td><a href="sect0221.html" title="text"><img alt="Next: text" border="0" src="icons/next.gif" width="32" height="32" /></a></td>
<td class="navtitle" align="center">PyXPlot Users' Guide</td>
<td><a href="index.html" title="Table of Contents"><img border="0" alt="" src="icons/contents.gif" width="32" height="32" /></a></td>
<td><a href="sect0255.html" title="Index"><img border="0" alt="" src="icons/index.gif" width="32" height="32" /></a></td>
<td><img border="0" alt="" src="icons/blank.gif" width="32" height="32" /></td>
</tr>
</table>
</div>
<script language="javascript" src="icons/imgadjust.js" type="text/javascript"></script>
</body>
</html>
|