Code covered by the BSD License  

Highlights from
Google Earth Toolbox

image thumbnail
from Google Earth Toolbox by scott lee davis
Various plotting/drawing functions that can be saved as KML output, and loaded in Google Earth

demo_ge_contourf()
function demo_ge_contourf()

[X,Y] = meshgrid(1:20,1:20);

Z = peaks(20);
cMapStr = 'jet';

cLimLow =  ceil(min(Z(:)));
cLimHigh = floor(max(Z(:)));

numLevels = 10;

if uimatlab
    figure
    subplot(1,2,1)
    imagesc(X(1,:),Y(:,1),Z,[cLimLow,cLimHigh])
    set(gca,'Ydir','normal')
    axis image
    colorbar
    subplot(1,2,2)
    [C,h] = contourf(X,Y,Z,linspace(cLimLow,cLimHigh,numLevels+1));
    colorbar
    axis image
    colormap(cMapStr)
end


kmlStr = ge_contourf(X,flipud(Y),flipud(Z),...
                'colorMap',cMapStr,...
              'numClasses',numLevels,...
               'polyAlpha','FF',...
               'lineColor','404040',...
                'altitude',1e4,...
               'altitudeMode','clampToGround',...
               'cLimHigh',cLimHigh,...
               'cLimLow',cLimLow);
             
kmlStr = [kmlStr,ge_colorbar(0,10,0,...
                    'cBarBorderWidth',1,...
                      'cBarFormatStr','%+7.2f',...
                         'numClasses',numLevels,...
                           'cLimLow',cLimLow,...
                           'cLimHigh',cLimHigh,...
                               'name','click the icon to see the colorbar',...
                           'colorMap',cMapStr)];

                
ge_output('demo_ge_contourf.kml',kmlStr);

Contact us