How can I make my tick labels include 4 decimal places
8 ビュー (過去 30 日間)
古いコメントを表示
I am trying to make a map over a very small area and three decimals is not enough to distinguish between longitude tick labels on my x axis. How can I tell it to include for decimals on that axis? It automatically includes 4 for my y axis.
figure
imagesc(AN(dlatlim,dlonlim))
set(gca,'Xtick',1:400:length(x_label2),'XTickLabel',x_label(1:400:length(x_label2)));
set(gca,'Ytick',1:400:length(y_label2),'YTickLabel',y_label(1:400:length(y_label2)));
set(gca,'fontsize',16)
0 件のコメント
回答 (1 件)
Walter Roberson
2020 年 11 月 9 日
ax = gca;
ax.XAxis.TickLabelFormat = '%.4g';
10 件のコメント
Walter Roberson
2020 年 11 月 10 日
Are x_label or y_label sorted in descending order? If so then that imagesc call would flip the image.
But also some image related operations automatically set YDir property to 'reverse'
参考
カテゴリ
Help Center および File Exchange で Axis Labels についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!