필터 지우기
필터 지우기

add more X and Y ticks (dynamically)

조회 수: 18 (최근 30일)
Frank
Frank 2016년 12월 28일
답변: Sharmila Raghu 2017년 1월 5일
Hi,
The auto tick mode for the X and Y axis works well when you zoom, pan and resize. But often I find that there are not enough ticks added to both axes. There can be large gaps between the labels, big enough to add one or two more ticks with labels.
Is there a simple way to add more X and Y ticks, while keeping the benefits of the auto mode (ticks are updated dynamically after zoom, pan and resize)?
If not, i have to write something on my own (similar to Datetickzoom), but I figured I could ask first...
Btw. if I create a plot in R2015b with the code below, then there is no tick update for the y axis at all. (with a max of 120 it works ok)
figure
xlim([0,18]);
ylim([0,150]);

답변 (1개)

Sharmila Raghu
Sharmila Raghu 2017년 1월 5일
Unfortunately, there is currently no way to change how many ticks are chosen in ‘auto’ mode. I work for MathWorks and I have forwarded this feedback to the appropriate product team. You may want to turn on the minor grid. The grid lines may help in gauging data between ticks, but I understand this isn’t exactly what you want.
Regarding the [0,150] limits, 50 is chosen as the tick spacing because choosing a smaller value would result in too many ticks.You could choose [0, 140] or [0,160] and the spacing would become 20 and more ticks would be drawn.

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by