Plot .grd file
Show older comments
Hi there, I am relatively new to matlab and am using it for a very important project. I am hoping to use a .grd file to plot a topographic map of a major fault in Turkey and some data (my results) over it. However, I am really struggling to plot the .grd file in Matlab - I have tried grdinfo2 and grdread2 but i keep getting errors.
I have tried youtube and looking on here for relevant documentation but can't get anything to work. If anyone would be so kind as to help/ advise it would be very much appreciated.
Many thanks
5 Comments
Walter Roberson
on 24 Feb 2019
I had no difficulty using grdread2() with that file.
P_L
on 25 Feb 2019
Walter Roberson
on 25 Feb 2019
I used
[X, Y, Z] = grdread2('FileNameWasHere.grd');
surf(X, Y, Z, 'edgecolor', 'none');
You could
[X, Y, Z] = grdread2('FileNameWasHere.grd');
h = pcolor(X, Y, Z);
h.EdgeColor = 'none';
When you have a high enough density of data in an axes, then the black edge between cells can end up turning the whole graph black, because it is fixed width but the cell sizes gets smaller to fit in the axes.
Walter Roberson
on 28 Feb 2019
shadem() would be for the Mapping Toolbox; some of the routines you are using such as plot() are not appropriate if you are working with a mapping axes. If you are using a mapping axes then you should use surfm() instead of pcolor(), and plotm() instead of plot()
Accepted Answer
More Answers (0)
Categories
Find more on Mapping Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!