How to draw an "error bar" between two points on a scatter plot

3 次查看(过去 30 天)
Hi All,
I am plotting gps corrdinates on an x/y scatter plot. Based on some statistics I ran, the gps corrdinates could be slighty off resulting in the posibility of the current gps location being slighty ahead or behind the estimated location.
I would like to show this error on the scatter plot by plotting an "error bar" of sorts.
My question is:
How would I go about plotting a line between points (x1, y1) and (x2, y2) that looks like an error bar?
Thanks,
Zach
  1 个评论
Star Strider
Star Strider 2019-8-26
Zachary Ferrie commented:
I really want to plot a line between two points that has the look of an error bar. I don't need any of the errorbar() fuctionality because I know what points I want to plot my line between. I really just want to be able to draw a line between any two points that I specify that looks like an error bar. I have drawn a picture that hopefully helps make things more clear.
Thanks,
Zach

请先登录,再进行评论。

采纳的回答

the cyclist
the cyclist 2019-8-26
I think you might be able to get something pretty close to what you want using the doublearrow annotation. (There is a property governing what the arrowheads look like; I don't think any are a truly flat end like an errorbar, but maybe you don't care.)
Failing that, you could build it completely from scratch using the line primitive.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by