Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to set up minor tick in MATLAB?

2,263 views
Skip to first unread message

litongmu

unread,
May 7, 2009, 8:14:40 PM5/7/09
to
Hi all,

I am trying to add some minor ticks to my plot. I want to add 5 minor ticks between 2 major ticks. However, MATLAB automatically add 9 minor ticks when I set 'XMinorTick' to 'on'. And according to Online Help, one can not set up the number of minor ticks. So I want to ask whether anyone has figured out a way to change the number of minor ticks in MATLAB.
Thanks in advance.

-Tongmu

Matt Fig

unread,
May 7, 2009, 10:56:01 PM5/7/09
to
This looks like a job for Yair Altman! I.e., you may have to go into Java to edit this property.

Yair Altman

unread,
May 8, 2009, 4:10:03 AM5/8/09
to
Unfortunately, AFAIK there is no back-end access to axes/plot/HG properties.

Here's another trick you could try: display another axes *beneath* and slightly upward-offset to your main axes; set the MajorTickLabels of this new axes according to the positions you require, and link the two axes with the linkaxes function. In your main axes, just set the MajorTickLabels (no minor ticks). The upward-offset bottom ticks should now appear as top-axes minor ticks. Note that I've not tried this myself, but I think it should work.

Yair Altman
http://UndocumentedMatlab.com

paulo.ricar...@gmail.com

unread,
Sep 23, 2014, 7:40:18 PM9/23/14
to
0 new messages