필터 지우기
필터 지우기

Manually Xtick control by edit field

조회 수: 1 (최근 30일)
Hello kity
Hello kity 2013년 1월 16일
I want to manually control the x step size (xticks).
there is a edit field which determines the x step size:
xstep1=str2double(get(handles.xstep1,'String'));
this is what i have now
if ~isnan(xstep1)
xbounds = xlim;
set(gca,'XTick',xbounds(1):xstep1:xbounds(2));
end
hope it helps someone

채택된 답변

Jing
Jing 2013년 1월 16일
Hi,
You're just trying to change the default XTick position or the XTickLabel? These two is different properties.
My suggestion is first plot a simple figure then using the edit tool in the figure to change whatever you want, and you can get the m-code after the changes. At this point you will know the exact code that meets your need. Here's the steps you can follow:
1. plot(1:10,1:10);
2. click Edit->Axes Properties...on the Figure menu, and click Ticks...button on the opened property panel.
3. Change what you want, then click File->Generate Code on the figure menu.
  댓글 수: 3
Jing
Jing 2013년 1월 16일
What do you mean by graph? a picture? or a shape?
I think you should ask a new question if it's totally a different one from this theme, or others won't notice.
Hello kity
Hello kity 2013년 1월 16일
example you make a bar graph.
lets say, at 1 there is no bar, so you see a short line at xtick 1, at 2 there is a value so it creates a bar , then that line disappears..

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by