How to plot a graph like this??

1 回表示 (過去 30 日間)
Shahriar Shafin
Shahriar Shafin 2023 年 9 月 13 日
編集済み: dpb 2023 年 9 月 14 日
How do I plot a graph like this ??It seems a scatter plot.There are 200 data points for each energy and time value.

採用された回答

dpb
dpb 2023 年 9 月 13 日
編集済み: dpb 2023 年 9 月 14 日
scatter it is, indeed. From the link, "specify x and y as matrices of equal size. In this case, scatter plots each column of y against the corresponding column of x." and you're done. The legend is in the 'location','northwest' position. The annotation will have to be done with text() but that's straightforward as well; just remember to set hold on to not wipe the plot but add to it.
  2 件のコメント
Shahriar Shafin
Shahriar Shafin 2023 年 9 月 13 日

Thank you.but my inner portion isn't filled like the picture above.I think they have taken more than 200 data.

dpb
dpb 2023 年 9 月 14 日
編集済み: dpb 2023 年 9 月 14 日
The original would have had input x and y arrays each with five (5) columns of x,y pairs to make the five separate scatter segments...or, of course, it could be done with five separate calls and hold on, whereas you had/plotted only one data set--or (the image is too small/indistinct for my old eyes to tell for sure) if there are multiple y columns, there was either only a single x vector or at least the x data range covered the same range instead of different ranges as in the original.
x=randi([-20 20],200,5)+[900 1200:500:2700];
y=0.1*abs(randn(size(x)))+[0.8 1.3:0.1:1.6];
scatter(x,y,10,'filled')
xlim([200 2800])
ylim([0.6 2.2]), yticks([1:0.5:2]), ytickformat('%0.1f')
box on
hAx=gca; hAx.XMinorTick='on'; hAx.YMinorTick='on';
legend(compose('%d J/m^2',[10:10:50].'),'location','northwest','Box','off','NumColumns',2)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDiscrete Data Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by