Draw curve between two points

857 views Asked by At

I would like to know how people draw the graphs like below. I have multiple location points. I need to connect two locations by a curve. (Not by line) Any idea how to achieve this? In MATLAB I did not find any in-built function.

enter image description here

1

There are 1 answers

1
gregswiss On

With the latest version of MATLAB (R2015b) you can use the new 'graph and network' facilities. It offers different kind of layouts maybe you will find some of them appropriate for your problem.

s = [1 1 1 2 2 3 3 4 5 5 6 7];
t = [2 4 5 3 6 4 7 8 6 8 7 8];
G = graph(s,t);
h = plot(G,'Layout','layered');

enter image description here