how to always display “labels” on axis X

前端 未结 2 934
长情又很酷
长情又很酷 2021-01-22 15:15

If I zoom several time graph all labels from axis X disapear (go away) and there are no visible axis X labels so it is not possible to understand the part of graph where am I.

2条回答
  •  太阳男子
    2021-01-22 15:32

    it depends, are you manually setting the tick marks yourself ('XTick' and 'XTickLabel' axis properties)?

    Try this simple example

    plot(sin(1:10), 'o-')
    

    without changing anything, you can zoom as much as you want, and the tick labels will always be visible


    EDIT

    The root cause of the problem is the same as the one raised in your other question, datetick function will manually set the tick labels, thus disabling automatic update on zoom/pan.

    The good news is there are already submissions on FEX that tries to solve this exact problem with DATETICK

提交回复
热议问题