toptional hide axes, figure size as argument - polygen - generative drawing of … | |
git clone git://src.adamsgaard.dk/polygen | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 8e8c544294a8b2ec72f4b64641d51f85eb690168 | |
parent e063f3d1e7a93bf03b3d8aba162642bd0f815d68 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Thu, 13 Mar 2014 20:55:34 +0100 | |
optional hide axes, figure size as argument | |
Diffstat: | |
M polygen.py | 8 ++++++-- | |
1 file changed, 6 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/polygen.py b/polygen.py | |
t@@ -14,9 +14,11 @@ class polyplot: | |
def plot_all_to_all(self, line_color='k', line_width=2, | |
image_name='all_to_all', image_format='png', | |
- plot_points=False, points_style='wo'): | |
+ figure_size=(8,8), | |
+ plot_points=False, points_style='wo', | |
+ show_axes=False): | |
self.points = numpy.asarray(self.points) | |
- fig = plt.figure() | |
+ fig = plt.figure(figsize=figure_size) | |
for i in range(self.points.shape[0]): | |
for j in range(self.points.shape[0]): | |
if (i != j): | |
t@@ -26,6 +28,8 @@ class polyplot: | |
if plot_points == True: | |
plt.plot(self.points[:,0], self.points[:,1], points_style) | |
plt.axis('equal') | |
+ if (show_axes == False): | |
+ plt.axis('off') | |
fig.savefig(image_name + '.' + image_format) | |
fig.clf() | |