how to use the "tight" function for just one axis
Mostrar comentarios más antiguos
So I origionally had: axis tight But it cut both axes, whereas I just want it to be tight around the x axis but allow the y axis to not be cut. Is there a function for this please? Thanks
Respuesta aceptada
Más respuestas (3)
Jaromir
el 16 de Mzo. de 2018
There's an out-of-the-box command for what you want:
set(handleToAxes, 'XLimSpec', 'Tight');
or
set(handleToAxes, 'YLimSpec', 'Tight');
3 comentarios
SOFIA DIE PANCORBO
el 19 de Mayo de 2020
I found it didn't work with "handleToAxes" but it did with "gca" instead. Thank you! :)
qilin guo
el 26 de Abr. de 2022
Undocumented properties! But useful. How many undocumented properties are there?
dpb
el 26 de Abr. de 2022
Undocumented...
ADSW121365
el 31 de Ag. de 2022
Drew Chap
el 25 de Mayo de 2023
As of R2021a, the best method to do this is:
ax = gca()
ax.XLimitMethod = 'tight'
Categorías
Más información sobre Graphics Object Properties 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!