tbetter line color control - polygen - generative drawing of polygonal patterns
 (HTM) git clone git://src.adamsgaard.dk/polygen
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit a77f286052906c75effedcc28fc68873164d26c9
 (DIR) parent f51f9c0287d3176bb8fa818db4035b3ddf41413c
 (HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
       Date:   Thu, 13 Mar 2014 21:43:12 +0100
       
       better line color control
       
       Diffstat:
         M octahedron.py                       |       3 ++-
         M polygen.py                          |       6 ++++--
       
       2 files changed, 6 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git a/octahedron.py b/octahedron.py
       t@@ -4,5 +4,6 @@ import polygen
        octahedron = polygen.regular_star_polygon(8)
        p = polygen.polyplot()
        p.set_points(octahedron.points)
       -p.plot_all_to_all(line_width=4, exceptions=[[0,4], [1,5], [2,6], [3,7]])
       +p.plot_all_to_all(line_width=4, line_color='white',
       +        exceptions=[[0,4], [1,5], [2,6], [3,7]])
        p.save_plot(background_color='#666666', transparent_background=False)
 (DIR) diff --git a/polygen.py b/polygen.py
       t@@ -12,7 +12,8 @@ class polyplot:
            def set_points(self, points):
                self.points = points
        
       -    def plot_all_to_all(self, line_color='k', line_width=2,
       +    def plot_all_to_all(self, line_color='black', line_width=2,
       +            line_style='solid',
                    figure_size=(8,8),
                    plot_points=False, points_style='wo',
                    show_axes=False, exceptions=[]):
       t@@ -25,7 +26,8 @@ class polyplot:
                                ([j,i] in exceptions) == False):
                            plt.plot([self.points[i,0], self.points[j,0]],
                                    [self.points[i,1], self.points[j,1]],
       -                            line_color + '-', lw=line_width)
       +                            color=line_color, linestyle=line_style,
       +                            linewidth=line_width)
                if plot_points == True:
                    plt.plot(self.points[:,0], self.points[:,1], points_style)
                plt.axis('equal')