Effacer les filtres
Effacer les filtres

MATLAB : problem with bar graph

1 vue (au cours des 30 derniers jours)
Sarah Guiffray
Sarah Guiffray le 12 Mar 2015
Réponse apportée : dpb le 12 Mar 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,

Réponse acceptée

dpb
dpb le 12 Mar 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.

Plus de réponses (0)

Catégories

En savoir plus sur Graphics Object Properties dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by