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

2 views (last 30 days)
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

Accepted Answer

Star Strider
Star Strider on 14 Feb 2025
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 Comments

Sign in to comment.

More Answers (1)

Sam Chak
Sam Chak on 14 Feb 2025
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')

Categories

Find more on Graphics Object Programming in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!