필터 지우기
필터 지우기

Updating xticklabels after zooming in using datetick in multiple subplots

조회 수: 2 (최근 30일)
Cesar Daniel Castro
Cesar Daniel Castro 2020년 2월 27일
댓글: Adam 2020년 3월 2일
Dear community, I am asking for your help. I am making a GUI, with a panel with 3 tabs and in the second tab I am ploting 5 subplots in a column, in order to display 5 signals. In the x axis I have the time vector and displayed as a date/time using datetick function. Beforehand I need to mention that the x axes of subplots are linked between them so if I zoom in into one image, I will have the same new xlimits. Speaking with images:
It is known that the function datetick does not "regenerate" the ticks after zooming in. By default (at least in my computers) 7 ticks are displayed. So if I want to zoom in e.g. the first 1/4 of the signal I get this:
In 2013 was published a solution of this https://www.mathworks.com/matlabcentral/answers/95034-why-does-datetick-not-regenerate-tick-marks-on-the-axes-when-using-the-zoom-function-in-matlab. So I followed their steps and my problem was partially solved, because after zooming in one subplot, I have again 7 new ticklabels. The problem is that I just have the update of the xticklabels in the subplot where I am zooming in and after searching and trying for the whole day I can't find the solution to make the changes in all the subplots at the same time. An example is shown in the next picture, zooming on the subplot(5,1,2)
Can anyone please help me with this? I will really appreciate it
  댓글 수: 3
Cesar Daniel Castro
Cesar Daniel Castro 2020년 3월 2일
Thank you so much for your suggestion. I haven't tried it before but of course I will give a chance ;)
Adam
Adam 2020년 3월 2일
I assume you are using linkaxes?
doc linkprop
will give you access to a whole load more properties to link, including XTick, XTickLabel, etc so this should work as a general idea, though if stackedplot solves the problem here then that is obviously neater. But linkprop is still useful to know about.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by