Plot different features with Graph

3 views (last 30 days)
Selina Loh
Selina Loh on 7 Jan 2018
Answered: Gautam on 28 Aug 2024
Can i know the way to plot such graph?
Thank you

Answers (1)

Gautam
Gautam on 28 Aug 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

Categories

Find more on Line Plots 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!