How to reduce space between ylabel and y ticks in Matlab plot?
Mostrar comentarios más antiguos
How to reduce the space between y-label and y-ticks, in other words how to closer the y-label to y-axis.
Respuesta aceptada
Más respuestas (1)
yanqi liu
el 26 de Sept. de 2021
Editada: Walter Roberson
el 26 de Sept. de 2021
sir, my be you can ref the follow code, please check
clc; clear all; close all;
figure;
ezplot('y=sin(x)');
pause(0.1);
hs = get(gca, 'XLabel');
pos = get(hs, 'Position');
pos(2) = pos(2)+0.2;
set(hs, 'Position', pos)
hs = get(gca, 'YLabel');
pos = get(hs, 'Position');
pos(1) = pos(1)+0.2;
set(hs, 'Position', pos)


4 comentarios
Ammy
el 26 de Sept. de 2021
Walter Roberson
el 26 de Sept. de 2021
Editada: Walter Roberson
el 26 de Sept. de 2021
how_much_to_move = 0.1;
ezplot('y=sin(x)');
hs = get(gca, 'YLabel');
pos = get(hs, 'Position');
pos(1) = pos(1) + how_much_to_move;
set(hs, 'Position', pos)
adjust how_much_to_move as needed for your purposes.
yanqi liu
el 27 de Sept. de 2021
Yes, sir, this is good idea
Ammy
el 27 de Sept. de 2021
Categorías
Más información sobre Axis Labels en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!