MATLAB : problem with bar graph

1 次查看(过去 30 天)
Hello,
I have a bar graph with 2 different data (each with a different color as you can see on the picture). I would like to move the x-axis so it crosses at y=-100 (for example). So if a data = -40, I would like to have a bar from -100 to -40.
An other question : is it possible to write each value of the x-axis vertically (because with all the values, we can't see anything).
Thank you in advance,
Best regards,

采纳的回答

dpb
dpb 2015-3-12
For the reference, use
hBar=bar(X,Y,'basevalue',-100);
Doesn't move the axes but is probably the effect you're looking for.
Unless it's been introduced since R2012b, there is no 'textangle' property for the tick labels; there have been advances in using the TeX interpreter; you can always try to gussy it up via that option; I've not tried rotation to see if the builtin interpreter knows it or not.
Failing that, you can always use text and label the ticks manually. I'd guess looking at the image you've got so many that you simply don't have room for all of them irregardless of orientation but only trying it out will tell if can make them all fit legibly.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Properties 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by