필터 지우기
필터 지우기

Problems with a down arrow displaying in a plot

조회 수: 25 (최근 30일)
10B
10B 2017년 4월 25일
댓글: KL 2017년 4월 25일
Hello Community,
I have recently re-run a bit of code to display a plot, and there is an error that has occurred without my changing the code. In the plot text, there was a 'down arrow' showing, but now, the syntax '\downarrow' appears in its place. Ive looked on Mathworks and I think there is a problem associated with a service pack (though I may be wrong on this!).
I have also tried to set LateX interpreter to 'on', code below:
% Turn on LateX Interpreter
set(0,'Interpreter','latex');
then run the following text command:
% Create text
text('Parent',subplot2,'String',{'\downarrow 1(D)'},...
'Position',[35.2026613558799 5703.42205323194 0]);
but I still get the following error:
Warning: Error updating Text.
Character vector must have valid interpreter syntax:
\downarrow 1(D)
Could any kindly soul advise on how I can workaround this please?
Regards,
10B.

채택된 답변

KL
KL 2017년 4월 25일
Like this?
text(35.02,5703.42,'$\downarrow 1(D)$','Interpreter','latex')
  댓글 수: 2
10B
10B 2017년 4월 25일
KL,
Many thanks - that worked perfectly! Could I ask if you know exactly what the '$' operator is doing to make this work? Just so I can understand a little better for next time...
10B.
KL
KL 2017년 4월 25일
From what I understand, it's just part of the syntax so Matlab knows what's between dollar symbols should be converted into latex specs.

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

추가 답변 (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