Plot different features with Graph
3 views (last 30 days)
Show older comments
Can i know the way to plot such graph?
Thank you
0 Comments
Answers (1)
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:
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 Comments
See Also
Categories
Find more on Line Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!