From: Dursun on
I have four vectors: Lat, Long, Height, and intensity of weather. Each of these vectors are 1766581x1. I would like to create a 3D plot of all this data where the intensity of the weather is assigned a specific color based on the the weather intensity vector. Does anybody know of any plotting methods for this? I would like to use contourf but it keeps telling me that the Z paramater must be a matrix. How and why would I convert my height vector into a matrix?
From: Walter Roberson on
Dursun wrote:
> I have four vectors: Lat, Long, Height, and intensity of weather. Each
> of these vectors are 1766581x1. I would like to create a 3D plot of all
> this data where the intensity of the weather is assigned a specific
> color based on the the weather intensity vector. Does anybody know of
> any plotting methods for this? I would like to use contourf but it keeps
> telling me that the Z paramater must be a matrix. How and why would I
> convert my height vector into a matrix?

You may want to griddata() first, but only if your lat/long coordinates are
reasonably close to forming a grid. If they are too far off from a grid, then
you have the choice of using one of John D'Errico's FEX contributions such as
gridfit(), or of creating a mesh; creating a mesh would probably involved
Delaunay triangulation.

The major difference (I understand) between the built-in griddata() and John's
gridfit() is in the handling of the interpolation of the surface in areas
where the data is sparse or missing; John has put a lot of care into producing
"reasonable" surfaces in cases where griddata() would produce obvious nonsense.

If interpolation of various sorts is ideologically not suitable for your data
(e.g., because microcells and larger scale weather cells can pretty much
destroy the idea that there is any reasonable "continuity" between adjacent
measurements), then you will probably have to use one of the mesh plots rather
than something like one of the contour plots.

Though, it wouldn't surprise me if John has a FEX contribution for producing
reasonable contour plots out of irregular meshes ;-)
From: TideMan on
On Apr 28, 6:50 am, "Dursun " <dursun.tep...(a)edwards.af.mil> wrote:
> I have four vectors: Lat, Long, Height, and intensity of weather. Each of these vectors are 1766581x1. I would like to create a 3D plot of all this data where the intensity of the weather is assigned a specific color based on the the weather intensity vector. Does anybody know of any plotting methods for this? I would like to use contourf but it keeps telling me that the Z paramater must be a matrix. How and why would I convert my height vector into a matrix?

It's not a big deal.
help reshape
and reshape your column vectors into a matrices.

But if your area covers several degrees in latitude and longitude
(especially at high latitudes), what you get will be distorted because
the lines of longitude merge together as we approach the poles.
What you need to fix this is a map projection. The following link
contains a (free) mapping toolbox that allows you to do this:
http://www.eos.ubc.ca/~rich/map.html
It was written by the same guy who wrote the contourf routine for
Matlab.