h1a = plot(1:5,(1:5).^2, '.-', 'LineWidth',20, 'DisplayName',' 0.5');
clf
p = patch([0 1 0.5],[0 0 1],1,'linewidth',10);
pause(0.01)
p.Edge.LineJoin = 'round';
axis off
n = 10;
A = delsq(numgrid('L',n+2));
G = graph(A,'OmitSelfLoops')
G = 
  graph with properties:

    Edges: [130×2 table]
    Nodes: [75×0 table]
plot(G,'linewidth',10)
clf
x = [0 1 2 3 4];
y = [0 1 0 1 0];

alpha = 0.025;
x = repelem(x,1,2)
x(1) = []; x(end)=[];
xx = x;
%x = x+0.01*rand(size(x));
x(2:2:end-1) = (1-alpha)*xx(2:2:end-1) + alpha*xx(1:2:end-2)
x(3:2:end-1) = (1-alpha)*xx(3:2:end-1) + alpha*xx(4:2:end)


y = repelem(y,1,2)
y(1) = []; y(end)=[];
yy = y;
y(2:2:end-1) = (1-alpha)*yy(2:2:end-1) + alpha*yy(1:2:end-2)
y(3:2:end-1) = (1-alpha)*yy(3:2:end-1) + alpha*yy(4:2:end)


cdata = uint8(50*[[0 5 2 3];[5 1 2 5];[0 1 5 3];[0 1 2 3]]);

cdata = repelem(cdata,1,2)

l = line(x,y,'linewidth',10)

pause(0.1)
e = l.Edge;


set(e,'ColorData',cdata,'Colorbinding','interpolated')
x =
     0     0     1     1     2     2     3     3     4     4
x =
  Columns 1 through 7
         0    0.9750    1.0000    1.9750    2.0000    2.9750    3.0000
  Column 8
    4.0000
x =
  Columns 1 through 7
         0    0.9750    1.0250    1.9750    2.0250    2.9750    3.0250
  Column 8
    4.0000
y =
     0     0     1     1     0     0     1     1     0     0
y =
  Columns 1 through 7
         0    0.9750    1.0000    0.0250         0    0.9750    1.0000
  Column 8
         0
y =
  Columns 1 through 7
         0    0.9750    0.9750    0.0250    0.0250    0.9750    0.9750
  Column 8
         0
cdata =
  4×8 uint8 matrix
     0     0   250   250   100   100   150   150
   250   250    50    50   100   100   250   250
     0     0    50    50   250   250   150   150
     0     0    50    50   100   100   150   150
l = 
  Line with properties:

              Color: [0 0.4470 0.7410]
          LineStyle: '-'
          LineWidth: 10
             Marker: 'none'
         MarkerSize: 6
    MarkerFaceColor: 'none'
              XData: [0 0.9750 1.0250 1.9750 2.0250 2.9750 3.0250 4]
              YData: [0 0.9750 0.9750 0.0250 0.0250 0.9750 0.9750 0]
              ZData: [1×0 double]

  Use GET to show all properties
clf

alpha = 0.025;

x = [0 1 2 3 4 NaN 1 2 1 1];
y = [0 1 0 1 0 NaN 3 4 4 3];
c = [1 2 3 4 3 1 2];

x = repelem(x,1,2)
x(1) = []; x(end)=[];
xx = x;
x(2:2:end-1) = (1-alpha)*xx(2:2:end-1) + alpha*xx(1:2:end-2)
x(3:2:end-1) = (1-alpha)*xx(3:2:end-1) + alpha*xx(4:2:end)

y = repelem(y,1,2)
y(1) = []; y(end)=[];
yy = y;
y(2:2:end-1) = (1-alpha)*yy(2:2:end-1) + alpha*yy(1:2:end-2)
y(3:2:end-1) = (1-alpha)*yy(3:2:end-1) + alpha*yy(4:2:end)


c = repelem(c,1,2);
cdata = nan(size(y));
cdata(~isnan(y)) = c;

p = patch([x,nan],[y,nan],[cdata,nan],'linewidth',10,'facecolor','none')

pause(0.1)
p.EdgeColor = 'interp'
e = p.Edge;
e.LineJoin = 'round';

p.CData
x =
  Columns 1 through 13
     0     0     1     1     2     2     3     3     4     4   NaN   NaN     1
  Columns 14 through 20
     1     2     2     1     1     1     1
x =
  Columns 1 through 7
         0    0.9750    1.0000    1.9750    2.0000    2.9750    3.0000
  Columns 8 through 14
    3.9750    4.0000       NaN       NaN       NaN    1.0000    1.9750
  Columns 15 through 18
    2.0000    1.0250    1.0000    1.0000
x =
  Columns 1 through 7
         0    0.9750    1.0250    1.9750    2.0250    2.9750    3.0250
  Columns 8 through 14
    3.9750       NaN       NaN       NaN       NaN    1.0250    1.9750
  Columns 15 through 18
    1.9750    1.0250    1.0000    1.0000
y =
  Columns 1 through 13
     0     0     1     1     0     0     1     1     0     0   NaN   NaN     3
  Columns 14 through 20
     3     4     4     4     4     3     3
y =
  Columns 1 through 7
         0    0.9750    1.0000    0.0250         0    0.9750    1.0000
  Columns 8 through 14
    0.0250         0       NaN       NaN       NaN    3.0000    3.9750
  Columns 15 through 18
    4.0000    4.0000    4.0000    3.0000
y =
  Columns 1 through 7
         0    0.9750    0.9750    0.0250    0.0250    0.9750    0.9750
  Columns 8 through 14
    0.0250       NaN       NaN       NaN       NaN    3.0250    3.9750
  Columns 15 through 18
    4.0000    4.0000    3.9750    3.0000
p = 
  Patch with properties:

    FaceColor: 'none'
    FaceAlpha: 1
    EdgeColor: [0 0 0]
    LineStyle: '-'
        Faces: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19]
     Vertices: [19×2 double]

  Use GET to show all properties
p = 
  Patch with properties:

    FaceColor: 'none'
    FaceAlpha: 1
    EdgeColor: 'interp'
    LineStyle: '-'
        Faces: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19]
     Vertices: [19×2 double]

  Use GET to show all properties
ans =
     1
     1
     2
     2
     3
     3
     4
     4
   NaN
   NaN
   NaN
   NaN
     3
     3
     1
     1
     2
     2
   NaN
clf
p = patch([0 1 2 3 4 NaN],0.1*[-1 1 -1 1 0 NaN],'r','linewidth',20)

pause(0.1)
p.FaceColor = 'none';
e = p.Edge;
e.LineJoin = 'round';

axis equal
p = 
  Patch with properties:

    FaceColor: [1 0 0]
    FaceAlpha: 1
    EdgeColor: [0 0 0]
    LineStyle: '-'
        Faces: [1 2 3 4 5 6]
     Vertices: [6×2 double]

  Use GET to show all properties
p.CData = [1 2 3 4 5 6]
p.EdgeColor = 'flat'
e.LineCap = 'none'
p = 
  Patch with properties:

    FaceColor: 'none'
    FaceAlpha: 1
    EdgeColor: [0 0 0]
    LineStyle: '-'
        Faces: [1 2 3 4 5 6]
     Vertices: [6×2 double]

  Use GET to show all properties
p = 
  Patch with properties:

    FaceColor: 'none'
    FaceAlpha: 1
    EdgeColor: 'flat'
    LineStyle: '-'
        Faces: [1 2 3 4 5 6]
     Vertices: [6×2 double]

  Use GET to show all properties
e = 
    LineStrip
e.NormalBinding = 'interpolated'
e.WideLineRenderingHint = 'software'
e = 
    LineStrip
e = 
    LineStrip