Alex Rivera | Logout

How do I set a surf to one color (no gradient) in my matlab-plot?

Asked 2009-01-29T16:03:37.003
17

My dataset consists of three vectors (x,y and z). I plot these values as dots in a 3d-plot with plot3(x,y,z), which is fine. I also want to show a plane in the same plot. To get the data of this plot I use linear regression on x and y to get a new z.

This is how it looks:

alt text
(source: bildr.no)

I want the surf to be filled with only one color (say light blue or gray) and set the opacity, to make it see-through. How can I do this?

Edit
Report

1 Answer

4

Completing the answer from gnovice, an extra ingredient in set(hsurface...) may be required (Matlab R2010b 64):

hSurface = surf(...your arguments to create the surface object...);
set(hSurface, 'FaceColor',[1 0 0], 'FaceAlpha',0.5, 'EdgeAlpha', 0);

to make invisible the point-to-point edges of the plotted surface

answered 2012-09-15T10:59:18.640

Your Answer