How can I change bar graph x-axis?
Ältere Kommentare anzeigen
Hello, I want to order my bar graph (left hand side) in descending order but didn't succeed in ordering x-axis labels (right hand side). Values in x-axis are feature indices. How can I fix it? Thanks for the help.
[a,b] = sort(Scores_Avg,2,'descend')
bar(Scores_Avg(b))
text(1:length(a), a', num2str(a','%0.3f'),...
'HorizontalAlignment','center','VerticalAlignment','bottom');
set(gca,'XTick',b);

Akzeptierte Antwort
Weitere Antworten (1)
Henry Barth
am 11 Aug. 2021
set(gca,'XtickLabels',arrayfun(@num2str,b,'UniformOutput',false));
3 Kommentare
MB
am 11 Aug. 2021
Henry Barth
am 11 Aug. 2021
what exactly is not working?
MB
am 12 Aug. 2021
Kategorien
Mehr zu Line Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

