Plot different features with Graph

3 vues (au cours des 30 derniers jours)
Selina Loh
Selina Loh le 7 Jan 2018
Réponse apportée : Gautam le 28 Août 2024
Can i know the way to plot such graph?
Thank you

Réponses (1)

Gautam
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:
Hope this helps

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by