Enter in XTickLabel , how to?

2 次查看(过去 30 天)
Hello kity
Hello kity 2012-12-20
I am editting a graph. I was giving names to each bar with xticklabel. But the way it creates isnt looking nice.
set(gca,'XTickLabel',{['bar1' num2str(DATA)]})
this creates below the bar,
bar1 DATA
what i want is
  • bar1
  • DATA (enter in between)
so how to do this?

回答(2 个)

Jan
Jan 2012-12-20
set(gca,'XTickLabel', ['bar1', char(10), num2str(DATA)])
  1 个评论
Hello kity
Hello kity 2012-12-21
char(10) creates a square next to 'bar1'. it doesnt enter...

请先登录,再进行评论。


Hello kity
Hello kity 2012-12-21
char(10) didnt do the job, does anyone else know how you can make matlab use a second line in the x-axis?

类别

Help CenterFile Exchange 中查找有关 Graph and Network Algorithms 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by