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 Center および File ExchangeBar Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by