Distinguish the different curves and identify the points corresponding to each way
2 ビュー (過去 30 日間)
古いコメントを表示

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
採用された回答
Star Strider
2025 年 2 月 14 日
T1 = array2table(10*(rand(100,5)+(4:-1:0)), VariableNames=["MACS","Static","Random","RL-Based","DL-Based"])
figure
stackedplot(T1)
xlabel("Number of Iterations")
title("Client Selection Across FL Methods")
.
5 件のコメント
その他の回答 (1 件)
Sam Chak
2025 年 2 月 14 日
Hi @rana
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')
参考
カテゴリ
Help Center および File Exchange で Graphics Object Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!