/usr/share/doc/pyxplot/html/sect0045.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 162 163 164 165 | <!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: Lines and Points</title>
<link href="sec-errorbars.html" title="Error Bars" rel="next" />
<link href="sec-list_of_plotstyles.html" title="PyXPlot’s Plot Styles" rel="prev" />
<link href="sec-list_of_plotstyles.html" title="PyXPlot’s Plot Styles" 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-list_of_plotstyles.html" title="PyXPlot’s Plot Styles"><img alt="Previous: PyXPlot’s Plot Styles" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>
<td><a href="sec-list_of_plotstyles.html" title="PyXPlot’s Plot Styles"><img alt="Up: PyXPlot’s Plot Styles" border="0" src="icons/up.gif" width="32" height="32" /></a></td>
<td><a href="sec-errorbars.html" title="Error Bars"><img alt="Next: Error 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-list_of_plotstyles.html">PyXPlot’s Plot Styles</a> <b>:</b>
</span>
</span><span>
<span>
<b class="current">Lines and Points</b>
</span>
</span>
<hr />
</div>
<div><h2 id="a0000000046">1.2.1 Lines and Points</h2>
<p>The following is a list of PyXPlot’s simplest plot styles, all of which take two (or three) columns of input data on 2D (or 3D) plots, representing the <img src="images/img-0019.png" alt="$x$" style="vertical-align:0px;
width:10px;
height:8px" class="math gen" />-, <img src="images/img-0020.png" alt="$y$" style="vertical-align:-4px;
width:9px;
height:12px" class="math gen" />- (and <img src="images/img-0101.png" alt="$z$" style="vertical-align:0px;
width:9px;
height:8px" class="math gen" />-)coordinates of the positions of each point: </p><ul class="itemize">
<li><p><tt class="tt">dots</tt><a name="a0000000630" id="a0000000630"></a><a name="a0000000631" id="a0000000631"></a> – places a small dot at each datum. </p></li><li><p><tt class="tt">lines</tt><a name="a0000000632" id="a0000000632"></a><a name="a0000000633" id="a0000000633"></a> – connects adjacent datapoints with straight lines. </p></li><li><p><tt class="tt">linespoints</tt><a name="a0000000634" id="a0000000634"></a><a name="a0000000635" id="a0000000635"></a> – a combination of both lines and points. </p></li><li><p><tt class="tt">lowerlimits</tt><a name="a0000000636" id="a0000000636"></a><a name="a0000000637" id="a0000000637"></a> – places a lower-limit sign (<img src="images/img-0365.png" alt="\includegraphics{examples/eps/ex_lowerlimit}" style="width:11px; height:11px" />
) at each datum.<a name="a0000000638" id="a0000000638"></a> </p></li><li><p><tt class="tt">points</tt><a name="a0000000639" id="a0000000639"></a><a name="a0000000640" id="a0000000640"></a> – places a marker symbol at each datum. </p></li><li><p><tt class="tt">stars</tt><a name="a0000000641" id="a0000000641"></a><a name="a0000000642" id="a0000000642"></a> – similar to <tt class="tt">points</tt>, but uses a different set of marker symbols, based upon the stars drawn in Johann Bayer’s highly ornate star atlas <i class="it">Uranometria</i> of 1603. </p></li><li><p><tt class="tt">upperlimits</tt><a name="a0000000643" id="a0000000643"></a><a name="a0000000644" id="a0000000644"></a> – places an upper-limit sign (<img src="images/img-0372.png" alt="\includegraphics{examples/eps/ex_upperlimit}" style="width:11px; height:11px" />
) at each datum.<a name="a0000000645" id="a0000000645"></a> </p></li>
</ul><p> <span class="upshape"><span class="mdseries"><span class="rm">A Hertzsprung-Russell Diagram.</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> Hertzsprung-Russell (HR) Diagrams are scatter-plots of the luminosities of stars plotted against their colours, on which most normal stars lie along a tight line called the main sequence, whilst unusual classes of stars – giants and dwarfs – can be readily identified on account of their not lying along this main sequence. The principal difficulty in constructing accurate HR diagrams is that the luminosities <img src="images/img-0378.png" alt="$L$" style="vertical-align:0px;
width:12px;
height:12px" class="math gen" /> of stars can only be calculated from their observed brightnesses <img src="images/img-0379.png" alt="$F$" style="vertical-align:0px;
width:14px;
height:12px" class="math gen" />, using the relation <img src="images/img-0380.png" alt="$L=Fd^2$" style="vertical-align:0px;
width:66px;
height:16px" class="math gen" /> if their distances <img src="images/img-0041.png" alt="$d$" style="vertical-align:0px;
width:10px;
height:13px" class="math gen" /> are known. In this example, we construct an HR diagram using observations made by the European Space Agency’s <i class="it">Hipparcos</i> spacecraft, which accurately measured the distances of over a million stars between 1989 and 1993. </p></td>
</tr><tr>
<td style="text-align:left; border-right:1px solid black; border-left:1px solid black"><p>The Hipparcos catalogue can be downloaded for free from ftp://cdsarc.u-strasbg.fr/pub/cats/I/239/hip_main.dat.gz; a description of the catalogue can be found at http://cdsarc.u-strasbg.fr/viz-bin/Cat?I/239. In summary, though the data is arranged in a non-standard format which PyXPlot cannot read without a special input filter, the following Python script generates a text file with four columns containing the magnitudes <img src="images/img-0312.png" alt="$m$" style="vertical-align:0px;
width:16px;
height:8px" class="math gen" />, <img src="images/img-0381.png" alt="$B-V$" style="vertical-align:0px;
width:51px;
height:12px" class="math gen" /> colours and parallaxes <img src="images/img-0270.png" alt="$p$" style="vertical-align:-4px;
width:10px;
height:12px" class="math gen" /> of the stars, together with the uncertainties in the parallaxes. From these values, the absolute magnitudes <img src="images/img-0382.png" alt="$M$" style="vertical-align:0px;
width:19px;
height:12px" class="math gen" /> of the stars – a measure of their luminosities – can be calculated using the expression <img src="images/img-0383.png" alt="$M=m+5\log _{10}\left(10^{2}p\right)$" style="vertical-align:-6px;
width:185px;
height:22px" class="math gen" />, where <img src="images/img-0270.png" alt="$p$" style="vertical-align:-4px;
width:10px;
height:12px" class="math gen" /> is measured in milli-arcseconds: </p></td>
</tr><tr>
<td style="text-align:left; border-right:1px solid black; border-left:1px solid black"><p><tt class="tt">for line in open("hip_main.dat"):</tt><br /><tt class="tt">try:</tt><br /><tt class="tt">Vmag = float(line[41:46])</tt><br /><tt class="tt">BVcol = float(line[245:251])</tt><br /><tt class="tt">parr = float(line[79:86])</tt><br /><tt class="tt">parre = float(line[119:125])</tt><br /><tt class="tt">print "%s,%s,%s,%s"%(Vmag, BVcol, parr, parre)</tt><br /><tt class="tt">except ValueError: pass</tt> </p></td>
</tr><tr>
<td style="text-align:left; border-right:1px solid black; border-left:1px solid black"><p>The resultant four columns of data can then be plotted in the <tt class="tt">dots</tt> style using the following PyXPlot script. Because the catalogue is very large, and many of the parallax datapoints have large errorbars producing large uncertainties in their vertical positions on the plot, we use the <tt class="tt">select</tt> statement to pick out those datapoints with parallax signal-to-noise ratios of better than 20. </p></td>
</tr><tr>
<td style="text-align:left; border-right:1px solid black; border-left:1px solid black"><p><tt class="tt">set nokey</tt><br /><tt class="tt">set size square</tt><br /><tt class="tt">set xlabel ’$B-V$ colour’</tt><br /><tt class="tt">set ylabel ’Absolute magnitude $M$’</tt><br /><tt class="tt">plot [-0.4:2][14:-4] ’hr_data.dat’ <img src="images/img-0006.png" alt="$\backslash $" style="vertical-align:-5px;
width:7px;
height:18px" class="math gen" /></tt><br /><tt class="tt">using $2:($1+5*log10(1e2*$3)) <img src="images/img-0006.png" alt="$\backslash $" style="vertical-align:-5px;
width:7px;
height:18px" class="math gen" /></tt><br /><tt class="tt">select ($4/$3<0.05) <img src="images/img-0006.png" alt="$\backslash $" style="vertical-align:-5px;
width:7px;
height:18px" class="math gen" /></tt><br /><tt class="tt">with dots ps 3</tt> </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-0385.png" alt="\includegraphics[width=10cm]{examples/eps/ex_hrdiagram}" style="width:10cm" /></center> </p></td>
</tr>
</table>
</div></div>
<div class="navigation">
<table cellspacing="2" cellpadding="0" width="100%">
<tr>
<td><a href="sec-list_of_plotstyles.html" title="PyXPlot’s Plot Styles"><img alt="Previous: PyXPlot’s Plot Styles" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>
<td><a href="sec-list_of_plotstyles.html" title="PyXPlot’s Plot Styles"><img alt="Up: PyXPlot’s Plot Styles" border="0" src="icons/up.gif" width="32" height="32" /></a></td>
<td><a href="sec-errorbars.html" title="Error Bars"><img alt="Next: Error 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>
|