plotting irregular x-axis

From: Nick Guy <nick.guy_at_nyahnyahspammersnyahnyah>
Date: Wed Nov 07 2012 - 13:44:06 MST

Hi,

I am trying to output a contour plot with irregular spacing along the X (time) axis. I continue to receive the below error:
warning:IrTransInitialize: error creating spline approximation for trXCoordPoints; defaulting to linear
warning:ComputeMinorTickMarks: The distance between major tickmarks is so close or so far apart that arithmetic error may cause problems determining the accurate locations of minor tickmarks
warning:ComputeMinorTickMarks: The distance between major tickmarks is so close or so far apart that arithmetic error may cause problems determining the accurate locations of minor tickmarks
warning:ContourPlotSetValues: current transformation requires trYMaxF to be within data coordinate range: resetting
warning:_NhlCreateSplineCoordApprox: Attempt to create spline approximation for X axis failed: consider adjusting trXTensionF value

I've found the archived discussions and examples talking about converting irregular axes to linear and tried a couple different things. Any help to figure out how to fix this would be wonderful!

=====ATTEMPT WITH LABEL VIA TIME_AXIS_LABELS=======
  TAx=fspan(min(TimeAx),max(TimeAx),50)
  res1A=True
  res1A@gsnDraw=False ; Don't draw plot , do this with the panel
  res1A@gsnFrame=False ; Don't advance frame
  res1A@cnFillOn=True ; Turn on filled contours
  res1A@cnLinesOn=True
  res1A@cnLineLabelsOn=True

  res1A@gsnSpreadColors=True
  res1A@gsnLeftStringFontHeightF=.03 ; Shrink the label
  res1A@gsnRightStringFontHeightF=.03
  res1A@gsnXAxisIrregular2Linear=True

  res1A@lbOrientation="Vertical" ; Vertical colorbar
  res1A@vpWidthF=1. ; Make the plot longer
  res1A@vpHeightF=0.7 ; Make the plot shorter

  res1A@tiXAxisString="" ; No x-axis title
  res1A@tiYAxisString="Pressure (hPa)" ; Define Y-Axis title
  res1A@trYReverse=True ; Reverse the y-axis
  res1A@trYMinF=300. ; Set min Y plot range
  res1A@trYMaxF=1025. ; Set the max Y plot range
  res1A@tmXBLabelsOn=True

  restime=True
  restime@ttmAxis="XB"
  restime@ttmFormat="%H:%M"
  restime@ttmMajorStride=10

  time_axis_labels(TimeAx,res1A,restime)
  panPlot1(0)=gsn_csm_contour(wksPan1,transpose(Temp),res1A)
====================================================

and also setting your axis to irregular and defining the

======ATTEMPT DEFINING AXIS==========================
  res1B=True
  res1B@gsnDraw=False ; Don't draw plot , do this with the panel
  res1B@gsnFrame=False ; Don't advance frame
  res1B@cnFillOn=True ; Turn on filled contours
  
  res1B@gsnSpreadColors=True
  res1B@gsnLeftStringFontHeightF=.03 ; Shrink the label
  res1B@gsnRightStringFontHeightF=.03

  res1B@lbOrientation="Vertical" ; Vertical colorbar
  res1B@vpWidthF=1. ; Make the plot longer
  res1B@vpHeightF=0.7 ; Make the plot shorter

  res1B@tiXAxisString=" " ; No x-axis title
  res1B@tiYAxisString="Pressure (hPa)" ; Define Y-Axis title
  res1B@trYReverse=True ; Reverse the y-axis
  res1B@trYMinF=300. ; Set min Y plot range
  res1B@trYMaxF=1025. ; Set the max Y plot range

  res1B@sfXArray=TimeAx
  res1B@trXAxisType="Irregular"
  res1B@trXCoordPoints=TimeAx
; res1B@tmXB
  panPlot1(1)=gsn_csm_contour(wksPan1,transpose(RH),res1B)
====================================================

Thanks!

Nick Guy
nick.guy@noaa.gov

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Nov 7 13:44:18 2012

This archive was generated by hypermail 2.1.8 : Tue Nov 13 2012 - 14:27:24 MST