How plot data as histograms?

조회 수: 1 (최근 30일)
Nisar Ahmed
Nisar Ahmed 2022년 10월 9일
댓글: the cyclist 2022년 10월 9일
I have following data as:
[numb] = xlsread('NorskPetroleum.xlsx');
Years = numb(:,1);
Oil = numb(:,2);
condensate= numb(:,3);
NGL = numb(:,4);
Gass = numb(:,5);
Sum = numb(:,6);
Each of size is 52 1,
I want to plot my data in the form of histogram as plot(years, other quantiaties) as

채택된 답변

the cyclist
the cyclist 2022년 10월 9일
This is not a histogram. It is a stacked bar chart. Take a look at this documentation to see how to construct this type of chart.
  댓글 수: 2
Nisar Ahmed
Nisar Ahmed 2022년 10월 9일
편집: Nisar Ahmed 2022년 10월 9일
@the cyclist Thanks, I plotted like this. How can I add legends
y = [Oljo Kondensat NGL Gass];
x = Years;
figure, bar(x,y,'stacked'); xlabel('Years');
the cyclist
the cyclist 2022년 10월 9일
If you google the words matlab and legend, the top hit would also certainly be the documentation for the legend function.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Bar Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by