/usr/share/doc/pyxplot/html/sect0048.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 | <!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: Arrows</title>
<link href="sect0049.html" title="Colour Maps, Contour Maps and Surface Plots" rel="next" />
<link href="sect0047.html" title="Steps" 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="sect0047.html" title="Steps"><img alt="Previous: Steps" 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="sect0049.html" title="Colour Maps, Contour Maps and Surface Plots"><img alt="Next: Colour Maps, Contour Maps and Surface Plots" 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">Arrows</b>
</span>
</span>
<hr />
</div>
<div><h2 id="a0000000049">1.2.6 Arrows</h2>
<p>The following plot styles allow arrows or lines to be drawn on graphs with positions dictated by a series of datapoints: </p><ul class="itemize">
<li><p><tt class="tt">arrows_head</tt><a name="a0000000710" id="a0000000710"></a><a name="a0000000711" id="a0000000711"></a> </p></li><li><p><tt class="tt">arrows_nohead</tt><a name="a0000000712" id="a0000000712"></a><a name="a0000000713" id="a0000000713"></a> </p></li><li><p><tt class="tt">arrows_twohead</tt><a name="a0000000714" id="a0000000714"></a><a name="a0000000715" id="a0000000715"></a> </p></li>
</ul><p> The plot style of <tt class="tt">arrows</tt><a name="a0000000716" id="a0000000716"></a><a name="a0000000717" id="a0000000717"></a> is an alias for <tt class="tt">arrows_head</tt><a name="a0000000718" id="a0000000718"></a><a name="a0000000719" id="a0000000719"></a>. Each of these plot styles take four columns of data on two-dimensional plots – <img src="images/img-0399.png" alt="$x_1$" style="vertical-align:-2px;
width:16px;
height:10px" class="math gen" />, <img src="images/img-0400.png" alt="$y_1$" style="vertical-align:-4px;
width:15px;
height:12px" class="math gen" />, <img src="images/img-0401.png" alt="$x_2$" style="vertical-align:-2px;
width:17px;
height:10px" class="math gen" /> and <img src="images/img-0402.png" alt="$y_2$" style="vertical-align:-4px;
width:16px;
height:12px" class="math gen" /> – or six columns of data on three-dimensional plots with additional <img src="images/img-0101.png" alt="$z$" style="vertical-align:0px;
width:9px;
height:8px" class="math gen" />-coordinates. Each datapoint results in an arrow being drawn from the point <img src="images/img-0403.png" alt="$(x_1,y_1,z_1)$" style="vertical-align:-4px;
width:79px;
height:18px" class="math gen" /> to the point <img src="images/img-0404.png" alt="$(x_2,y_2,z_2)$" style="vertical-align:-4px;
width:79px;
height:18px" class="math gen" />. The three plot styles differ in the kinds of arrows that they draw: <tt class="tt">arrows_head</tt><a name="a0000000720" id="a0000000720"></a><a name="a0000000721" id="a0000000721"></a> draws an arrow head on each arrow at the point <img src="images/img-0404.png" alt="$(x_2,y_2,z_2)$" style="vertical-align:-4px;
width:79px;
height:18px" class="math gen" />; <tt class="tt">arrows_nohead</tt><a name="a0000000722" id="a0000000722"></a><a name="a0000000723" id="a0000000723"></a> draws simple lines without arrow heads on either end; <tt class="tt">arrows_twohead</tt><a name="a0000000724" id="a0000000724"></a><a name="a0000000725" id="a0000000725"></a> draws arrow heads on both ends of each arrow. </p><p> <span class="upshape"><span class="mdseries"><span class="rm">A diagram of fluid flow around a vortex.</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 produce a velocity map of fluid circulating in a vortex. For simplicity, we assume that the fluid in the core of the vortex, at radii <img src="images/img-0405.png" alt="$r<1$" style="vertical-align:0px;
width:41px;
height:12px" class="math gen" />, is undergoing solid body rotation with velocity <img src="images/img-0406.png" alt="$v\propto r$" style="vertical-align:0px;
width:41px;
height:8px" class="math gen" />, and that the fluid outside this core is behaving as a free vortex with velocity <img src="images/img-0407.png" alt="$v\propto 1/r$" style="vertical-align:-5px;
width:59px;
height:18px" class="math gen" />. First of all, we use a simple python script to generate a datafile with the four columns: </p></td>
</tr><tr>
<td style="text-align:left; border-right:1px solid black; border-left:1px solid black"><p><tt class="tt">from math import *</tt><br /><tt class="tt">for i in range(-19,20,2):</tt><br /><tt class="tt">for j in range(-19,20,2):</tt><br /><tt class="tt">x = float(i)/2</tt><br /><tt class="tt">y = float(j)/2</tt><br /><tt class="tt">r = sqrt(x**2 + y**2) / 4</tt><br /><tt class="tt">theta = atan2(y,x)</tt><br /><tt class="tt">if (r <img src="images/img-0034.png" alt="$<$" style="vertical-align:0px;
width:12px;
height:11px" class="math gen" /> 1.0): v = 1.3*r</tt><br /><tt class="tt">else : v = 1.3/r</tt><br /><tt class="tt">vy = v * cos(theta)</tt><br /><tt class="tt">vx = v * -sin(theta)</tt><br /><tt class="tt">print "%7.3f %7.3f %7.3f %7.3f"%(x,y,vx,vy)</tt> </p></td>
</tr><tr>
<td style="text-align:left; border-right:1px solid black; border-left:1px solid black"><p>This data can then be plotted using the following PyXPlot script: </p></td>
</tr><tr>
<td style="text-align:left; border-right:1px solid black; border-left:1px solid black"><p><tt class="tt">set size square</tt><br /><tt class="tt">set nokey</tt><br /><tt class="tt">set xlabel ’x’</tt><br /><tt class="tt">set ylabel ’y’</tt><br /><tt class="tt">set trange [0:2*pi]</tt><br /><tt class="tt">plot <img src="images/img-0006.png" alt="$\backslash $" style="vertical-align:-5px;
width:7px;
height:18px" class="math gen" /></tt><br /><tt class="tt">’data’ u 1:2:($1+$3):($2+$4) w arrows, <img src="images/img-0006.png" alt="$\backslash $" style="vertical-align:-5px;
width:7px;
height:18px" class="math gen" /></tt><br /><tt class="tt">parametric 4*sin(t):4*cos(t) w lt 2 col black</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-0409.png" alt="\includegraphics[width=10cm]{examples/eps/ex_vortex}" style="width:10cm" /></center> </p></td>
</tr>
</table>
</div></div>
<div class="navigation">
<table cellspacing="2" cellpadding="0" width="100%">
<tr>
<td><a href="sect0047.html" title="Steps"><img alt="Previous: Steps" 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="sect0049.html" title="Colour Maps, Contour Maps and Surface Plots"><img alt="Next: Colour Maps, Contour Maps and Surface Plots" 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>
|