How to plot more lines of xtick label
26 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Xiang yu Wang
el 16 de Mayo de 2019
Respondida: Liviu Ivanescu
el 17 de Nov. de 2020
xtick label in figure above is some imformation of a satellite with function 'text';
however it's difficult to adjust position 2nd, 3rd,and so on lines of xticklabel using function 'text';
so is there anyway to add multiple lines of xtick label without function 'text'?
0 comentarios
Respuesta aceptada
Luna
el 16 de Mayo de 2019
Editada: Luna
el 16 de Mayo de 2019
3 comentarios
Yisrael Loecher
el 12 de Mayo de 2020
Editada: Yisrael Loecher
el 12 de Mayo de 2020
I also am using this function, and it works quite well. You may need to use mat2cell to set up the xTicks properly which is passed as an arg as I needed to do, but it is do-able. Thank you for this function.
Más respuestas (1)
Liviu Ivanescu
el 17 de Nov. de 2020
Try this:
xtick = get(gca,'XTick');
row1 = compose('%3.1f',lat(xtick));
row2 = compose('%3.1f',lon(xtick));
labelArray = [row1; row2];
tickLabels = strtrim(sprintf('%s\\newline%s\n', labelArray{:}));
set(gca,'XTickLabel',tickLabels);
xlabel('Latitude/Longitude (deg)')
0 comentarios
Ver también
Categorías
Más información sobre Axis Labels 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!