필터 지우기
필터 지우기

How can I display a bar chart ?

조회 수: 1 (최근 30일)
Mallouli Marwa
Mallouli Marwa 2019년 6월 18일
댓글: Mallouli Marwa 2019년 6월 20일
Hi
How can I display a bar chart like the attached one ?
Best regards.

채택된 답변

Aravind Ravikumar
Aravind Ravikumar 2019년 6월 19일
What you are looking for is 2-D Bar Graph. You can add legends using legend.
  댓글 수: 3
Aravind Ravikumar
Aravind Ravikumar 2019년 6월 19일
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.
Mallouli Marwa
Mallouli Marwa 2019년 6월 19일
Thanks

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

the cyclist
the cyclist 2019년 6월 18일
Use the bar function.
  댓글 수: 3
the cyclist
the cyclist 2019년 6월 19일
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.
Mallouli Marwa
Mallouli Marwa 2019년 6월 20일
Thanks

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by