Filter löschen
Filter löschen

MATLAB : problem with bar graph

1 Ansicht (letzte 30 Tage)
Sarah Guiffray
Sarah Guiffray am 12 Mär. 2015
Beantwortet: dpb am 12 Mär. 2015
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,

Akzeptierte Antwort

dpb
dpb am 12 Mär. 2015
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.

Weitere Antworten (0)

Kategorien

Mehr zu Graphics Object Properties finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by