How to set a certain ratio for x-y axis?
이전 댓글 표시

As in the image, the difference each step for y-axis is 0.2, for x-axis is 1. I want to keep x-axis as 1, but change y-axis to 0.5 for each step and keep the width of the picure unchanged. So I shrink this picture vertically 2.5 times.
Is there a general method to do this? I appreciate your answer!
답변 (2개)
Mischa Kim
2014년 2월 28일
편집: Mischa Kim
2014년 2월 28일
Toby, I believe you want to change the ticks, correct? Use
set(gca,'YTick',-1:0.5:1)
after the plot command.
Image Analyst
2014년 3월 2일
Try using set() to adjust the 'Position' property to stretch the width and height of the graph to whatever you want
set(gca, 'Units', 'normalized', 'Position', [0,0,.5, .2]);
카테고리
도움말 센터 및 File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!