필터 지우기
필터 지우기

How to label x tick at every 2 and y tick at 0.2?

조회 수: 26 (최근 30일)
nam bui
nam bui 2021년 2월 17일
댓글: nam bui 2021년 2월 17일
Hello, I have a plot that I want the X-axis labels every 10 to 100 with a tick marks every 2. I also want the Y-axis labels at 2,1,0,-1,-2,-3,-4,-5, with tick marks every 0.2. I'm wondering if any experts can give some command to do it?
Thank you
axis([0 100 -6 2])

채택된 답변

Adib Yusof
Adib Yusof 2021년 2월 17일
Hey, try this:
Ax = gca;
set(Ax.XAxis, 'TickValues', 0:10:100, 'MinorTick', 'on', 'MinorTickValues', 0:2:100);
set(Ax.YAxis, 'TickValues', -5:2, 'MinorTick', 'on', 'MinorTickValues', -5:0.2:2);
  댓글 수: 1
nam bui
nam bui 2021년 2월 17일
Hello, thank you. This is excatly what i need

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by