Register to reply

Truncating a surface plot in Matlab

by ballzac
Tags: matlab, plot, surface, truncating
Share this thread:
Sep29-11, 08:11 PM
P: 104
My thesis involves several surface plots. Most of the interesting features of these plots (and also the region I am interested in) are between z=0 and z=0.2, but there are a few points that have values as high as z=4. I want to view only the region of interest, so I use

zlim([0 0.2])
This works fine in the sense that it zooms in on the region of interest, but it does not truncate parts of the plot above z=0.2. This means that the surface extends above the axes, all the way up to the top of the figure when viewed from an oblique angle. Cosmetically, I feel this is unacceptable for a thesis, and I would like the plot to be truncated at the axis limits without affecting the location of the points.

I am okay with it either 'cutting' the top off, or flattening it at the top, but would probably prefer the former. Unfortunately, changing the actual values in this region (by setting any point with a value greater that z=0.2 to 0.2) changes the actual shape of the surface between these points and the neighbouring points.

There must be simple solution for this, but I can't find one. Hopefully someone has some ideas. Thanks in advance.
Phys.Org News Partner Science news on
Physical constant is constant even in strong gravitational fields
Montreal VR headset team turns to crowdfunding for Totem
Researchers study vital 'on/off switches' that control when bacteria turn deadly

Register to reply

Related Discussions
Matlab 3D plot General Engineering 2
3D Matlab plot Math & Science Software 4
Truncating a vector from an addressed element in MatLab Math & Science Software 1
MATLAB: 3D plots- How to plot 3D lines rather than surface? Math & Science Software 2
Surface Plot in Matlab (Cylindrical Coordinates) Math & Science Software 1