How to plot more lines of xtick label

41 visualizaciones (últimos 30 días)
Xiang yu Wang
Xiang yu Wang el 16 de Mayo de 2019
Respondida: Liviu Ivanescu el 17 de Nov. de 2020
QQ截图20190516174459.png
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'?

Respuesta aceptada

Luna
Luna el 16 de Mayo de 2019
Editada: Luna el 16 de Mayo de 2019
Hi,
Have you tried this function from FEX?
  3 comentarios
Luna
Luna el 1 de Jun. de 2020
Your welcome! :)

Iniciar sesión para comentar.

Más respuestas (1)

Liviu Ivanescu
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)')

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by