Is it possible to connect points on a scatter plot with arrows instead of a line?

60 views (last 30 days)
Vince Clementi
Vince Clementi on 7 Aug 2017
Edited: Walter Roberson on 8 Jun 2020
I am looking to show how oxygen and carbon covary over time in a simple x-y scatterplot. However, instead of the points being connected by lines, I'd like them to be connected by arrows. Is it possible to do this on MatLab or would I need to export the figure and insert the arrows using Adobe?
Here is an example of a plot code:
% Inflata
ylabel('G. Inflata \delta^1^8O');
xlabel('G. Inflata \delta^1^3C');
Walter Roberson
Walter Roberson on 9 Aug 2017
"A scatterplot consists of an X axis (the horizontal axis), a Y axis (the vertical axis), and a series of dots. Each dot on the scatterplot represents one observation from a data set. The position of the dot on the scatterplot represents its X and Y values."
Notice the reference to "dots". If you are connecting anything, you do not have a scatter plot. You might have a time series plot, or a series of time series plots.

Sign in to comment.

Answers (3)

aborghes on 7 Aug 2017
Edited: Walter Roberson on 8 Jun 2020
Hi Vince, I would recommend using the quiver() function. The doc for it is located here:
You can do something like the following code, assuming both data-sets are 1-D matrices
for i=1:length(c13xi87) - 1
p1 = [c13xi87(i) o18xi87(i)];
p2 = [c13xi87(i+1) o18xi87(i+1)];
dp = p2 - p1;
hold on
hold off

José-Luis on 8 Aug 2017
Edited: José-Luis on 8 Aug 2017
x = rand(10,1);
y = rand(10,1);
dx = diff(x);
dy = diff(y)
hold on

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by