The black lines are awful, how can I get rid of them? I want only the colored surfaces.
Accepted AnswerThe issue occurs when the grid which your surface is plotted over contains a large number of points. The lines which create the wire mesh surface are black by default and take precedence over the color map. In this situation, the wire grid is so dense that the lines form a completely black surface.
Direct link to this comment There is a property called alpha. After the surf command just say alpha(0.5). The value lies between 0 and 1. The closer to zero the more transparent it is.
You can change the color scheme by specifying a colormap. Colormaps are three-column arrays containing RGB triplets in which each row defines a distinct color. For example, here is a surface plot with the default color scheme. f = figure; surf(peaks);
Change View of Surface PlotUse the peaks function to get the x-, y-, and z-coordinates of a surface. Then plot the surface and label each axis. View the plot using an azimuth of 90 degrees and an elevation of 0 degrees. The new line of sight is along the x-axis.
Another choice is to set the edgeColor and/or lineStyle properties of the surface handle object to none.
>> hSurf = surf(X,Y,Z,'EdgeColor','none','LineStyle','none','FaceLighting','phong');
This is a more general solution, you can change the edgeColor after the surface has been created too. It does not rely on LineStyle and FaceLighting.
a= peaks(1000); h = surf(a) set(h, ‘edgecolor’,'none’)
Note, I have made a 45 second video that shows this occurring and how to fix it.
http://blogs.mathworks.com/videos/2008/08/13/matlab-basics-setting-edge-color-for-large-surface-plots/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With