add more X and Y ticks (dynamically)

13 visualizzazioni (ultimi 30 giorni)
Frank
Frank il 28 Dic 2016
Risposto: Sharmila Raghu il 5 Gen 2017
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]);

Risposte (1)

Sharmila Raghu
Sharmila Raghu il 5 Gen 2017
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.

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by