File Exchange

image thumbnail


version 1.0.5 (2.73 KB) by Christopher K. Kovach
Create a rotatable stereoscopic view of 3D data with two side-by-side subplots.

1 Download

Updated 02 Apr 2019

View License

SETSTEREO yokes the camera positions in two axes to provide a rotatable stereoscopic view of points and surfaces plotted in 3 dimensions. The relationship between the axes is maintained with a callback, UPDATESTEREO.

For example, to plot a stereoscopic view of the Matlab logo surface:

% Create the surface
L = 160*membrane(1,100);

% Create a figure with two identical subplots
ax1 = subplot(1,2,1);
s1 = surface(L);
axis equal vis3d off
ax2 = subplot(1,2,2);
s2 = surface(L);
axis equal vis3d off
set([s1 s2],'EdgeColor','none');
set([ax1 ax2],'clipping','off')

% Lock the position of the cameras to maintain a fixed separation; positive separation for divergent viewing and negative for crossed.
rotate3d on

Now you can manipulate either axis while viewing the result in stereo by diverging your eyes or using a handheld stereoscope.

Cite As

Kovach, C.K. (2019). setstereo (, MATLAB Central File Exchange. Retrieved April 2, 2019.

Comments and Ratings (0)



Provide a cooler demo in the description.


A better logo


Add a nifty logo


Update the citation text to something that makes more sense.


For some reason, only one file was uploaded in the previous attempt.

MATLAB Release Compatibility
Created with R2018a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags