How can I have ZOOM honor my formatted tick labels?
조회 수: 6 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2011년 10월 12일
편집: MathWorks Support Team
2020년 11월 24일
I know that I can format my tick labels using the AXES' 'xticklabel' and 'yticklabel' properties. However, when I use the "Zoom In" and "Zoom Out" buttons and click on the AXES, the tick labels do not change accordingly. I want to use ZOOM and guarantee that my tick labels update with my desired formatting.
채택된 답변
MathWorks Support Team
2020년 11월 24일
편집: MathWorks Support Team
2020년 11월 24일
The ability to specify ActionPreCallback and ActionPostCallback functions for ZOOM and PAN was added in MATLAB 7.3 (R2006b). This allows you to format the labels after the zoom has been completed, using a callback function. More information and examples are available in the documentation for PAN and ZOOM.
For previous releases, the following is one way you can work around this problem.
NOTE: This workaround uses undocumented features of MATLAB, specifically by modifying the callbacks of some of the figure's toolbar buttons. Therefore, this workaround is not officially supported by MathWorks, Inc.
Basically, this workaround changes the figure's 'WindowButtonDownFcn' to call code that performs the zoom and subsequently sets the tick labels.
To use the workaround, download the "zoomfixticks.m" file.
This MATLAB file function includes help and an example on how to use it.
NOTE: You will have to modify one of the subfunctions to perform the desired ticklabel formatting for your application.
For more information on formatting tick labels in general, see the Related Solutions listed below:
댓글 수: 0
추가 답변 (0개)
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!