forked from aipritsker/Winnie-the-Pooh
/
createfigs.m
123 lines (94 loc) · 2.77 KB
/
createfigs.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
function createfigs(YMatrix1, YMatrix2,Y1)
%CREATEFIGURE1(YMATRIX1,YMATRIX2,Y1)
% YMATRIX1: matrix of y data
% YMATRIX2: matrix of y data
% Y1: vector of y data
% % Create figure
% figure(1);
% clf();
% subplot(2,2,1);
% plot(YMatrix1);
% legend('Egg','Larva','Pupa','Nurse Bee','House Bee','Forager');
% ylabel('Number of Bees');
% title({'A Honey Bee Colony Population Dynamics'});
%
% subplot(2,2,2);
% plot(YMatrix2(:,1),'gx-');
% ylabel('Pollen');
%
% subplot(2,2,4)
% plot(YMatrix2(:,2),'bx-');
% ylabel('Honey');
%
% subplot(2,2,3)
% plot(Y1,'k+-');
% ylabel('Number of Eggs');
%CREATEFIGURE1(YMATRIX1,YMATRIX2,Y1)
% YMATRIX1: matrix of y data
% YMATRIX2: matrix of y data
% Y1: vector of y data
% Auto-generated by MATLAB on 05-Jun-2011 14:32:30
% Create figure
figure1 = figure(1); clf;
fontsize=20;
xdata=[0:30:1600];
months1=['Mar';'Apr';'May';'Jun';'Jul';'Aug';'Sep';'Oct';'Nov';'Dec';'Jan';'Feb'];
months=[months1;months1;months1];
% Create axes
axes1 = axes('Parent',figure1,...
'XTickLabel',months,...
'XTick',xdata,...
'Position',[0.13 0.6409 0.8037 0.2891],...
'FontSize',fontsize);
box('on');
hold on;
% Create multiple lines using matrix input to plot
plot1 = plot(YMatrix1);
set(plot1(1),'DisplayName','Egg','Color',[0 0 1]);
set(plot1(2),'DisplayName','Larva','Color',[0 1 0]);
set(plot1(3),'DisplayName','Pupa','Color',[1 0 0]);
set(plot1(4),'DisplayName','Nurse Bee','Color',[1 0 1]);
set(plot1(5),'DisplayName','House Bee','Color',[0 1 1]);
set(plot1(6),'DisplayName','Forager','Color',[0 0 0]);
% Create ylabel
ylabel('Number of Bees');
ylim([0,2.2e4]);
% Create title
title('A Healthy Honey Bee Colony Population Dynamics --four-year-simulation');
% Create legend
legend(axes1,'show');
% Create axes
axes2 = axes('Parent',figure1,...
'XTickLabel',months,...
'XTick',xdata,...
'Position',[0.1294 0.302 0.8056 0.2597],...
'FontSize',fontsize);
box('on');
hold on;
% Create multiple lines using matrix input to plot
plot2 = plot(YMatrix2);
set(plot2(1),'DisplayName','Pollen','Marker','o','LineStyle','none',...
'Color',[0 1 0]);
set(plot2(2),'DisplayName','Honey','Marker','o','LineStyle','none',...
'Color',[0 0 1]);
% Create ylabel
ylabel('Number of Cells');
ylim([0,3e5])
% Create legend
legend(axes2,'show');
% Create axes
axes3 = axes('Parent',figure1,...
'XTickLabel',months,...
'XTick',xdata,...
'Position',[0.1294 0.03867 0.805 0.2081],...
'FontSize',fontsize);
box('on');
%hold('all');
% Create plot for weight
W = (.047*YMatrix1(:, 2)+.158*YMatrix1(:, 3) + .133*(YMatrix1(:, 4)+YMatrix1(:, 5)+YMatrix1(:, 6)) + .23*YMatrix2(:, 1)+ .5*YMatrix2(:, 2))/1000;
plot(W,'Parent',axes3,'Marker','o','Color',[0 0 0]);
% Create ylabel
ylabel('Weight (kg) - no equip');
print -depsc figures/output.eps
close()
end