Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tick-labels to span over multiple lines

Is it possible to make the x-tick labels span over two lines? Say, if my x-tick labels are

January 2008, February 2008, March 2008

I want them as

January  February  March
  2008     2008    2008

I don't want to rotate them.

like image 811
imsc Avatar asked Jul 11 '12 14:07

imsc


1 Answers

After a quick test using the code I found here, it appears that it does indeed work if you just add a newline in your tick label. e.g.

mytics=['January\n2008', 'February\n2008', 'March\n2008']
like image 103
mgilson Avatar answered Nov 11 '22 17:11

mgilson