Introduction
Introduction Statistics Contact Development Disclaimer Help
tAdded heptagon example - polygen - generative drawing of polygonal patterns
git clone git://src.adamsgaard.dk/polygen
Log
Files
Refs
LICENSE
---
commit 9e73797f4d2c77720bc8e663f0358c4a29b4b8eb
parent 46442c18b7746cda50d38db5bf5813645b128764
Author: Anders Damsgaard <[email protected]>
Date: Fri, 14 Mar 2014 13:20:01 +0100
Added heptagon example
Diffstat:
M README.rst | 11 ++++++++++-
A heptagon.png | 0
A heptagon.py | 52 +++++++++++++++++++++++++++++…
3 files changed, 62 insertions(+), 1 deletion(-)
---
diff --git a/README.rst b/README.rst
t@@ -11,7 +11,8 @@ Written by Anders Damsgaard, https://github.com/anders-dc/po…
Examples
--------
-``python decagon.py``
+``python decagon.py``.
+A simple regular star polygon with 10 corners, plotted with all-to-all edges.
.. image:: decagon.png
:scale: 60%
t@@ -26,3 +27,11 @@ Inspired by a polygon in the music video for Volto! - Tocin…
:scale: 60%
:alt: Octahedron with filled circle. Opposite corners are not connected.
:align: center
+
+``python heptagon.py``.
+Multiple superimposed regular star polygons.
+
+.. image:: heptagon.png
+ :scale: 60%
+ :alt: Multiple superimposed regular star polygons.
+ :align: center
diff --git a/heptagon.png b/heptagon.png
Binary files differ.
diff --git a/heptagon.py b/heptagon.py
t@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+import polygen
+import matplotlib.pyplot as plt
+
+# Colors from the 'solarized' color scheme
+
+# Generate regular polygon with eight corners (heptagon)
+heptagon = polygen.regular_star_polygon(7)
+
+# Create the polygon plotting object
+p = polygen.polyplot()
+
+# Pass the heptagon points to the plot object
+p.set_points(heptagon.points)
+
+# Plot heptagon, do not draw lines to opposite points. Use custom colors.
+p.plot_all_to_all(line_width=2, line_color='#b58900',
+ exceptions=[[0,1], [1,2], [2,3], [3,4], [4,5], [5,6], [6,0]])
+
+# Add another smaller heptagon
+heptagon_small = polygen.regular_star_polygon(7, 0.7)
+
+# Pass the heptagon points to the plot object
+p.set_points(heptagon_small.points)
+
+# Plot heptagon, do not draw lines to opposite points. Use custom colors.
+p.plot_all_to_all(line_width=2, line_color='#dc322f',
+ exceptions=[[0,1], [1,2], [2,3], [3,4], [4,5], [5,6], [6,0]])
+
+# Add yet another even smaller heptagon
+heptagon_smaller = polygen.regular_star_polygon(7, 0.5)
+
+# Pass the heptagon points to the plot object
+p.set_points(heptagon_smaller.points)
+
+# Plot heptagon, do not draw lines to opposite points. Use custom colors.
+p.plot_all_to_all(line_width=2, line_color='#859900',
+ exceptions=[[0,1], [1,2], [2,3], [3,4], [4,5], [5,6], [6,0]])
+
+# Add yet another even smaller heptagon
+heptagon_smallest = polygen.regular_star_polygon(7, 0.3)
+
+# Pass the heptagon points to the plot object
+p.set_points(heptagon_smallest.points)
+
+# Plot heptagon, do not draw lines to opposite points. Use custom colors.
+p.plot_all_to_all(line_width=2, line_color='#268bd2',
+ exceptions=[[0,1], [1,2], [2,3], [3,4], [4,5], [5,6], [6,0]])
+
+# Save figure as file
+p.save_plot('heptagon', background_color='#002b36',
+ transparent_background=False)
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.