Distinguish the different curves and identify the points corresponding to each way

I have this figure but it is difficult to distinguish the different curves and identify the points corresponding to each approach. Is there any other way to represent each method?
Thanks in advance

2 件のコメント

Sam Chak
Sam Chak 2025 年 2 月 14 日
Hi @rana, could you provide the data and plot it in MATLAB?
rana
rana 2025 年 2 月 14 日
it's big dataset. Can you please help me with how to represent them in a differnt way so it will be clear?

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

 採用された回答

Another approach, using the stackedplot (introduced in R2018b) function —
T1 = array2table(10*(rand(100,5)+(4:-1:0)), VariableNames=["MACS","Static","Random","RL-Based","DL-Based"])
T1 = 100x5 table
MACS Static Random RL-Based DL-Based ______ ______ ______ ________ ________ 45.87 33.169 26.318 14.936 1.5879 46.375 37.681 29.883 13.997 1.1667 49.351 36.993 29.863 16.13 5.1319 48.95 30.412 25.398 14.294 3.092 47.133 31.487 26.569 14.454 9.5756 46.329 35.209 21.752 11.727 2.6868 42.347 36.462 22.361 19.173 3.2923 43.382 31.707 20.989 17.864 9.5463 44.295 32.014 23.593 18.068 7.918 41.683 32.8 27.471 14.716 3.087 49.056 34.589 29.483 14.623 8.8817 40.568 38.024 23.899 13.012 1.5231 43.661 36.536 25.815 15.613 1.1264 49.711 36.383 22.347 10.501 6.5348 48.582 38.039 20.514 17.983 0.071536 40.37 34.064 21.76 16.704 7.2876
figure
stackedplot(T1)
xlabel("Number of Iterations")
title("Client Selection Across FL Methods")
.

5 件のコメント

Sam Chak
Sam Chak 2025 年 2 月 14 日
Hi @rana, take @Star Strider's approach. More compact to use the stackedplot() function.
rana
rana 2025 年 2 月 15 日
Thanks but unforuntally i'm using matlab basic(Online) and doesn't supporting this function. Is there any alternative way?
Star Strider
Star Strider 2025 年 2 月 15 日
I just now opened MATLAB Online and ran my exact code there successfully.
The stackedplot function is part of core MATLAB and does not require any Toolboxes. However, it allows only what you have a license for, so if you have R2018b or later, you should have the function. (I have R2024b, so it works for me.)
One alterenative (if you have an earlier version that R2018b) is to run it here with your data, and then do a screencap of the resulting plot. Upload your data to a comment to your Question here using the ‘paperclip’ icon, then run my code with it.
.
rana
rana 2025 年 2 月 19 日
it works thank you so much
Star Strider
Star Strider 2025 年 2 月 19 日
As always, my pleasure!

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

その他の回答 (1 件)

I now understand that you are seeking advice on graphically displaying the data. Here is an example of what I consider to be good and bad figures.
y1 = randi([60, 80], 1, 100);
y2 = randi([10, 50], 1, 100);
y3 = randi([15, 55], 1, 100);
y4 = randi([30, 70], 1, 100);
y5 = randi([35, 75], 1, 100);
x = linspace(1, 100);
figure(1)
plot(x, y1, 'r'), hold on
plot(x, y2, 'g'), plot(x, y3, 'b'), plot(x, y4, 'm'), plot(x, y5, 'c'), hold off
title('BAD: Chartjunk')
figure(2)
tL = tiledlayout(5, 1, 'TileSpacing', 'Compact');
nexttile
plot(x, y1, 'r', 'linewidth', 2.5), hold on
plot(x, y2, 'g'), plot(x, y3, 'b'), plot(x, y4, 'm'), plot(x, y5, 'c'), hold off, ylabel('Method 1')
nexttile
plot(x, y2, 'g', 'linewidth', 2.5), hold on
plot(x, y1, 'r'), plot(x, y3, 'b'), plot(x, y4, 'm'), plot(x, y5, 'c'), hold off, ylabel('Method 2')
nexttile
plot(x, y3, 'b', 'linewidth', 2.5), hold on
plot(x, y1, 'r'), plot(x, y2, 'g'), plot(x, y4, 'm'), plot(x, y5, 'c'), hold off, ylabel('Method 3')
nexttile
plot(x, y4, 'm', 'linewidth', 2.5), hold on
plot(x, y1, 'r'), plot(x, y2, 'g'), plot(x, y3, 'b'), plot(x, y5, 'c'), hold off, ylabel('Method 4')
nexttile
plot(x, y5, 'c', 'linewidth', 2.5), hold on
plot(x, y1, 'r'), plot(x, y2, 'g'), plot(x, y3, 'b'), plot(x, y4, 'm'), hold off, ylabel('Method 5')
title(tL, 'BETTER: Split into 5 plots')

2 件のコメント

John D'Errico
John D'Errico 2025 年 2 月 14 日
Nice idea.
rana
rana 2025 年 2 月 14 日
Thanks

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

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

タグ

質問済み:

2025 年 2 月 14 日

コメント済み:

2025 年 2 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by