Enlarging y-Axis because text description of two points is overlapping

1 回表示 (過去 30 日間)
Arijana Bohr
Arijana Bohr 2020 年 11 月 2 日
コメント済み: Arijana Bohr 2020 年 11 月 2 日
I am trying to plot the following. The problem is the text description of two points ('BBD1', 'BBD2') is overlapping and I am trying to solve this by making the space between the ticks on the y-Axis larger.
Is that possible, and if not is there a better solution to my problem?
x = [6.27, 2479.79, 49.46, 43.95, 900.98, 773.49];
y = [22.48, 5.89, 19.52, 19.89, 1.64, 2.25];
txt = {'BD','DD','BBD1','BBD2','BBD3','B4'};
plot(x,y,'*');
text(x,y,txt);
Kind regards

採用された回答

Abdolkarim Mohammadi
Abdolkarim Mohammadi 2020 年 11 月 2 日
A simple solution is to add horizontal and vertical offset so that you can better control the position of the labels.
x = [6.27, 2479.79, 49.46, 43.95, 900.98, 773.49];
y = [22.48, 5.89, 19.52, 19.89, 1.64, 2.25];
txt = {'BD', 'DD', 'BBD1', 'BBD2', 'BBD3', 'B4'};
HorizontalOffset = [35, -150, 35, 35, 35, 35];
VerticalOffset = [0, 0, -0.5, 0.5, 0, 0.5];
plot (x, y, '*');
text (x+HorizontalOffset, y+VerticalOffset, txt);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by