begin ; ; Create some dummy data for the contour plot. ; N=12 T = new((/N,N/),float) jspn = ispan(-N/2,(N/2)-1,1)^2 ispn = ispan(-N/2,(N/2)-1,1)^2 do i = 0, dimsizes(ispn)-1 T(i,:) = ispn(i) + jspn end do T = 100.0 - sqrt(8^2 * T) ; ; Define an array of randomly spaced pressure values. These are the ; values that we want to go on the right Y axis. ; pressure = (/1000, 925, 875, 800, 700, 575, 450, 350, 200, 175, 75, 50/) ; ; Create an X workstation. ; wid = create "xwid" ncgmWorkstationClass defaultapp end create ; ; Create a data object. ; dataid = create "contourdata" scalarFieldClass defaultapp "sfDataArray": T end create ; ; Create an XY plot. ; plotid = create "contour" contourPlotClass wid "cnScalarFieldData" : dataid "tmYUseLeft" : False ; Don't use tick marks on the right side ; that are used on left side. "tmYRMode" : "Explicit" ; Explicitly define where we want tick ; marks and what labels we want at them. ; ; Place the pressure values at equal intervals along the right Y axis. ; Note that the pressure values themselves are NOT equally spaced, but ; they will be placed at equal intervals on the axis. ; "tmYRValues" : fspan(0.,N-1,dimsizes(pressure)) "tmYRLabels" : pressure "tmYRLabelsOn" : True ; We have to turn on labels for the right axes, ; otherwise they won't appear. end create draw(plotid) ; Draw the contour plot. ; ; Create a text item to label the left Y axis. ; txid = create "text" textItemClass wid "txPosXF" : 0.12 ; X pos. of text "txPosYF" : 0.50 ; Y pos. of text "txFontHeightF" : 0.02 ; Change the size of the font. "txAngleF" : 90.0 ; Rotate the text 90 deg. counter-clockwise. "txString" : "Height (km)" end create draw(txid) ; Draw the text item. ; ; Change some values of previous text item to create a new label for ; the right Y axis. ; setvalues txid "txPosXF" : 0.91 ; X pos. of text (use same Y position as before) "txAngleF" : -90.0 ; Rotate the text 90 deg. clockwise "txString" : "Pressure (mb)" end setvalues draw(txid) ; Draw the text item. frame(wid) ; Advance the frame end