필터 지우기
필터 지우기

How to scale the Tick Label by a number?

조회 수: 8 (최근 30일)
Jose Zamora Zeledon
Jose Zamora Zeledon 2016년 6월 11일
답변: Azzi Abdelmalek 2016년 6월 11일
I'm using images(imd,clims) to plot a figure. The figure is a 64x64 matrix, and the ticks currently go from 0 to 64 on both x and y. My question is how can I scale the ticks say by 0.05 (as in xyLabel = 0.05 .* (0:64) ) and change the value displayed.
Thank you!

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 6월 11일
A=randi(64,64)
image(A)
xt=arrayfun(@num2str,get(gca,'xtick')*0.05,'un',0)
yt=arrayfun(@num2str,get(gca,'ytick')*0.05,'un',0)
set(gca,'xticklabel',xt,'yticklabel',yt)

추가 답변 (0개)

카테고리

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