Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Help in Developing Graph.

2 ビュー (過去 30 日間)
Ravi Kalra
Ravi Kalra 2020 年 2 月 19 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have a data in tabular form. I want to make a graph as shown in the figure. Please help me.
  1 件のコメント
darova
darova 2020 年 2 月 19 日
Can you attach the data?

回答 (2 件)

Jakob B. Nielsen
Jakob B. Nielsen 2020 年 2 月 19 日
This is case specific, but what you want to do is define the 8 interesting points, and then simply plot them. The text is less straightforward, but the following works.
gen={'S1' 'S2' 'S3' 'S4'};
X=[0 200 200 300 300 550 550 700];
Y=[2500 2500 2800 2800 3000 3000 3400 3400];
plot(X,Y);
hold on
ylim([2000 4000]);
xlabel('Something')
ylabel('Something else')
for i=1:numel(gen)
text((X(2*i-1)+(X(2*i)-X(2*i-1))/2),Y(2*i)-100,gen{i});
end

Steven Lord
Steven Lord 2020 年 2 月 19 日
The cumsum and stairs functions should do what you want to arrange your data and create the plot. xlabel and ylabel will label the axes, and text can put the labels on the plot itself.

Community Treasure Hunt

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

Start Hunting!

Translated by