Plot arrow as upper limits in errorbar when I don't have lower bound
조회 수: 6 (최근 30일)
이전 댓글 표시
Roberto Serafinelli
2022년 11월 22일
답변: Roberto Serafinelli
2022년 11월 23일
Hi,
I am dealing with a variable that is strictly positive, and for which the calculation sometimes give values of the errors that are larger than the value itself. For example "1+-3" cannot be reported like that but must be reported as "<4".
I also cannot plot them as regular errorbars. Sometimes in plots you see these type of data points as arrows pointing downwards, and I was asking if it is possible to do that in Matlab.
For example in the following code I want an arrow at point (56,11) pointing downwards. How do I do this?
y=[1 2 3 4];
x=[15 1 34 56]
ey=[0.1 0.2 0.3 7];
test1=find(ex>x);
y_upper=x(test1)+ex(test1);
x_upper=y(test1);
댓글 수: 2
Kai
2022년 11월 22일
편집: Kai
2022년 11월 22일
can you explain more about the first error? Do you mean you want "1 +- 3" to return only "<4" and ignore ">-2"? Also, your sample code doesn't have "ex" and "11" in the (56,11). For only showing downward arrows, MATLAB can be configured to only display negative or positive error range, you can check this link for details only show negtive range
채택된 답변
추가 답변 (1개)
Jeffrey Clark
2022년 11월 23일
@Roberto Serafinelli, using the e = errorbar call where the inputs are given to draw individual lines (see and Multiple lines with error barsl) will return a list e of the lines it creates for the data. The e can be indexed individually and modified as shown in ErrorBar Properties - for the individule error cases (e.g., negative values) you could use the Downward-pointing triangle marker arrow head and modify the error line lengths/colors as needed.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Errorbars에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!