diff --git a/FigDataExtract.m b/FigDataExtract.m new file mode 100644 index 0000000..c9fc6da --- /dev/null +++ b/FigDataExtract.m @@ -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) \ No newline at end of file