I want to replace the hyphens with en dashes in a plot axes.

조회 수: 30 (최근 30일)
Abdulaziz Abutunis
Abdulaziz Abutunis 2022년 6월 22일
댓글: Jonas 2022년 6월 23일
Dear all
I need help with replacing the hyphens in the y-axis with en dashes in a plot. In other words, I want to increase the length of the negative sing in the plot axis.
Thanks
Aziz

채택된 답변

Jonas
Jonas 2022년 6월 22일
i suggest you have a look into the yticklabels() and xticklabels() and do some replacement of '-' with the en dash char(0x2013).
plot(-10:10);
yticklabels()
yticklabels(replace(yticklabels(),'-',char(0x2013)));
yticklabels()
  댓글 수: 2
Jonas
Jonas 2022년 6월 23일
my pleasure. note that the effect vanishes if the ticks are changed or refreshed. This can also happen e.g. when you resize the figure

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by