clear load sortcount %Energy use refers to use of primary energy before transformation to other end-use fuels, which is equal to indigenous production plus imports and stock changes, minus exports and fuels supplied to ships and aircraft engaged in international transport. %Clean energy is noncarbohydrate energy that does not produce carbon dioxide when generated. It includes hydropower and nuclear, geothermal, and solar power, among others. S=shaperead('C:\Users\cd833\Desktop\docs\papers\paper26-percentgreen\old\shdata\ne_50m_admin_0_countries.shp'); conname = S.name_sort; ZR = zeros(180,360); Zmap = zeros(180,360); Z1 = zeros(180,360); poptrendsz = zeros(180,360); peragrz = zeros(180,360); RR = [1 90 -180]; yearxc = 1960:2011; Qtot=Qsum; n=1; for i = 1:241 ix = find(strcmpi(countries, S(i).name_sort)==1); %chile is 41, congo 45 conz = S(i).name_sort; conz2(i) = {S(i).name_sort}; if ~isempty(ix) [Z, R] = vec2mtx(S(i).Y, S(i).X, ZR, RR, 'filled'); Z=flipud(Z); Z(Z==0)=1; Z(Z==2) = 0; Z1 = Z1 + Z; Z2 = Z.*Z1; Z2(Z2>1)=0; Zmap = Zmap + Z2*(JIDcoun(ix)); poptrendsz = poptrendsz + Z2*((pop(ix,54)-pop(ix,44))/pop(ix,44)); if ~isnan(perag(ix)) peragrz = peragrz + Z2*((perag(ix))); else peragrz = peragrz + Z2*(20); end end end x2=([poptrendsz(:,181:end) poptrendsz(:,1:180)]); geoidR = makerefmat('RasterSize', size(x2), 'Latlim', [-90 90], 'Lonlim', [0 360]); h1 = worldmap('world'); % manually delete long lines land = shaperead('landareas.shp', 'UseGeoCoords', true); geoshow([land.Lat],[land.Lon], 'Color', 'black') %geoshow('landareas.shp', 'FaceColor', [0.5 1.0 0.5]); axis off geoshow(flipud(x2), geoidR, 'DisplayType', 'texturemap'); colorbar('location', 'southoutside'); title('Bankrupt Countries ', 'FontSize', 10); hcb = colorbar('horiz'); set(get(hcb,'Xlabel'),'String','mol m-2 yr-1') colormapeditor