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

2 次查看(过去 30 天)
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
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 CenterFile Exchange 中查找有关 Formatting and Annotation 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by