Can you help me 2-D graph as shown.

Can you help me 2-D graph as shown.
Can you help me write a code, for example, draw a graph like a picture or a different picture, but it has features like the red circle in the picture. Because I don't know how to draw that graph. Thank you very much.

 Accepted Answer

Ameer Hamza
Ameer Hamza on 21 Sep 2020
Edited: Ameer Hamza on 21 Sep 2020
Something like this
x1 = linspace(0, 1);
y1 = -2*x1 + 2.5 + rand(size(x1))*0.05;
y1(end) = y1(end-1)-1;
x2 = linspace(0, 0.8);
y2 = -1.5*x2 + 2.2 + rand(size(x2))*0.05;
y2(end) = y2(end-1)-1;
x3 = linspace(0, 0.7);
y3 = -1.2*x3 + 2.7 + rand(size(x3))*0.05;
y3(end) = y3(end-1)-1;
x4 = linspace(0, 0.9);
y4 = -1*x4 + 1.7 + rand(size(x4))*0.05;
y4(end) = y4(end-1)-1;
f = figure();
ax = axes();
hold(ax);
ax.XLim = [0 1.1];
plot(x1, y1, x2, y2, x3, y3, x4, y4);

2 Comments

Thank you very much.
I am glad to be of help!

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D 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!