help creating plot of type in attached example
Mostrar comentarios más antiguos
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 comentarios
Bob Thompson
el 31 de En. de 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
el 1 de Feb. de 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
el 1 de Feb. de 2019
Editada: Adenine Pall
el 1 de Feb. de 2019
Yes, precisely!
Vertical offsets like this obfuscate the dependent variable and the y axis no longer describes the offseted data. Nevertheless, the caption in the figure you shared indeed states that the data were vertically offset.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Scatter Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!