how can i define legend for bar3

4 vues (au cours des 30 derniers jours)
mohammad
mohammad le 20 Fév 2023
Réponse apportée : Voss le 20 Fév 2023
How can I define the axes name of EVA and [50 70 100] like this figure in bar3?
and how can i change color of them?

Réponses (2)

dpb
dpb le 20 Fév 2023
Z=randi(6000,4,5);
X=["EVA"+[1:4].'; "DNO"];
Y=[125:-25:50];
hB3=bar3(Z);
hAx=gca;
hAx.XAxis.TickLabels=X;
hAx.YAxis.TickLabels=Y;

Voss
Voss le 20 Fév 2023
bar3(randi(6000,[4,5]).*(1:5));
colors = [0 0.2 0.7; 0.8 0 0.1; 0 0.5 0; 0.5 0 0.5; 0 0.4 0.7]/0.8;
colormap(colors)
xticklabels({'EVA1' 'EVA2' 'EVA3' 'EVA4' 'DNO'})
yticklabels([125 100 75 50])
ylabel('Battery degradation cost ($)')
zlabel('Benefit ($)')
set(gca(),'View',[-60 30])
ll = light('Position',[-1 0 0]);

Catégories

En savoir plus sur Triangulation Representation 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