I have a set of geographic data - lat long and height. But the area is restricted enough that I can plot as x y and z without any projection.
I want to plot them in a 3-D plot, with a 2-D image plotted on the XY plane. The 2D image is a geotiff file, so can be used with all the mapping functions.
Any suggestions would be welcomed.
"dormant " <rod.s...@uwiseismic.com> wrote in message <gaetba$hql$1...@fred.mathworks.com>...
What I want to do is something like this (which doesn't work).
---------------------------------------
imfile = 'nasa-e-carib.tif';
[A, R, bbox] = geotiffread( imfile );
mapshow(A, R);
hold on;
plot3( X, Y, Z, ...
'o', ...
'LineStyle', 'none', ...
'MarkerEdgeColor', [.5 .5 .5], ...
'MarkerFaceColor', [ .7 .7 .7], ...
'MarkerSize', 4 );
view(-35,45);
----------------------------------------
even the following doesn't work
----------------------------------------
imfile = 'nasa-e-carib.tif';
[A, R, bbox] = geotiffread( imfile );
mapshow(A, R);
view(-35,45);
----------------------------------------
*snip*
Then don't explain using Handle Graphics. Explain using plain old English
text. Alternately, if you have code that's doing something close to what
you want, indicate what it's doing that's different from what you want.
> ---------------------------------------
> imfile = 'nasa-e-carib.tif';
> [A, R, bbox] = geotiffread( imfile );
> mapshow(A, R);
> hold on;
> plot3( X, Y, Z, ...
Since you're using a map axes, I think you want PLOT3M instead of PLOT3.
*snip*
> even the following doesn't work
>
> ----------------------------------------
> imfile = 'nasa-e-carib.tif';
> [A, R, bbox] = geotiffread( imfile );
> mapshow(A, R);
> view(-35,45);
> ----------------------------------------
Clarify what "doesn't work" means. Does it error? Does it crash MATLAB?
Does it format your hard drive? Does it work but give you a figure that
doesn't look the way you want (and if so, how specifically does it look
different from how you want?)
--
Steve Lord
sl...@mathworks.com
Apologies if I am not clear. I thought I was being clear.
> Since you're using a map axes, I think you want PLOT3M instead of PLOT3.
I am plotting using mapshow which has no projection, so plot3 is the correct thing to use.
The following MATLAB code does not give me what I want. It plots the points using plot3 correctly, but does not plot the image on the Z=0 plane. The resulting plot is exactly the same if the last line is removed.
plot3( X, Y, Z, 'o', ...
'LineStyle', 'none', ...
'MarkerEdgeColor', 'r', ...
'MarkerFaceColor', 'r', ...
'MarkerSize', 3 );
set( gca, 'XLim', [ -72 -54 ], ...
'YLim', [ 9 24 ], ...
'ZLim', [-300 0] );
grid on;
view(-35,45);
hold on;
[A, R, bbox] = geotiffread( imfile );
mapshow( A, R, );
If I replace the last two lines with the following, the resulting plot does show what I want - it draws the coastlines on the Z=0 plane.
load coast;
mapshow( long, lat );
It appears to me that mapshow doesn't like plotting images at an angle - this can be demonstrated by using it on its own, then using the "Rotate 3D" tool in the figure window. the image disappears as soon as the view moves away from the perpendicular.