@@ -41,14 +41,14 @@ def rainbow_text(x, y, strings, colors, ax=None, **kw):
41
41
42
42
# horizontal version
43
43
for s , c in zip (strings , colors ):
44
- text = ax .text (x , y , " " + s + " " , color = c , transform = t , ** kw )
44
+ text = ax .text (x , y , s + " " , color = c , transform = t , ** kw )
45
45
text .draw (canvas .get_renderer ())
46
46
ex = text .get_window_extent ()
47
47
t = transforms .offset_copy (text ._transform , x = ex .width , units = 'dots' )
48
48
49
49
# vertical version
50
50
for s , c in zip (strings , colors ):
51
- text = ax .text (x , y , " " + s + " " , color = c , transform = t ,
51
+ text = ax .text (x , y , s + " " , color = c , transform = t ,
52
52
rotation = 90 , va = 'bottom' , ha = 'center' , ** kw )
53
53
text .draw (canvas .get_renderer ())
54
54
ex = text .get_window_extent ()
@@ -57,6 +57,6 @@ def rainbow_text(x, y, strings, colors, ax=None, **kw):
57
57
58
58
rainbow_text (0 , 0 , "all unicorns poop rainbows ! ! !" .split (),
59
59
['red' , 'cyan' , 'brown' , 'green' , 'blue' , 'purple' , 'black' ],
60
- size = 18 )
60
+ size = 16 )
61
61
62
62
plt .show ()
0 commit comments