image thumbnail

DEM: Shaded relief image plot (digital elevation model)

version 2.6.0.0 (13 KB) by François Beauducel
Pretty shaded relief map as flat image.

4.9K Downloads

Updated 20 May 2019

View License

This function plots regular grids of elevation X,Y,Z in a more efficient manner than SURFL Matlab's function, because it recomputes lighting and displays result as shaded color flat RGB image. It uses also median-style filter to deal with min/max values of elevations and gradient, and proposes two specific colormaps "landcolor" and "seacolor".
Color mapping and lighting parameters can be changed from default values. In addition, several options are available: 'cartesian' to add decimal axis, 'latlon' to add geographical axis (GMT-like), 'legend' for an automatic scaling legend, 'lake' for automatic flat area color-filling and 'interp' to fill the novalue gaps...
This may be useful to produce high-quality and moderate-size Postscript image adapted for publication. Also, the output image is not dependant on current figure colormap, thus additional plots with indexed colors can be added (contour, pcolor, ...).
Figure examples:
Moon North Pole using the bone colormap and high contrast lighting (DEM source: raster LRO/LOLA LTVT)
Indonesia archipelago using default colormaps, 'latlon' axis basemap and legend scales (DEM source: raster NOAA/NGDC ETOPO1)

Soufrière of Guadeloupe volcano lava dome: 1-m resolution with NaN values (DEM source: OVSG-IPGP/SCIAC)

See "doc dem" for syntax, examples and help. See also the READHGT function from same author.

Cite As

François Beauducel (2021). DEM: Shaded relief image plot (digital elevation model) (https://www.mathworks.com/matlabcentral/fileexchange/36380-dem-shaded-relief-image-plot-digital-elevation-model), MATLAB Central File Exchange. Retrieved .

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

Inspired: shadem

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!