Один из способов решения этой проблемы - создать стрелку и строку с двумя разделенными аннотациями:
figure
scatter([1,2,3],[1,2,3]);
ax = gca;
ax.YDir = 'reverse'
%Define the variable
xac = 2.5; %x arrow coordinate
yac = 2.5; %y arrow coordinate
xas = -1; %x arrow shift
yas = -1; %y arrow shift
if get(ax,'Ydir') == 'reverse':
%Create the arrow
ah1 = annotation('arrow','position',[ xac yac+2*yas xas -yas],'linestyle','none');
set(ah1,'parent',ax);
%Create the line
ah2 = annotation('arrow','position',[ xac yac xas yas],'headstyle','none');
set(ah2,'parent',ax);
else:
ah = annotation('arrow','position',[ xac yac xas yas]);
set(ah,'parent',ax);
end
Где координаты стрелки теперь xac yac+2*yas xas -yas
,
Результат:
