/usr/share/doc/pyxplot/html/sect0060.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 | <!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: Custom Colour Mappings</title>
<link href="ex-mandelbrot.html" title="Colour Scale Bars" rel="next" />
<link href="sec-colourmaps.html" title="Colour Maps" rel="prev" />
<link href="sec-colourmaps.html" title="Colour Maps" 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-colourmaps.html" title="Colour Maps"><img alt="Previous: Colour Maps" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>
<td><a href="sec-colourmaps.html" title="Colour Maps"><img alt="Up: Colour Maps" border="0" src="icons/up.gif" width="32" height="32" /></a></td>
<td><a href="ex-mandelbrot.html" title="Colour Scale Bars"><img alt="Next: Colour Scale Bars" 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="sect0043.html">Plotting and Vector Graphics</a> <b>:</b>
</span>
</span><span>
<span>
<a href="ch-plotting.html">Plotting: A Detailed Survey</a> <b>:</b>
</span>
</span><span>
<span>
<a href="sec-colourmaps.html">Colour Maps</a> <b>:</b>
</span>
</span><span>
<span>
<b class="current">Custom Colour Mappings</b>
</span>
</span>
<hr />
</div>
<div><h2 id="a0000000061">1.12.1 Custom Colour Mappings</h2>
<p>The colour mapping used by the <tt class="tt">colourmap</tt> plot style is set using the <tt class="tt">set colourmap</tt> command<a name="a0000000844" id="a0000000844"></a>, which takes algebraic expressions for the RGB, HSB or CMYK components of the colour to use as a function of the variables <tt class="tt">c1</tt>, <tt class="tt">c2</tt>, <tt class="tt">c3</tt> and <tt class="tt">c4</tt>. As elsewhere in PyXPlot, these colour components should take values in the range zero to one; values outside of this range are clipped. The syntax of the <tt class="tt">set colourmap</tt> command<a name="a0000000845" id="a0000000845"></a> is as follows: </p><pre>
set colourmap ( rgb<r>:<g>:<b> |
hsb<h>:<s>:<b> |
cmyk<c>:<m>:<y>:<k> )
[ mask <expr> ]
</pre><p>If the optional mask expression is supplied, then any areas in a colour map where this expression evaluates to zero (i.e. false) are made transparent. The following colour mapping, which is the default, produces a greyscale colour mapping of the third column of data supplied to the <tt class="tt">colourmap</tt><a name="a0000000846" id="a0000000846"></a><a name="a0000000847" id="a0000000847"></a> plot style; further columns of data, if supplied, are not used: </p><pre>
set c1range [*:*] renormalise noreverse
set colourmap rgb(c1):(c1):(c1)
</pre><p>The <tt class="tt">set c<n>range</tt> command<a name="a0000000848" id="a0000000848"></a> command specifies how the values of <img src="images/img-0521.png" alt="$c_ n$" style="vertical-align:-2px;
width:16px;
height:10px" class="math gen" /> are processed before being used in the expressions supplied to the <tt class="tt">set colourmap</tt> command<a name="a0000000849" id="a0000000849"></a>. It has the following syntax: </p><pre>
set c<n>range [ <range> ]
[ reversed | noreversed ]
[ renormalise | norenormalise ]
</pre><p>If the <tt class="tt">renormalise</tt> option is specified, then the values of <img src="images/img-0521.png" alt="$c_ n$" style="vertical-align:-2px;
width:16px;
height:10px" class="math gen" /> at each point in the data grid are first scaled into the range zero to one. This is generally useful, since the colour components themselves must be in this range; in the example given above, the lowest value of <img src="images/img-0510.png" alt="$c_1$" style="vertical-align:-2px;
width:14px;
height:10px" class="math gen" /> corresponds to black (i.e. brightness 0), and the highest value corresponds to white (i.e. brightness 1). If an explicit range is specified to the <tt class="tt">set c<n>range</tt> command, then the upper limit of this range maps to the value one, and the lower limit maps to the value zero. An asterisk (<tt class="tt">*</tt>) means that the lowest or highest value is substituted. The mapping is inverted if the <tt class="tt">reverse</tt> option is specified, such that the upper limit maps to zero, and the lower limit maps to one. Intermediate values are scaled either linearly or logarithmically, and these behaviours can be selected with the following commands: </p><pre>
set logscale c1
set linearscale c1
</pre><p>In the example below, a colour map of the function <img src="images/img-0522.png" alt="$f(z)=3x^2/(x^3+1)$" style="vertical-align:-5px;
width:156px;
height:21px" class="math gen" /> is made, using hue to represent the magnitude of <img src="images/img-0300.png" alt="$f(z)$" style="vertical-align:-4px;
width:32px;
height:18px" class="math gen" /> and saturation to represent the complex argument of <img src="images/img-0300.png" alt="$f(z)$" style="vertical-align:-4px;
width:32px;
height:18px" class="math gen" />: </p><p><tt class="tt">set numerics complex</tt><br /><tt class="tt">set sample grid 400x400</tt><br /><tt class="tt">set nogrid</tt><br /><tt class="tt">set size square</tt><br /><tt class="tt">set key below</tt><br /><tt class="tt">set c1range[0:2]</tt><br /><tt class="tt">set colmap hsb(c1):(c2*0.7+0.3):1</tt><br /><tt class="tt">f(x) = 3*x**2 / (x**3+1)</tt><br /><tt class="tt">plot [-3:3][-3:3] abs(f(x+i*y)):arg(f(x+i*y)) with colourmap</tt> </p><p><center>
<img src="images/img-0524.png" alt="\includegraphics[width=8cm]{examples/eps/ex_branch_cuts}" style="width:8cm" /></center> </p></div>
<div class="navigation">
<table cellspacing="2" cellpadding="0" width="100%">
<tr>
<td><a href="sec-colourmaps.html" title="Colour Maps"><img alt="Previous: Colour Maps" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>
<td><a href="sec-colourmaps.html" title="Colour Maps"><img alt="Up: Colour Maps" border="0" src="icons/up.gif" width="32" height="32" /></a></td>
<td><a href="ex-mandelbrot.html" title="Colour Scale Bars"><img alt="Next: Colour Scale Bars" 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>
|