Plot different features with Graph
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Can i know the way to plot such graph?
Thank you
0 commentaires
Réponses (1)
Gautam
le 28 Août 2024
Hello Selina,
You can make the plot as shown in the reference image you shared by using the “scatter” and “tiledlayout” functions. The function “tiledlayout” lets you plot multiple axes as tiles in a figure window and the “scatter” function makes the scatterplot.
The code below shows a way to make the corresponding plot
t = tiledlayout(2,2);
nexttile;
x = randn(30,1);
y = randn(30,3);
scatter(x,y(:,1),"blue", 'filled');
hold on;
scatter(x,y(:,3),"red");
hold on;
scatter(x,y(:,2),"green", 'filled');
ylabel("Total Number of Impurities")
nexttile;
x = randn(30,1);
y = randn(30,3);
scatter(x,y(:,1),"blue", 'filled');
hold on;
scatter(x,y(:,3),"red");
hold on;
scatter(x,y(:,2),"green", 'filled');
legend({'AA', 'A', 'B'});
nexttile;
x = randn(30,1);
y = randn(30,3);
scatter(x,y(:,1),"blue", 'filled');
hold on;
scatter(x,y(:,3),"red");
hold on;
scatter(x,y(:,2),"green", 'filled');
ylabel("EBN Colour");
xlabel("Curvature");
nexttile;
x = randn(30,1);
y = randn(30,3);
scatter(x,y(:,1),"blue", 'filled');
hold on;
scatter(x,y(:,3),"red");
hold on;
scatter(x,y(:,2),"green", 'filled');
xlabel("Total EBN Area");
You can refer to the following documents for more information on the “scatter” and “tiledlayout” functions:
1. “sactter” : https://www.mathworks.com/help/matlab/ref/scatter.html
2. “tiledlatout” : https://www.mathworks.com/help/matlab/ref/tiledlayout.html
Hope this helps
0 commentaires
Voir également
Catégories
En savoir plus sur Line Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!