File Exchange

image thumbnail

getContourLineCoord​inates

version 1.1.0 (2.93 KB) by Adam Danz
Get a table of contour line coordinates from a contour object.

25 Downloads

Updated 14 May 2020

View Version History

View License

Use the outputs from any of the contour plot functions to produce a table of (x,y) coordinates of the contour lines organized by contour level and group.

[cm, h] = contour(___);
contourTable = getContourLineCoordinates(cm);
--or--
contourTable = getContourLineCoordinates(h);

contourTable =
Level.........Group..........X............Y
____________________________________
-5.8504.........1..........0.44266....-1.75
-5.8504.........1..........0.375........-1.8038
-5.8504.........1..........0.25..........-1.8526
-5.8504.........1..........0.125........-1.8498
etc....

Where Level is the contour level in the LevelList of a contour object, Group is a grouping variable for contour levels, and (X,Y) are coordinates along the contour lines.

Cite As

Adam Danz (2020). getContourLineCoordinates (https://www.mathworks.com/matlabcentral/fileexchange/74010-getcontourlinecoordinates), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (5)

Jochem van Kempen

Tessa Kol

smith lili

It's useful. Thank you!

Zou siyu

Jackson Foley

Just what I needed, thank you!

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

Inspired by: Extract contour data from contour matrix C

Community Treasure Hunt

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

Start Hunting!