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

31 ビュー (過去 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 件のコメント
Abdulaziz Abutunis
Abdulaziz Abutunis 2022 年 6 月 22 日
It works great thanks
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 Center および File ExchangeSpecifying 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