forked from VUB-HYDR/2018_Vanderkelen_etal_HESS_ab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_plotting.m
165 lines (109 loc) · 4.39 KB
/
main_plotting.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
% ------------------------------------------------------------------------
% Main plotting script.
% this script gives an overview of the different plotting scripts used in
% these papers:
%
% 1. Vanderkelen, I., van Lipzig, N. P. M., and Thiery, W., 2018a. Modelling
% the water balance of Lake Victoria (East Africa) – Part 1: Observational
% analysis, Hydrol. Earth Syst. Sci. Discuss., in review.
%
% 2. Vanderkelen, I., van Lipzig, N. P. M. and Thiery, W., 2018b. Modelling
% the water balance of Lake Victoria (East Africa) – Part 2: Future
% projections, Hydrol. Earth Syst. Sci. Discuss., in review.
% ------------------------------------------------------------------------
%% General plotting settings.
% initialise
axcolor = [0.3 0.3 0.3];
colors = mf_colors;
colors(24:25,:)= rand(2,3);
% define one (leap) year days and month
year_begin = [2016, 1, 1, 0,0,0]; % 2016 is leap year
year_end = [2016,12,31,23,0,0];
year_vec = datevec(datenum(year_begin):1:datenum(year_end));
month_day = year_vec(:,2:3);
% define ticks and ticklabels for one year
months_label = ['Jan';'Feb';'Mar';'Apr';'May';'Jun';'Jul';'Aug';'Sep';'Oct';'Nov';'Dec'];
months = (1:12).';
first_day = ones(length(months),1);
first_daymonth=[months first_day];
[~,ind_firstmonth] = ismember(first_daymonth,month_day,'rows');
mid_day = ones(length(months),1).*15;
mid_daymonth=[months mid_day];
[~,ind_midmonth] = ismember(mid_daymonth,month_day,'rows');
% find the indices of the year array for every day in the whole period
[isday,ind_day] = ismember(date_obs(:,2:3),month_day,'rows');
% define periods
% 1950-2014
temp_allyears = date_all(:,1);
yearlong = time_begin_hist:2:time_end_obs;
[~, year_loc] = ismember(yearlong,temp_allyears);
labels = {'1950','1952','1954','1956','1958','1960','1962','1964','1966','1968',...
'1970', '1972','1974', '1976','1978','1980','1982','1984','1986','1988',...
'1990', '1992','1994','1996','1998','2000', '2002','2004','2006','2008',...
'2010','2012','2014'};
% 1992-2014
temp_obsyears = date_obs(:,1);
years = time_begin_obs:time_end_obs;
[~, year_loc_short] = ismember(years,temp_obsyears);
labels_short = {'1993','1994','1995','1996','1997','1998','1999','2000', ...
'2001','2002','2003','2004','2005','2006','2007','2008','2009','2010',...
'2011','2012','2013','2014'};
% define plotting colors for different terms
E_color = colors(16,:);
P_color = colors(17,:);
Qin_color = [5 137 1]/255;
Qout_color = [192 147 0]/255;
L_color = [95 14 14]/255;
%L_color = [30 30 30]/255;
gray_range = [220 220 220]/255; % gray
gray = [200 200 200]/255;
% rcp 26 color
blue = [16 90 202]/255;
blue_range = [126 155 199]/255;
% rcp 45 color
green = [48, 186, 27]/255;
green_range = [151 229 139]/255;
% rcp 85 color
red = [193 0 0]/255;
red_range = [215 129 129]/255;
% 2006-2100
temp_futyears = date_fut(:,1);
yearfut = time_begin_fut-1:5:time_end_fut+1;
yearfut(1) = time_begin_fut(1);
[~, year_loc_fut] = ismember(yearfut,temp_futyears);
%year_loc_fut(length(yearfut)) = year_loc_fut(length(yearfut)-1) + (year_loc_fut(3)- year_loc_fut(2));
labels_fut = {'2006','2010','2015','2020','2025','2030','2035','2040',...
'2045','2050','2055','2060','2065','2070','2075','2080','2085',...
'2090','2095','2100'};
%% plotting scripts paper 1
% 2. Lake Victoria historical water levels
% plot_lakelevels_hist
% 3. Daily outflow time series
% plot_outflow
% 4. Climatology - observational maps of precip, evap and runoff
% plot_WBterms_maps
% 5. Seasonal cycles of observational WB terms
% plot_WBterms_seas
% 6. land cover, Hydrologic Soil Group and Curve Number
% plot_CN
% 7. Seasonal cycle of all WB terms
% plot_WBterms_seasall
% 8. Time series of accumulated WB terms
% plot_WBterms_cum
% 9. Modelled and observed lake levels
% plot_lakelevel
% 10. seasonal cycle of modelled and observed lake levels
%plot_lakelevel_seas
%% figures paper 2
% 1 CORDEX evaluation precipitation and evaporation maps
% plot_cdxeval
% 3. Histograms of lake precipitation
% plot_histPeval
% 4. Modelled lake levels and seasonal WB terms of CORDEX evaluation
% plot_cdxeval_seas
% 6. Barplots of projected climate change
% plot_barplots_historical
% 8. Lake level projections
% plot_L_total
% 9. outflow projections
% plot_Qout_total