How can I display a bar chart ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Mallouli Marwa
am 18 Jun. 2019
Kommentiert: Mallouli Marwa
am 20 Jun. 2019
Hi
How can I display a bar chart like the attached one ?
Best regards.
0 Kommentare
Akzeptierte Antwort
Aravind Ravikumar
am 19 Jun. 2019
3 Kommentare
Aravind Ravikumar
am 19 Jun. 2019
x = [3 4;1.5 1.75;0.25 0.3];
bar(x,'hist');
legend('PZT','MFC');
set(gca,'xticklabel',{'20Hz','30Hz','40Hz'});
This code will produce bar graph like the attached image. gca will select the current axes and then you could specify the xticklabel for the bar graph.
Weitere Antworten (1)
the cyclist
am 18 Jun. 2019
3 Kommentare
the cyclist
am 19 Jun. 2019
I suggest you take a look at the MATLAB Plot Gallery, which has examples of lots of plot types, along with the code that produces them. This may save you time asking about everything small addition that you want, one at a time.
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!