フィルターのクリア

how to correctly spaced the X and Yticklabel?

2 ビュー (過去 30 日間)
Beatriz Sanchez
Beatriz Sanchez 2018 年 9 月 7 日
コメント済み: Image Analyst 2018 年 9 月 7 日
Hi, this is my code:
vec=[-180 -36 0 36 180]
for i=1:3
figure(1)
subplot(1,3,i)
if i==1
contourf(vec,vec,nzro_mean1)
elseif i==2
contourf(vec,vec,nzro_mean2)
elseif i==3
contourf(vec,vec,nzro_mean3)
end
axis square
xt=get(gca, 'Xtick');
xtv=linspace(min(xt), max(xt), numel(vec));
yt=get(gca, 'Ytick')
ytv=linspace(min(yt), max(yt), numel(vec));
set(gca, 'XTick',xtv, 'XTicklabel',{vec}, 'YTick',ytv, 'YTicklabel', {vec})
axis equal
title(['Especie ',num2str(i)])
colorbar('southoutside')
end
but the Xticklabels are spaced differently than Yticklabel, I don't understand, everything I tried just make it worse or the same... Xticklabel is wrongly spaced and the farest I came is to get Yticklabel as wrong as Xticklabel.
  1 件のコメント
Image Analyst
Image Analyst 2018 年 9 月 7 日
Your code doesn't run. What is nzro_mean1, etc.? And you forgot to include a screenshot so we don't know what you're talking about. Please do so and indicate which spaces or spacings or separations of what from what you're talking about. In the meantime, check out the functions xticks(), yticks(), and axis() and their input parameters.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by