Enlarging y-Axis because text description of two points is overlapping
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Arijana Bohr
il 2 Nov 2020
Commentato: Arijana Bohr
il 2 Nov 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 Commenti
Risposta accettata
Abdolkarim Mohammadi
il 2 Nov 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);
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Formatting and Annotation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!