-
Notifications
You must be signed in to change notification settings - Fork 0
/
cdcPlotDataUncertainty.m
73 lines (69 loc) · 1.87 KB
/
cdcPlotDataUncertainty.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<<<<<<< HEAD
function f=cdcPlotDataUncertainty(y)%,mu,sig)
mu=[393.0256 999.3054 702.6867 406.0680 177.1958];
sig=[129.6984 329.7708 231.8866 134.0024 58.4746];
nbar=5;
xdata=3:36;
xcut=16;
ly=size(y,1);
murep=repmat(mu,ly,1);
sigrep=repmat(sig,ly,1);
ymu=y.*mu;
yminus=y.*(murep-sigrep);
yplus=y.*(murep+sigrep);
fs=12; lw=1;
cmap=lines(nbar);
figure
hold on
for i=1:nbar
cmapi=cmap(i,:);
plot(xdata+xcut,ymu(xdata,i),'-','linewidth',2,'color',cmapi)
plot(xdata+xcut,yminus(xdata,i),'-','linewidth',lw,'color',cmapi)
plot(xdata+xcut,yplus(xdata,i),'-','linewidth',lw,'color',cmapi)
end
xlabel('Time (weeks)')
ylabel('Incidence')
set(gca,'fontsize',fs)
axis([xdata(1)+xcut,xdata(end)+xcut,0,max(max(yplus))])
grid on
grid minor
box on
=======
function f=cdcPlotDataUncertainty(y)%,mu,sig)
mu=[393.0256 999.3054 702.6867 406.0680 177.1958];
sig=[129.6984 329.7708 231.8866 134.0024 58.4746];
nbar=5;
xdata=3:36;
xcut=0;%16;
ly=size(y,1);
murep=repmat(mu,ly,1);
sigrep=repmat(sig,ly,1);
y2=y.*murep;
y1=y.*(murep-sigrep);
y3=y.*(murep+sigrep);
fs=12; lw=1;
cmap=lines(nbar);
figure
maxy=max(max(y3));
tvec=xdata;%+xcut
tvec2= [tvec,fliplr(tvec)];
hold on
for i=1:nbar
cmapi=cmap(i,:);
inBetween=[y1(xdata,i);flipud(y3(xdata,i))];
fill(tvec2,inBetween,cmapi,'facealpha',.2);
plot(tvec,y1(xdata,i),'-','linewidth',1,'color',cmapi);
plot(tvec,y3(xdata,i),'-','linewidth',1,'color',cmapi);
plot(tvec,y2(xdata,i),'-','linewidth',2,'color',cmapi)
%plot(xdata+xcut,yminus(xdata,i),'-','linewidth',lw,'color',cmapi)
%plot(xdata+xcut,yplus(xdata,i),'-','linewidth',lw,'color',cmapi)
end
xlabel('Time (weeks)')
ylabel('Incidence')
set(gca,'fontsize',fs)
%axis([xdata(1)+xcut,xdata(end)+xcut,0,max(max(y3))])
axis([xdata(1),xdata(end),0,maxy])
grid on
grid minor
box on
>>>>>>> 7109d6dbccee4bd48cd4f166634736f1a390a7be