comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Problem with PLOT limits in IDL v3.6
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Problem with PLOT limits in IDL v3.6 [message #2857] Thu, 08 September 1994 11:50
joel is currently offline  joel
Messages: 5
Registered: May 1994
Junior Member
I have found a problem in the PLOT routine of IDL v3.6. In short: it does not
correctly set the plot limits (e.g., XRANGE) when I try to explicitly define
the tick marks and labels (e.g., with XTICKV). I have tried a workaround with
the AXIS procedure, but it has the same problem as the PLOT procedure. This
problem only appears in IDL v3.6, but worked just fine in v3.5 and earlier.

Below is some example code to show the problem:


x=indgen(25) ; data from 0 to 24
!X.RANGE=[3.5,18.5] ; desired plot range to be from 3.5 to 18.5
!X.STYLE = 1 ; don't round off the plot limits
!X.MINOR = 5 ; five minor ticks per labeled major tick

; The following plot command works correctly, plotting only X axis range of 3.5
; to 18.5

plot, x, x


; However, if I desire all integer value tick marks to be labeled, the
; following plot command SHOULD work, and it does in IDL v3.5...but it doesn't
; in IDL v3.6. In v3.6, the PLOT command incorrectly sets the range of the X
; axis to the limits of the XTICKV values (4 to 18) rather than the XRANGE
; values (3.5 to 18.5)!

xtv = indgen(15) + 4 ; desired tick values are all integers from 4 to 18
plot, x, x, xticks=14, xtickv=xtv


; Here's one (unsuccessful) kludge I've tried to fix this bug:
; The following command fixes the range, but adds labels at 3.5 and 18.5, and
; changes the spacing of the minor tick marks at the ends of the axis.

plot, x, x, xticks=16, xtickv=[!X.RANGE(0),xtv,!X.RANGE(1)]


; The following command removes the labels at 3.5 and 18.5, but the minor tick
; marks are still spaced incorrectly at the end of the axis.

plot, x, x, xticks=16, xtickv=[!X.RANGE(0),xtv,!X.RANGE(1)], $
xtickname=[" ",strtrim(xtv,2)," "]



Any comments/workarounds would be appreciated.
Joel Parker
parker@kuylym.gsfc.nasa.gov
[Message index]
 
Read Message
Previous Topic: ARRAYS (correction)
Next Topic: Re: ARRAYS

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 23:02:45 PDT 2025

Total time taken to generate the page: 0.79718 seconds