Distinguish the different curves and identify the points corresponding to each way
3 次查看(过去 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")
.
更多回答(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 中查找有关 Design, Analysis, Benchmarking, and Verification 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


