Fanning Software Consulting

Minor Tick Marks Disappear

QUESTION: Yikes, I just noticed that in some of my plots my minor tick marks have disappeared. What's up with that?

ANSWER: This is a bug that was apparently introduced in IDL 6.4, as the problem does not appear prior to that. The bug is generated by setting the [XYZ]STYLE keywords to the PLOT command to 1, while at the same time setting the number of tick intervals with the [XYZ]TICKS keywords. Consider the following code to produce the figure shown below.

   !P.Multi = [0,2,1]
   Plot, findgen(11), XTICKS=5, YTICKS=5
   Plot, findgen(11), XTICKS=5, YTICKS=5, XSTYLE=1, YSTYLE=1
   !P.Multi = 0
Minor tick marks disappear with IDL bug.
The minor tick marks disappear when tick spacing is set and exactly axis scaling is requested in IDL 6.4.

The work-around is to specify explicitly the number of minor ticks intervals you wish to have with the [XYZ]MINOR keywords.

   Plot, findgen(11), XTICKS=5, YTICKS=5, XSTYLE=1, YSTYLE=1, XMINOR=5, YMINOR=5

Web Coyote's Guide to IDL Programming