@@ -41,14 +41,14 @@ def rainbow_text(x, y, strings, colors, ax=None, **kw):
4141
4242 # horizontal version
4343 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 )
4545 text .draw (canvas .get_renderer ())
4646 ex = text .get_window_extent ()
4747 t = transforms .offset_copy (text ._transform , x = ex .width , units = 'dots' )
4848
4949 # vertical version
5050 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 ,
5252 rotation = 90 , va = 'bottom' , ha = 'center' , ** kw )
5353 text .draw (canvas .get_renderer ())
5454 ex = text .get_window_extent ()
@@ -57,6 +57,6 @@ def rainbow_text(x, y, strings, colors, ax=None, **kw):
5757
5858rainbow_text (0 , 0 , "all unicorns poop rainbows ! ! !" .split (),
5959 ['red' , 'cyan' , 'brown' , 'green' , 'blue' , 'purple' , 'black' ],
60- size = 18 )
60+ size = 16 )
6161
6262plt .show ()
0 commit comments