every second label is showed in corr.matrix only, why?

조회 수: 5 (최근 30일)
ETH
ETH 2013년 3월 15일
when i tipe in the code below, every second axes is shown only. this means the first point is not named at all, the second is named after the first ones name, the third is not named, the fourth has the name of the second value on that axis. I dont get why. do you? thanks a lot
[r,p] = corrcoef(x); % Compute sample correlation and p-values.
imagesc(p); % plot the matrix set(gca, 'XTick'); % center x-axis ticks on bins set(gca, 'YTick'); % center y-axis ticks on bins set(gca,'XTickLabel',{'1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19'}) set(gca,'YTickLabel',{'1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19'}) title('Correlation Matrix', 'FontSize', 12); % set title colormap('jet'); % set the colorscheme colorbar

답변 (2개)

owr
owr 2013년 3월 15일
You set the labels, but not the ticks themselves. Try something like this:
set(gca, 'XTick',1:19);
set(gca,'XTickLabel',{'1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19'})

ETH
ETH 2013년 3월 18일
Thanks a lot, your hint was implemented and worked perfectly fine!!! was my first question here, i am astonished! cheers
  댓글 수: 1
Jan
Jan 2013년 3월 18일
Please post comments in the comment section, when they are not answers. Otherwise it will look confusing, if more answers are appended. Thanks.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by