Can I add (vertical) errorbars to a scatter plot?

조회 수: 1 (최근 30일)
Jacob
Jacob 2017년 3월 16일
댓글: Adam 2017년 3월 16일
Hi I would like a scatter plot, with multiple y-series, each with their own errorbars (standard deviation I have calculated of my data). But when I use the errorbar function it makes it into a line plot which is not what I want.
As you can see in my image, I have 2 y-series data (blue and red) and when I try to add errorbars to the blue series I get the line, which I do not want, I simply want the vertical errorbars on each point (variable standard deviation, which I have calculated).
Here is my current code:
"figure(1); scatter(D,Ml); hold on; errorbar(D,Ml,errMl,'k') ; hold on; scatter(D,Mw); hold on;"
Thanks for help
  댓글 수: 1
Adam
Adam 2017년 3월 16일
errorbar is apparently a function that explicitly plots a line with errorbars rather than just errorbars, so the fact you get a line is understandable. What is in errMI?

댓글을 달려면 로그인하십시오.

채택된 답변

Jacob
Jacob 2017년 3월 16일
Got it...
figure(1); subplot(2,1,1); errorbar(D,Ml,errMl,'ro') ; hold on; errorbar(D,Mw,errMw,'bo') ; hold off;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Errorbars에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by