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

Home » Public Forums » archive » Axes seemingly ignoring xtickinterval
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Axes seemingly ignoring xtickinterval [message #81748] Fri, 12 October 2012 06:13
John Coxon is currently offline  John Coxon
Messages: 15
Registered: February 2012
Junior Member
Hi all,

Bit of an odd problem that I've come across whilst plotting variables
against Julian days on a graph with multiple panels. I've excerpted some
of the panels' plotting code below so as to illustrate my question.

I'm using label_date to plot the bottom (AL and AU) panel, which comes
out at the correct timescale. Since I don't want labels on the other
panels I simply set xtickinterval to 1/24 (an hour). I set xminor to 6
in both cases because I want 10 minute intervals.

The AL/AU panel generates the correct timescale, but every other panel
seems to generate a different, wrong timescale using the code below. It
seems to be shifted to the left by 15 minutes or so (although I could be
reading it wrong). If I include the label_date code in the other panels
they generate the correct timescale but with unwanted labels.

What am I doing wrong? Why is the following code generating two
different timescales for the different panels and how do I stop this? If
the only answer is to switch to using label_date on each panel, how do I
suppress the labels that label_date generates?

Link to PDF of result of plot:
https://dl.dropbox.com/u/3775836/exampleplot.pdf

Thanks,
John




pro ampere_omni,year,month,startDay,endDay,hours = hours

julMajor = double(1.0 / 24.0)
julMinor = 6

date_label = label_date(date_format = ['%H:%I:%S'])

; Set default values for the Julian day start and finish.
jul_min = julday(month,startDay - 1,year,23,00,00)
jul_max = julday(month,endDay + 1,year,01,00,00)

; Override those defaults as necessary.
if keyword_set(hours) then begin
jul_min = julday(month,startDay,year,hours(0),00,00)
jul_max = julday(month,endDay,year,hours(1),00,00)
endif

; Come up with a colour table that defines grey, red and blue.
twolooptable = [[0,211,255,0],[0,211,0,0],[0,211,0,255]]
tvlct,twolooptable

; Define the IMF parameters panel.
plot,[jul_min,jul_max],[-12,12],xtickname = no_labels,xtickinterval =
julMajor,xminor = xMinor,/xstyle,yminor = 5,ytitle = 'IMF
[nT]',ytickinterval = 10,/ystyle,max_value = 9990,position =
[x_pos,y_pos - height * 2,x_pos + width,y_pos - height * 1],/noerase,/nodata

axis,yaxis = 1,yticks = 1,ytickname = [' ',' ',' '],ytitle =
'B!Iy!N/B!Iz!N/B!Imag!N',/ystyle

; Overplot the B values (magnitude, y and z axes).
oplot,omni.julian,omni.B_mag,max_value = 9990,color = 1
oplot,omni.julian,-omni.B_mag,min_value = -9990,color = 1
oplot,omni.julian,omni.B_y,max_value = 9990,color = 3
oplot,omni.julian,omni.B_z,max_value = 9990,color = 2

; Define the solar wind parameters panel, plot the velocity in black.
plot,omni.julian,omni.v_sw,xrange = [jul_min,jul_max],xtickname =
no_labels,xtickinterval = julMajor,xminor = xMinor,/xstyle,yrange =
[300,900],yminor = 4,ytitle = 'v!Isw!N [km/s]',ytickinterval =
200,/ystyle,max_value = 99990,title = startDate_str + ' - ' +
endDate_str + ' in both hemispheres',position = [x_pos,y_pos - height *
1,x_pos + width,y_pos - height * 0]

axis,yaxis = 1,ytitle = 'N!Isw!N' + ' ' + '[protons/cc]',yrange =
[-4,20],ytickinterval = 8,yminor = 4,/ystyle

; Overplot the solar wind density in a different colour
oplot,omni.julian,omni.N_Sw * 25 + 400,max_value = 999 * 25 + 400,color = 3


; Generate a panel that contains the indices (Sym-H, AL and AU).
plot,[0,1],[0,1],position = [x_pos,y_pos - height * 5,x_pos +
width,y_pos - height * 4],xticks = 1,xtickname =
no_labels,/xstyle,yticks = 1,ytickname =
no_labels,/ystyle,/normal,/nodata,ytitle = 'Indices [nT]'

; Plot Sym-H in its own half-panel.
plot,omni.julian,omni.SYMH,yrange = [-110,60],yminor = 2,ytickinterval =
50,/ystyle,xrange = [jul_min,jul_max],xtickname =
no_labels,xtickinterval = julMajor,xminor = xMinor,/xstyle,position =
[x_pos,y_pos - height * 4.5,x_pos + width,y_pos - height * 4]
axis,yaxis = 1,yticks = 1,ytickname = [' ',' ',' '],ytitle = 'Sym-H',/ystyle

; Plot AL and AU in their own half-panel.
plot,omni.julian,omni.AL,yrange = [-1250,750],ytickinterval = 500,yminor
= 2,/ystyle,xrange = [jul_min,jul_max],xtickname = x_labels,xminor =
6,/xstyle,position = [x_pos,y_pos - height * 5,x_pos + width,y_pos -
height * 4.5],xtickformat = ['label_date'],xtickunits =
['hours'],xtickinterval = 1

oplot,omni.julian,omni.AU

axis,yaxis = 1,yticks = 1,ytickname = [' ',' ',' '],ytitle = 'AL &
AU',/ystyle

print,'Program has finished plotting.'

end

--
John Coxon
http://www.chickensinenvelopes.net/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Overlay a coloured boundary on a gray scale image
Next Topic: Create application

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

Current Time: Wed Oct 08 13:42:13 PDT 2025

Total time taken to generate the page: 0.00425 seconds