image thumbnail

MATLAB Plot Gallery - Line Plot 2D (3)

by

 

24 Feb 2012 (Updated )

Create a line plot with markers

Line_Plot_2D_3

This is an example of how to create an line plot with markers in MATLAB®.

Read about the plot function in the MATLAB documentation.

For more examples, go to MATLAB Plot Gallery

% Load Morse data
load MDdata dissimilarities dist1 dist2 dist3

% Plot the first set of data in blue
figure
plot(dissimilarities, dist1, 'bo')
hold on

% Plot the second set of data in red
plot(dissimilarities, dist2, 'r+')

% Plot the third set of data in green
plot(dissimilarities, dist3, 'g^')

% Add title and axis labels
title('Morse Signal Analysis')
xlabel('Dissimilarities')
ylabel('Distances')

% Add a legend
legend({'Stress', 'Sammon Mapping', 'Squared Stress'}, ...
    'Location', 'NorthWest')

Contact us