[GRASS-SVN] r65706 - grass/trunk/raster/r.horizon

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jul 20 06:57:36 PDT 2015


Author: annakrat
Date: 2015-07-20 06:57:36 -0700 (Mon, 20 Jul 2015)
New Revision: 65706

Added:
   grass/trunk/raster/r.horizon/rhorizon_polar_plot.png
Modified:
   grass/trunk/raster/r.horizon/r.horizon.html
Log:
r.horizon: add polar plot example

Modified: grass/trunk/raster/r.horizon/r.horizon.html
===================================================================
--- grass/trunk/raster/r.horizon/r.horizon.html	2015-07-20 13:22:43 UTC (rev 65705)
+++ grass/trunk/raster/r.horizon/r.horizon.html	2015-07-20 13:57:36 UTC (rev 65706)
@@ -170,6 +170,28 @@
 Horizon angles for test point (CCW from East)
 </center>
 
+<p>We can plot horizon in polar coordinates using Matplotlib in Python:
+<div class="code"><pre>
+import numpy as np
+import matplotlib.pyplot as plt
+
+horizon = np.genfromtxt('horizon.csv', delimiter=',')
+horizon = horizon[1:, :]
+
+ax = plt.subplot(111, polar=True)
+bars = ax.plot(horizon[:, 0] / 180 * np.pi,
+               (90 - horizon[:, 1]) / 180 * np.pi)
+# uncomment the 2 following lines when using -c flag
+# ax.set_theta_direction(-1)
+# ax.set_theta_zero_location('N')
+plt.show()
+</pre></div>
+
+<center>
+<img src="rhorizon_polar_plot.png"><br>
+Horizon plot in polar coordinates.
+</center>
+
 <h3>Raster map mode</h3>
 
 Raster map mode (output maps "horangle*" become input for <em>r.sun</em>):

Added: grass/trunk/raster/r.horizon/rhorizon_polar_plot.png
===================================================================
(Binary files differ)


Property changes on: grass/trunk/raster/r.horizon/rhorizon_polar_plot.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream



More information about the grass-commit mailing list