File Exchange

image thumbnail


version (54 KB) by

If you know plot, try GEplot. GEplot uses the same syntax as plot, but draws over Google Earth maps.



View License

Creates a file in kmz format that can be opened into Google Earth.
GEplot uses the same syntax as the traditional plot function but requires Latitude and Longitude (WGS84) instead of x and y.
Colors supported: blue, green, red, cyan, magenta, yellow, black, white.
Symbols supported: point, circle, x-mark, plus, star, square, diamond, filled square, filled diamond,filled circle.
Each plot appears as a separate folder within GE; within the folder line and marks are separated in two layer. Hence it is very easy to show/hide different plots.

If you need to convert from UTM to Lat/Lon you may use utm2deg.m, also available at Matlab Central.
If you want to add Labels and Descriptions to your point, use GEplotLabelsDesc.m, also available at Matlab Central

Comments and Ratings (10)

Rod Bryant

I am relatively green with Matlab and very green with kml. This seems just what the doctor ordered but I have a problem similar to Tomas Frank:
??? Error using ==> iofun\private\getArchiveEntries
File "GEimages/circle_r.png" does not exist.
Where can I find the symbol files? Can anyone help? Thanks.

Amazing code for plotting, Very Thanks Rafael, you safe my life!
I see your tutorials too an there are just terrific. Thank you for sharing your knowledge!!!

Enrique Vargas

R. LeFande

??? Undefined function or method 'GEplot' for input arguments of type 'char'.

What am I missing? Thanx.

tarun luthra

i am trying to run this tool but it gives me this errorfp=fopen(strcat(filename,'.kml'),'w');
if (fp==-1)
message=sprint('Unable to open file %s.kml',filename);

can you tell me whats wrong with i have got my lat and lon in decimal format is that good enough it doesnt create the .kml file and if it does where is it gonna store it

Eric Gayer

Thanks for this simple and so usefull code. Thanks also for adding Labels. Now I can plot my sample site, with their name on GE... Thanks again ! This is gonna be really usefull for the geosciences community.

Andrew Robertson

This is the simplest way to draw my vectors of coordinates in Google Earth.

nima moshtagh

Great job! it works very nicely. I recommend adding the capability of plotting multiple trajectories at once. So the 'Lat' and 'Lon' would be matrices rather than vectors. (similar to the Matlab's plot() function) I did it myself and it worked perfectly.

Rafael Palacios

The problem found by Tomas Frank has been corrected in the currently available version.
GEplot is easy to learn because it uses the same syntax as plot. If you need to draw other kind of objects, you may consider using Matlab2GoogleEarth toolbox, also available at Matlab Central.

Tomas Frank

Idea is great! Google Earth in Matlab! But it took me 10 min of my time to fail to overcome the elementary error (after I installed software and set the path).

>> GEplot('my_track',Lat,Lon);
??? Error using ==> iofun\private\getArchiveEntries
File "GEimages/none_b.png" does not exist.

Error in ==> GEplot at 217
zip(filename,{strcat(filename,'.kml'), iconfilename});

Note: I set Lat and Lon to actual vectors.

Maybe it make sence to check first if what you submit actually works.

But, again, the idea is great!


% Version 1.2: Added support for multiple lines. Fixed nargchk warning.
% Fixed error in movifile for Matlab version 2017b. Fixed a path error
% for symbol files: folder GEimages

Apparently, similar plotting functions are located in Graphics category.

Correct an error while ploting graphs with lines but without symbols. Now it works just with lines, just with symbols or lines and symbols.

Fixed an error (found by Tomas Frank) related to plotting graphs without symbols (just lines).

MATLAB Release Compatibility
Created with R14SP3
Compatible with any release
Platform Compatibility
Windows macOS Linux

MATLAB Online Live Editor Challenge

Win cash prizes and have your live script featured on our website

Learn more

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video