Skip to content
Permalink
Browse files
adding the code for the project
  • Loading branch information
ejrfa committed Apr 24, 2020
1 parent d60de76 commit e9ea75dccd34cd21858eaca68e34de790e2e9c40
Showing 1 changed file with 104 additions and 0 deletions.
@@ -0,0 +1,104 @@
if(~isdeployed)
cd(fileparts(which(mfilename)));
end
DataPath = '.\';
AvailableFiles = dir((fullfile(DataPath, '*.csv')));

mapfig = figure;
animated(1,1,1, 25) = 0;



caxis([0 1]);

OpenFileName = "24HR_CBE_01.fig";
fig = openfig(OpenFileName);
lon = double( fig.Children.Children.XData);
lat = double(fig.Children.Children.YData);
close(gcf)



colour_option = questdlg("could you please choose one colour?", "map colour", "Non-Colour Blind", "Blind colour","Non-Colour Blind");
if colour_option == "Colour-Blind"
cmap = ametrine(256);
colormap ametrine;
end





for idx = 1: size(AvailableFiles,1)




ozone = csvread(AvailableFiles(idx).name);


worldmap('Europe');

load coastlines
plotm(coastlat, coastlon)


colorbar


northarrow('latitude',53.270137,'longitude', -15.465583,'linewidth',1.5);


surfm( lat, lon ,ozone, "edgeColor" , "none", ...
"FaceAlpha", 0.5)






Land = shaperead("landareas",'UseGeoCoords', true);


Lakes = shaperead('worldlakes', 'UseGeoCoords', true);
geoshow(Lakes, 'FaceColor', 'blue')

Rivers = shaperead('worldrivers', 'UseGeoCoords', true);
geoshow(Rivers, 'Color', 'blue')

cities = shaperead('worldcities', 'UseGeoCoords', true);
geoshow(cities, 'Marker', '.', 'Color', 'red')




Plots = findobj( gca, "Type", "Axes");
Plots.SortMethod = "depth";

frame = getframe(gcf);







if idx == 1
[animated, cmap] = rgb2ind(frame.cdata, 256, 'nodither');
else
animated(:,:,1,idx) = rgb2ind(frame.cdata, cmap, 'nodither');
end








end

filename = "map.gif";
imwrite(animated, cmap, filename, 'DelayTime', 0.5, ...
'LoopCount', inf);
web(filename)

0 comments on commit e9ea75d

Please sign in to comment.