This file is indexed.

/usr/share/doc/pyxplot/html/sec-tabulate.html is in pyxplot-doc 0.9.2-4.

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
<!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: Tabulating functions and slicing data files</title>

<link href="sec-fit_command.html" title="Function fitting" rel="next" />
<link href="sec-special_comments.html" title="Special comment lines in data files" rel="prev" />
<link href="ch-numerics.html" title="Working with data" 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="sec-special_comments.html" title="Special comment lines in data files"><img alt="Previous: Special comment lines in data files" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>

<td><a href="ch-numerics.html" title="Working with data"><img alt="Up: Working with data" border="0" src="icons/up.gif" width="32" height="32" /></a></td>

<td><a href="sec-fit_command.html" title="Function fitting"><img alt="Next: Function fitting" 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="sect0288.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="sect0001.html">Introduction to PyXPlot</a> <b>:</b>
</span>

</span><span>
<span>
<a href="ch-numerics.html">Working with data</a> <b>:</b>
</span>

</span><span>

<span>
<b class="current">Tabulating functions and slicing data files</b>
</span>
</span>
<hr />
</div>

<div><h1 id="sec:tabulate">5.5 Tabulating functions and slicing data files</h1>
<p>Pyxplot’s <tt class="tt">tabulate</tt> command<a name="a0000000537" id="a0000000537"></a> is similar to its <tt class="tt">plot</tt> command, but instead of plotting a series of data points onto a graph, it writes them to a data file. It can be used to produce text files containing samples of functions, to rearrange/filter the columns in data files, to produce a copy of a data file using different physical units, and so on. </p><p>The following example would produce a data file 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>One way to tabulate multiple functions into a common file is with the <tt class="tt">using</tt><a name="a0000000538" id="a0000000538"></a> modifier, as in the example </p><pre>
tabulate [0:2*pi] sin(x):cos(x):tan(x) using 1:2:3:4
</pre><p>This tabulates the supplied functions horizontally alongside one another in a series of columns. As many expressions may be supplied to the <tt class="tt">using</tt><a name="a0000000539" id="a0000000539"></a> modifier as columns are wanted. </p><p>Alternatively, if a series on functions or data files are listed in a comma-separated list (as is done in the <tt class="tt">plot</tt> command to plot multiple datasets), 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><pre>
tabulate [0:2*pi] sin(x), cos(x), tan(x)
</pre><p>The <tt class="tt">set samples</tt> command<a name="a0000000540" id="a0000000540"></a> can be used to control the number of points that are listed when tabulating functions, in the same way that it controls the number of data points drawn by the <tt class="tt">plot</tt> command: </p><pre>
set samples 200
</pre><p>If the abscissa axis is set to be logarithmic then the functions are evaluated at logarithmically-space points along the axis; otherwise, they are samples at linearly-spaced points. </p><p>The <tt class="tt">select</tt><a name="a0000000541" id="a0000000541"></a>, <tt class="tt">using</tt><a name="a0000000542" id="a0000000542"></a> and <tt class="tt">every</tt><a name="a0000000543" id="a0000000543"></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 data file <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' using 3:6:9 select (asin($4)&gt;0)
</pre><p>The numerical display format used for each column of the output file is automatically chosen 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. </p><p>If desired, however, a custom format may be specified using the <tt class="tt">with format</tt> modifier. This can be used both to specify text to appear in between the columns of data, and to specify the format of the data itself using tokens such as <tt class="tt">%.5f</tt>, as used by Pyxplot’s string substitution operator (<tt class="tt">%</tt>; see Section <a href="sec-stringsubop.html">6.2.1</a>), and the <tt class="tt">sprintf</tt> statement of many other programming languages. </p><p>For example, to tabulate the values of <img src="images/img-0163.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>There is flexibility as to how many substitution tokens appear in the format specification. If the number of tokens is fewer than the number of columns of data, then the format is repeated until all the columns have been printed. Thus, the command </p><pre>
tabulate x**2 with format "%.3f "
</pre><p>might produce the output: </p><pre>
0.000 0.000
0.833 0.694
1.667 2.778
</pre><p>Note that the space character at the end of the format is important to ensure that there is a gap between the columns. </p><p>If formats are supplied for more columns than are present, then the final columns are padded with <tt class="tt">nan</tt> (not a number). </p><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. The data are sorted in order from the lowest value of this expression to the highest. </p></div>





<div class="navigation">
<table cellspacing="2" cellpadding="0" width="100%">
<tr>
<td><a href="sec-special_comments.html" title="Special comment lines in data files"><img alt="Previous: Special comment lines in data files" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>

<td><a href="ch-numerics.html" title="Working with data"><img alt="Up: Working with data" border="0" src="icons/up.gif" width="32" height="32" /></a></td>

<td><a href="sec-fit_command.html" title="Function fitting"><img alt="Next: Function fitting" 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="sect0288.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>