FixTicks - automatic redraw ticks on any axis

バージョン 1.0.0.0 (2.41 KB) 作成者: Jacco
Increase the number of ticks using intelligent spacing without having to manually specify them.
ダウンロード: 66
更新 2016/3/11

ライセンスの表示

FixTicks tries to automate creating a custom number (either minimum or exact) of ticks on any axis. A simple algorithm will try to automatically determine a reasonable spacing. Ticks will try to include the limits if they are nicely rounded and an even number of ticks will always include zero (if present).
Actions such as zooming and setting an axis limit can cause ticks to be lost and make plots look bad. Equally some plotting functions such as plotyy and using subplots cause a figure to have less ticks than usual. The usual proposed solution is to set the ticks manually (set(ga,'YTicks',linspace(lb,ub,5)), however this solution creates non-intelligent spacing unless you want to micromanage all your ticks. You want nice rounded ticks automatically! Simply invoke:

fixticks();

after you're done plotting and setting limits etcetera, and voilà your Y-axis ticks are again nice!

Trough arguments (all are optional) you can control the behaviour. By default it will draw 5 ticks at minimum on the Y-axis of the current graphic object. Full arguments are as follows: fixticks(h, ax, ticknum, strict), where h (=gca) is the handle to the desired graphic object (for instance when using plotyy!), ax (='Y') allows to specify the desired axis, ticknum (=5) set the minimum or exact number of ticks, for strict (=false) being set to false or true, respectively.

引用

Jacco (2024). FixTicks - automatic redraw ticks on any axis (https://www.mathworks.com/matlabcentral/fileexchange/55921-fixticks-automatic-redraw-ticks-on-any-axis), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2015b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersGrid Lines, Tick Values, and Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0

typos