m******w 发帖数: 8 | 1 我画的一个图里的X轴上每个值是一组字符串
比如: y=f(x)
x y
"aaaa" 10
"bbbb" 11
"cccc" 13
...
问题是x一共有13个值,所以在图里搁不下这13个字符串. 我想问一下如何将这些字
符串旋转45度, 这样就不用担心互相覆盖了 | f*****r 发帖数: 229 | 2 In matlab, a text has a property "Rotation(angle)". Just get the text's
handle, then reset its rotation.
【在 m******w 的大作中提到】 : 我画的一个图里的X轴上每个值是一组字符串 : 比如: y=f(x) : x y : "aaaa" 10 : "bbbb" 11 : "cccc" 13 : ... : 问题是x一共有13个值,所以在图里搁不下这13个字符串. 我想问一下如何将这些字 : 符串旋转45度, 这样就不用担心互相覆盖了
| m******w 发帖数: 8 | 3 hi,
thanks. I have following matlab code. How to add another line of sta
tement to do the rotation for the x-axis? Just tried google and found n
othing helpful. thanks.
xlabel('Benchmarks','FontSize',18)
ylabel('Performance Increase (%)','FontSize',18)
set(gca,'XTickLabel',{'bzip2', 'crafty', 'gap', 'gcc', 'gzip', 'mcf', 'p
arser', 'perlbmk', 'twolf', 'vortex', 'vpr'})
【在 f*****r 的大作中提到】 : In matlab, a text has a property "Rotation(angle)". Just get the text's : handle, then reset its rotation.
| b*****y 发帖数: 178 | 4 I had the same problem before.In matlab, you can use text function(see help),
to put the text in the right place. But it is no the XTicklable, just the text
in the figure. If you want your xlable rotate by 45 , you'd better do it in
Excel. Excel can do it very easy.
【在 m******w 的大作中提到】 : hi, : thanks. I have following matlab code. How to add another line of sta : tement to do the rotation for the x-axis? Just tried google and found n : othing helpful. thanks. : xlabel('Benchmarks','FontSize',18) : ylabel('Performance Increase (%)','FontSize',18) : set(gca,'XTickLabel',{'bzip2', 'crafty', 'gap', 'gcc', 'gzip', 'mcf', 'p : arser', 'perlbmk', 'twolf', 'vortex', 'vpr'})
| f*****r 发帖数: 229 | 5 In fact, matlab can do many very low level plot manipulations. In matlab, each
stuff is an object. I guess that you can get the object handle of each text
even that it is a XTicklabel. A good exercise to understand this structure is
to draw a plot in matlab, then try to find the object handle for every object.
help),
text
字
【在 b*****y 的大作中提到】 : I had the same problem before.In matlab, you can use text function(see help), : to put the text in the right place. But it is no the XTicklable, just the text : in the figure. If you want your xlable rotate by 45 , you'd better do it in : Excel. Excel can do it very easy.
|
|