Change axis values of an already existing figure
조회 수: 45 (최근 30일)
이전 댓글 표시
I have a figure that has axis already and numbers in them. I wish to change the axis values display values so that they read differently. I only have the .fig file and the numbers on the axis don't matter to much, so changing them is only for better readability (say put in in a positive scale from 0 to 10. How does one do that without screwing up the figure?
댓글 수: 0
채택된 답변
Walter Roberson
2018년 5월 11일
편집: Walter Roberson
2018년 5월 11일
ax = findobj(0, 'type', 'axes', '-or', 'type', 'matlab.graphics.axis.Axes');
if isempty(ax); error('No axes found'); end
if length(ax) > 1; error('Multiple axes found'); end
xticks(ax, [new list of x tick positions])
set(ax, 'XTickLabel', {'0' '1' '2' '3'});
댓글 수: 7
추가 답변 (0개)
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!