How can I have ZOOM honor my formatted tick labels?

16 ビュー (過去 30 日間)
MathWorks Support Team
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
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 件)

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by