overlay

Example 1

op1 = struct('show', false, 'markerStroke', 'purple')
op2 = struct('show', false, 'markerStroke', 'orange')
x = 0:0.1:2*pi
s1 = scatter(x,cos(x),op1)
s2 = scatter(x,sin(x),op2)
overlay({s1,s2})

Example 2

o = struct('show', false)
x = 1: 0.1: 10
c1 = area(x, cos(x), o)
c2 = plot(x, sin(x), o)
o.markerFill = 'red'
c3 = scatter(x, 2*cos(x), o)
overlay({c1,c2,c3})

Example 3

op1 = struct('show', false, 'barFill', 'lightgreen','nbins',20)
y = randn(1000,1)
s1 = histogram(y,op1)
x = linspace(min(y),max(y),1000)
op2 = struct('show', false, 'lineStroke', 'red', 'dashArray', '6 3')
s2 = plot(x,1000*0.3/sqrt(2*pi)*exp(-x.^2/2),op2)
overlay({s1, s2})

Example 4

op1 = struct('show', false, 'markerSize', 10, 'markerFill', 'purple', 'xAxisMin', -1)
op2 = struct('show', false, 'markerSize', 22, 'markerFill', 'orange')
x = [1, 5, 2, 1, 4]
x2 = [1 2 3 12 4]
y2 = [2 1 4 2 9]
overlay({scatter(x, op1), scatter(x2, y2, op2)})

Example 5

op1 = struct('show', false, 'areaStroke', 'lightgreen', 'areaOpacity', 0.6)
op2 = struct('show', false)
x = 0:0.1:7
s1 = area(x, sin(x), op1)
s2 = area(x, sin(3*x), op2)
overlay({s2, s1})

Example 6

o = struct('show', false)
x1 = [1 2]; y1 = [1 1]
x2 = [2 2]; y2 = [1 2]
x3 = [2 3]; y3 = [2 2]
s1= plot(x1, y1, o)
s3= plot(x3, y3, o)
o.dashArray = '2 2'
s2 = plot(x2, y2, o)
overlay({s1,s2,s3})

Example 7

op1 = struct('show', false, 'lineStroke', 'red')
op2 = struct('show', false, 'lineStroke', 'orange')
x = 0:0.1:10
y1 = sin(x) + x + rand(1,101)
y2 = sin(x) + 0.5 *x + rand(1, 101)
y3 = sin(x) + 2 *x + rand(1, 101)
s1 = plot(x, y1, op1)
s2 = plot(x, y2, op2)
s3 = plot(x, y3, op3)
overlay({s1,s2,s3})

Example 8

op1 = struct('show', false)
op2 = op1
op2.useSecondaryAxis = true
op2.lineWidth = 1
fr = [35 25 20 10 5 5]
frcum = [35 60 80 90 95 100]
s1 = bar(fr, op1)
s2 = scatter(frcum, op2)
overlay({s1,s2})

Example 9

op1 = struct('show',false)
op2 = struct('show',false,'markerStroke','green')
op3 = struct('show',true,'title','random numbers','titleFont','0.8em arial','titleX',45)
x1 = rand(1,100); y1 = rand(1, 100)
x2 = rand(1,100)+1; y2 = rand(1, 100)
s1 = scatter(x1, y1, op1)
s2 = scatter(x2, y2, op2)
overlay({s1, s2},op3)

Example 10

op2 = struct('markerFill', 'none','markerStroke3d', 'orange','show',false)
op1 = struct('markerFill', 'none','markerStroke3d', 'green','show',false)
z = 10*(1:pi/50:10*pi);
y = z.*sin(z/10);
x = z.*cos(z/10);
s5 = scatter3(x,y,z,op2)
s6 = scatter3(x,y,z/2,op1)
overlay({s5,s6})