/usr/share/doc/pyxplot/html/sect0104.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 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 | <!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: interpolate</title>
<link href="sect0105.html" title="jpeg" rel="next" />
<link href="sect0103.html" title="image" 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="sect0103.html" title="image"><img alt="Previous: image" 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="sect0105.html" title="jpeg"><img alt="Next: jpeg" 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">interpolate</b>
</span>
</span>
<hr />
</div>
<div><h1 id="a0000000105">1.29 interpolate</h1>
<p><a name="a0000001061" id="a0000001061"></a> </p><pre>
interpolate ( akima | linear | loglinear | polynomial |
spline | stepwise |
2d [( bmp_r | bmp_g | bmp_b )] )
[<range specification>] <function name>"()"
'<filename>'
[ every <expression> {:<expression} ]
[ index <value> ]
[ select <expression> ]
[ using <expression> {:<expression} ]
</pre><p>The <tt class="tt">interpolate</tt> command<a name="a0000001062" id="a0000001062"></a> can be used to generate a special function within PyXPlot’s mathematical environment which interpolates a set of datapoints supplied from a datafile. Either one- or two-dimensional interpolation is possible. </p><p>In the case of one-dimensional interpolation, various different types of interpolation are supported: linear interpolation, power law interpolation, polynomial interpolation, cubic spline interpolation and akima spline interpolation. Stepwise interpolation returns the value of the datapoint nearest to the requested point in argument space. The use of polynomial interpolation with large datasets is strongly discouraged, as polynomial fits tend to show severe oscillations between datapoints. Except in the case of stepwise interpolation, extrapolation is not permitted; if an attempt is made to evaluate an interpolated function beyond the limits of the datapoints which it interpolates, PyXPlot returns an error or value of not-a-number. </p><p>In the case of two-dimensional interpolation, the type of interpolation to be used is set using the <tt class="tt">interpolate</tt> modifier to the <tt class="tt">set samples</tt> command<a name="a0000001063" id="a0000001063"></a>, and may be changed at any time after the interpolation function has been created. The options available are nearest neighbour interpolation – which is the two-dimensional equivalent of stepwise interpolation, inverse square interpolation – which returns a weighted average of the supplied datapoints, using the inverse squares of their distances from the requested point in argument space as weights, and Monaghan Lattanzio interpolation, which uses the weighting function (Monaghan & Lattanzio 1985) </p><table id="a0000001064" cellpadding="7" width="100%" cellspacing="0" class="eqnarray">
<tr id="a0000001065">
<td style="width:40%"> </td>
<td style="vertical-align:middle; text-align:right"><img src="images/img-0172.png" alt="$\displaystyle w(x) $" style="vertical-align:-4px; width:36px; height:18px" class="math gen" /></td>
<td style="vertical-align:middle; text-align:center"><img src="images/img-0173.png" alt="$\displaystyle = 1 - \nicefrac {3}{2}v^2 + \nicefrac {3}{4}v^3 $" style="vertical-align:-5px; width:146px; height:22px" class="math gen" /></td>
<td style="vertical-align:middle; text-align:left"><img src="images/img-0174.png" alt="$\displaystyle \, \mathrm{for~ }0\leq v\leq 1 $" style="vertical-align:-3px; width:103px; height:15px" class="math gen" /></td>
<td style="width:40%"> </td>
<td style="width:20%" class="eqnnum"> </td>
</tr><tr id="a0000001066">
<td style="width:40%"> </td>
<td style="vertical-align:middle; text-align:right"><img src="images/img-0175.png" alt="$\displaystyle $" style="vertical-align:0px; width:1px; height:1px" class="math gen" /></td>
<td style="vertical-align:middle; text-align:center"><img src="images/img-0176.png" alt="$\displaystyle = \nicefrac {1}{4}(2-v)^3 $" style="vertical-align:-5px; width:100px; height:22px" class="math gen" /></td>
<td style="vertical-align:middle; text-align:left"><img src="images/img-0177.png" alt="$\displaystyle \, \mathrm{for~ }1\leq v\leq 2 $" style="vertical-align:-3px; width:104px; height:15px" class="math gen" /></td>
<td style="width:40%"> </td>
<td style="width:20%" class="eqnnum"> </td>
</tr>
</table><p> where <img src="images/img-0178.png" alt="$v=r/h$" style="vertical-align:-5px;
width:61px;
height:18px" class="math gen" /> for <img src="images/img-0179.png" alt="$h=\sqrt {A/n}$" style="vertical-align:-5px;
width:86px;
height:22px" class="math gen" />, <img src="images/img-0180.png" alt="$A$" style="vertical-align:0px;
width:13px;
height:12px" class="math gen" /> is the product <img src="images/img-0181.png" alt="$(x_\mathrm {max}-x_\mathrm {min})(y_\mathrm {max}-y_\mathrm {min})$" style="vertical-align:-4px;
width:212px;
height:18px" class="math gen" /> and <img src="images/img-0014.png" alt="$n$" style="vertical-align:0px;
width:11px;
height:8px" class="math gen" /> is the number of input datapoints. These are selected as follows: </p><pre>
set samples interpolate NearestNeighbour
set samples interpolate InverseSquare
set samples interpolate MonaghanLattanzio
</pre><p>Finally, data can be imported from graphical images in bitmap (<tt class="tt">.bmp</tt>) format to produce a function of two arguments returning a value in the range <img src="images/img-0182.png" alt="$0\to 1$" style="vertical-align:-1px;
width:45px;
height:13px" class="math gen" /> which represents the data in one of the image’s three colour channels. The two arguments are the horizontal and vertical position within the bitmap image, as measured in pixels. </p><p>A very common application of the <tt class="tt">interpolate</tt> command<a name="a0000001067" id="a0000001067"></a> is to perform arithmetic functions such as addition or subtraction on datasets which are not sampled at the same abscissa values. The following example would plot the difference between two such datasets: </p><pre>
interpolate linear f() 'data1.dat'
interpolate linear g() 'data2.dat'
plot [min:max] f(x)-g(x)
</pre><p>Note that it is advisable to supply a range to the <tt class="tt">plot</tt> command in this example: because the two datasets have been turned into continuous functions, the <tt class="tt">plot</tt> command has to guess a range over which to plot them unless one is explicitly supplied. </p><p>The <tt class="tt">spline</tt> command<a name="a0000001068" id="a0000001068"></a> is an alias for <tt class="tt">interpolate spline</tt>; the following two statements are equivalent: </p><pre>
spline f() 'data1.dat'
interpolate spline f() 'data1.dat'
</pre></div>
<div class="navigation">
<table cellspacing="2" cellpadding="0" width="100%">
<tr>
<td><a href="sect0103.html" title="image"><img alt="Previous: image" 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="sect0105.html" title="jpeg"><img alt="Next: jpeg" 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>
|