imsc
imsc

Reputation: 7840

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.

Upvotes: 11

Views: 6736

Answers (1)

mgilson
mgilson

Reputation: 310117

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']

Upvotes: 12

Related Questions