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!