help creating plot of type in attached example
Show older comments
Dear MATLAB answers,
I have here a plot that I need to replicate using my own data. I tried looking through help pages with all the different type of plots, but was having difficulty figuring out how to create the scatter type plot with offsets as shown in attached image. I would be able to plot the lines, curves, etc, but those too I would not know how to offset.
Therefore, my question is:
- how to create scatter plot of type shown
- how to offset scatter/line/curve in standard way shown in image
Thank you in advance for your guidance!

5 Comments
Bob Thompson
on 31 Jan 2019
Are the results actually 'offset'? To me 'offset' indicates that the data should overlap, but has been deliberately moved by a fixed increment in order to make all points more visible. Is this what you mean? It looks to me like there are just three different data sets that appear at regular intervals.
As for creating a scatter plot, I would suggest creating a quick loop for each data set. Somethign like this:
hold on
for i = 1:numdata
scatter(x_values,y_values,formatting) % Where formatting is a string of characters wich dictates the format of the plotted data (color, shape, etc.)
end
Adenine Pall
on 1 Feb 2019
To vertically offset on a linear axis, you just have to add a constant to the data. For the example in the image, assuming the data used to overlap with the blue, a value of ~0.2 was added to the red data and a value of ~0.4 was added to the green data.
scatter(x, y+0.2)
Adenine Pall
on 1 Feb 2019
Edited: Adenine Pall
on 1 Feb 2019
Accepted Answer
More Answers (0)
Categories
Find more on Scatter Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!