@@ -20,7 +20,7 @@ def dl(x,y,len=0,dir=-1,col=128):
2020 else :
2121 print ("invaid direction" )
2222 return x ,y
23-
23+
2424# recursive line drawing
2525def rdl (x ,y ,len = 0 ,dir = - 1 ,col = 128 ):
2626 I [x ,y ,0 ] = col [0 ]
@@ -70,7 +70,7 @@ def rdl(x,y,len=0,dir=-1,col=128):
7070y = x
7171l = 20
7272for i in range (10 ):
73- x ,y = dl (x ,y ,l ,i % 4 ,(255 , 0 ,0 ))
73+ x ,y = dl (x ,y ,l ,i % 4 ,(0 ,0 , 255 ))
7474 l += 5
7575
7676# drawing with recursive function
@@ -80,12 +80,12 @@ def rdl(x,y,len=0,dir=-1,col=128):
8080for i in range (10 ):
8181 x ,y = dl (x ,y ,l ,i % 4 ,(0 ,255 ,0 ))
8282 l += 5
83-
83+
8484
8585# setting the climit is important!
8686plt .imshow (I ,clim = (0 ,255 ))
8787plt .axis ('off' )
88-
88+
8989##while None == plt.waitforbuttonpress(.1):
9090## plt.draw()
9191
@@ -108,10 +108,10 @@ def rdl(x,y,len=0,dir=-1,col=128):
108108v = 200 # default V
109109for r in range (N ):
110110 for c in range (N ):
111- I [r ,c ] = (r ,c ,v )
111+ I [r ,c ] = (r ,c ,v )
112112
113113# convert to RGB
114- I2 = color .hsv2rgb (I )
114+ I2 = color .hsv2rgb (I )
115115
116116# make a scaled RGB image with color resolution RGB:565
117117J = np .empty ((N ,N ,3 ), dtype = np .uint8 )
@@ -134,14 +134,10 @@ def rdl(x,y,len=0,dir=-1,col=128):
134134p2 .imshow (I2 ,clim = (0 ,255 ))
135135p2 .axis ('off' )
136136p2 .set_title ("HSV Colors\n H down, S right\n V = 200" )
137-
137+
138138plt .show ()
139139
140140
141141
142142print ("Done" )
143143plt .close ()
144-
145-
146-
147-
0 commit comments