# Draw objects (arrows, brackets, ...) outside the axis area

66 views (last 30 days)
Sim on 21 Oct 2020
Edited: Thomas on 23 Oct 2021
I need to draw some objects (arrows, brackets, ...) outside the axis area.. Any idea on how to do it?
In particular I would need to draw curly brackets outside the axis area.

Walter Roberson on 21 Oct 2020
hold on
plot(randn(1,20), 'clipping', 'off'); %your brackets etc
ylim([0 1]);
hold off
##### 2 CommentsShowHide 1 older comment
Thomas on 23 Oct 2021
It seems like I cannot comment on the comment. Anyway, I want to point out that curly brace function actually works for the right brackets. (中国朋友可以直接跳最后一段)See here:
x = linspace(5, 11);
y2 = (70./(x./100)).*(1-1./(1+(x./100)).^100)+1000./(1+(x./100)).^100;
plot(x,y2,'Color','k');
line([6 10],[875.0568 875.0568],'linestyle','--','color','k');
%left red brace
drawbrace([6 875.0568], [6 1166.17], 10, 'Color', 'r');
%right blue brace
drawbrace([10 875.0568], [10 700.0218], 10, 'Color', 'b');
%other code omitted
You see if your start point is lower than the end point, it would be the left braces. While tart point is higher than the end point, it would be the right braces. In fact, the brace will appear on the clockwise middle of these two points.(It is the end. Left is for Chinese people.)