Enlarging y-Axis because text description of two points is overlapping
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Arijana Bohr
el 2 de Nov. de 2020
Comentada: Arijana Bohr
el 2 de Nov. de 2020
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
0 comentarios
Respuesta aceptada
Abdolkarim Mohammadi
el 2 de Nov. de 2020
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);
Más respuestas (0)
Ver también
Categorías
Más información sobre Formatting and Annotation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!