필터 지우기
필터 지우기

how to change the position of the axis data?

조회 수: 3 (최근 30일)
Pavel Kuzmitsky
Pavel Kuzmitsky 2022년 11월 8일
편집: Jan 2022년 11월 8일
how to change the position of the axis data? I want the numbers to be on the other side of the axis
something like this

채택된 답변

Jan
Jan 2022년 11월 8일
편집: Jan 2022년 11월 8일
% Dummy contents:
H = axes;
plot(1:10);
drawnow;
% Get original ticks:
XTick = H.XTick;
XLabel = H.XTickLabel;
nTick = numel(XTick);
% Calculate modified positions, omit the marginal ticks:
YL = H.YLim;
Ypos = repmat(YL(1) + (YL(2) - YL(1)) / 40, 1, nTick - 2);
text(XTick(2:nTick-1), Ypos, XLabel(2:nTick-1), ...
'HorizontalAlignment', 'center', 'VerticalAlignment', 'bottom')
% Remove original tick labels:
H.XTickLabel = {};

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by