add more X and Y ticks (dynamically)

11 次查看(过去 30 天)
Frank
Frank 2016-12-28
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