/usr/share/doc/pyxplot/html/sec-piechart.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 | <!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: The piechart Command</title>
<link href="sect0074.html" title="LaTeX and PyXPlot" rel="next" />
<link href="sec-ellipse.html" title="The ellipse Command" rel="prev" />
<link href="sect0070.html" title="Adding Other Vector Graphics Objects" 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-ellipse.html" title="The ellipse Command"><img alt="Previous: The ellipse Command" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>
<td><a href="sect0070.html" title="Adding Other Vector Graphics Objects"><img alt="Up: Adding Other Vector Graphics Objects" border="0" src="icons/up.gif" width="32" height="32" /></a></td>
<td><a href="sect0074.html" title="LaTeX and PyXPlot"><img alt="Next: LaTeX and PyXPlot" 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-vector_graphics.html">Producing Vector Graphics</a> <b>:</b>
</span>
</span><span>
<span>
<a href="sect0070.html">Adding Other Vector Graphics Objects</a> <b>:</b>
</span>
</span><span>
<span>
<b class="current">The <tt class="tt">piechart</tt> Command</b>
</span>
</span>
<hr />
</div>
<div><h2 id="sec:piechart">3.4.9 The <tt class="tt">piechart</tt> Command</h2>
<p>The <tt class="tt">piechart</tt> command<a name="a0000000969" id="a0000000969"></a> produces piecharts based upon single columns of data read from datafiles, which are taken to indicate the sizes of the pie wedges. The <tt class="tt">piechart</tt> command<a name="a0000000970" id="a0000000970"></a> has the following syntax: </p><pre>
piechart ('<filename>'|<function>)
[using <using specifier>]
[select <select specifier>]
[index <index specifier>]
[every <every specifier>]
[label <auto|key|inside|outside> <label>]
[format <format string>]
[with <style> [<style modifier> ... ] ]
</pre><p>Immediately after the <tt class="tt">piechart</tt> keyword, the file (or indeed, function) from which the data is to be taken should be specified; any of the modifiers taken by the <tt class="tt">plot</tt> command – i.e. <tt class="tt">using</tt>, <tt class="tt">index</tt>, etc. – may be used to specify which data from this datafile should be used. The <tt class="tt">label</tt> modifier should be used to specify how a name for each pie wedge should be drawn from the datafile, and has a similar syntax to the equivalent modifier in the <tt class="tt">plot</tt> command, except that the name string may be prefixed by a keyword to specify how the pie wedge names should be positioned. Four options are available: </p><ul class="itemize">
<li><p><tt class="tt">auto</tt> – specifies that the <tt class="tt">inside</tt> positioning mode should be used on wide pie wedges, and the <tt class="tt">outside</tt> positioning mode should be used on narrow pie wedges. <b class="bf">[default]</b> </p></li><li><p><tt class="tt">key</tt> – specifies that all of the labels should be arranged in a vertical list to the right-hand side of the piechart. </p></li><li><p><tt class="tt">inside</tt> – specifies that the labels should be placed within the pie wedges themselves. </p></li><li><p><tt class="tt">outside</tt> – specifies that the labels should be arranged around the circumference of the pie chart. </p></li>
</ul><p>Having specified a name for each wedge using the <tt class="tt">label</tt> modifier, the <tt class="tt">format</tt> modifier determines the final text which is printed along side each wedge. For example, a wedge with name ‘Europe’ might be labelled as ‘27% Europe’, applying the default format string: </p><pre>
"%.1d\%% %s"%(percentage,label)
</pre><p> Three variables may be used in format strings: <tt class="tt">label</tt> contains the name of the wedge as specified by the <tt class="tt">label</tt> modifier, <tt class="tt">percentage</tt> contains the numerical percentage size of the wedge, and <tt class="tt">wedgesize</tt> contains the absolute unnormalised size of the wedge, as read from the input datafile, before the sizes were renormalised to sum to 100%. </p><p>The <tt class="tt">with</tt> modifier may be followed by the keywords <tt class="tt">colour</tt>, <tt class="tt">linewidth</tt>, <tt class="tt">style</tt>, which all apply to the lines drawn around the circumference of the piechart and between its wedges. The fill colour of the wedges themselves are taken sequentially from the current palette, as set by the <tt class="tt">set palette</tt> command. Note that PyXPlot’s default palette is optimised more for producing plots with datasets in different and distinct colours than for producing piecharts in aesthetically pleasing shades, where a little more subtly may be desirable. A suitable call to the <tt class="tt">set palette</tt> command is highly recommended before the <tt class="tt">piechart</tt> command<a name="a0000000971" id="a0000000971"></a> is used. </p><p>As with the <tt class="tt">plot</tt> command, the position and size of the piechart are governed by the <tt class="tt">set origin</tt> and <tt class="tt">set size</tt> commands. The former determines where the centre of the piechart is positioned; the latter determines its diameter. </p><p> <span class="upshape"><span class="mdseries"><span class="rm">A piechart of the composition of the Universe.</span></span></span></p><div>
<table cellspacing="0" class="tabular">
<tr>
<td style="border-top-style:solid; border-left:1px solid black; border-right:1px solid black; border-top-color:black; border-top-width:1px; text-align:left"><p> In this example, we use PyXPlot’s <tt class="tt">piechart</tt> command to produce a diagram of the composition of the Universe, showing that of the mass in the Universe, only 4% is in the form of the baryonic matter; of the rest, 22% is in the form of dark matter and 74% in the form of dark energy: </p></td>
</tr><tr>
<td style="text-align:left; border-right:1px solid black; border-left:1px solid black"><p><tt class="tt">set palette grey40, grey60, grey80</tt><br /><tt class="tt">set width 6</tt><br /><tt class="tt">piechart ’–’ using $1 label key "%s"%($2)</tt><br /><tt class="tt">0.22 Dark<img src="images/img-0028.png" alt="$\sim $" style="vertical-align:2px;
width:12px;
height:5px" class="math gen" />Matter</tt><br /><tt class="tt">0.04 Baryonic<img src="images/img-0028.png" alt="$\sim $" style="vertical-align:2px;
width:12px;
height:5px" class="math gen" />Matter</tt><br /><tt class="tt">0.74 Dark<img src="images/img-0028.png" alt="$\sim $" style="vertical-align:2px;
width:12px;
height:5px" class="math gen" />Energy</tt><br /><tt class="tt">END</tt> </p></td>
</tr><tr>
<td style="text-align:left; border-right:1px solid black; border-left:1px solid black"><p><center><img src="images/img-0601.png" alt="\includegraphics{examples/eps/ex_piechart}" style="width:489px; height:285px" />
</center> </p></td>
</tr><tr>
<td style="text-align:left; border-right:1px solid black; border-left:1px solid black"><p>Below, we show the change produced by replacing the line<br /><tt class="tt">piechart ’–’ using $1 label key "%s"%($2)</tt><br />with<br /><tt class="tt">piechart ’–’ using $1 label auto "%s"%($2)</tt><br />Note that the labels on the piechart are placed either within the pie, in the cases of large wedges, and around the edge of the pie for those wedges which are too narrow for this. </p></td>
</tr><tr>
<td style="border-bottom-style:solid; border-bottom-width:1px; border-left:1px solid black; border-right:1px solid black; text-align:left; border-bottom-color:black"><p><center><img src="images/img-0608.png" alt="\includegraphics{examples/eps/ex_piechart2}" style="width:541px; height:285px" />
</center> </p></td>
</tr>
</table>
</div></div>
<div class="navigation">
<table cellspacing="2" cellpadding="0" width="100%">
<tr>
<td><a href="sec-ellipse.html" title="The ellipse Command"><img alt="Previous: The ellipse Command" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>
<td><a href="sect0070.html" title="Adding Other Vector Graphics Objects"><img alt="Up: Adding Other Vector Graphics Objects" border="0" src="icons/up.gif" width="32" height="32" /></a></td>
<td><a href="sect0074.html" title="LaTeX and PyXPlot"><img alt="Next: LaTeX and PyXPlot" 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>
|