image thumbnail

MATLAB Plot Gallery - Line Plot 3D



24 Feb 2012 (Updated )

Create a 3D plot


This is an example of how to create a 3D plot in MATLAB®.

Read about the plot3 function in the MATLAB documentation.

For more examples, go to MATLAB Plot Gallery

% Load the spectra data
load spectraData masscharge time spectra

% Create the 3D plot
plot3(masscharge, time, spectra)
box on

% Set the viewing angle and the axis limits
view(26, 42)
axis([500 900 0 22 0 4e8])

% Add title and axis labels
xlabel('Mass/Charge (M/Z)')
zlabel('Ion Spectra')
title('Extracted Spectra Subset')

Contact us