[ncl-talk] changing tick marks

Hemming, Michael michael.hemming at mpimet.mpg.de
Sat Jul 26 07:44:36 MDT 2014


Hey everyone,

I am having trouble understanding how to alter tickmarks on a contour plot. I want to change my index numbers on the x and y axis to lat and lon values. I have been trying to use the example given here: http://www.ncl.ucar.edu/Applications/Scripts/tm_2.ncl

Here is my code ( I have only tried altering the second plot out of the 2 e.g. for plot1(1)..):

;----------MPIOM vs. ICON comparison plots



wks = gsn_open_wks("x11","MPIOM_vs_ICON_panelplot_surface")
gsn_define_colormap(wks,"gui_default")


plot1 = new(2,graphic)

res at gsnDraw            = False                    ; don't draw
res at gsnFrame               = False                              ; don't advance frame
resP                = True
res at tiYAxisString           = "Latitude"
res at tiXAxisString           = "Longitude"
resP at txString               = "Surface T averaged for years 01-99"
res at lbOrientation         = "vertical"                ; vertical label bar

res at trXMinF                 = 0                      ; set minimum X-axis value
res at trXMaxF                 = 40                    ; set maximum X-axis value
res at trYMinF                = 0                    ; set minimum Y-axis value
res at trYMaxF                 = 120                    ; set maximum Y-axis value
res at tiMainString           = "MPIOM exp 12"


plot1(0)             = gsn_csm_contour(wks,Tavg(1,:,:),res)


res at trXMinF                 = 0                    ; set minimum X-axis value
res at trXMaxF                = 30                    ; set maximum X-axis value
res at trYMinF                 = 0                    ; set minimum Y-axis value
res at trYMaxF                 = 80                    ; set maximum Y-axis value
res at tiMainString            = "ICON NOSH.UPW"

res at tmXBMode        = "Explicit"
res at tmXBValues      = (/-44.5,-27.5,-5.5,14.5,34.5/)
res at tmXBLabels      = "" + res at tmXBValues
res at tmXBMinorValues = ispan(0,30,1)




plot1(1)             = gsn_csm_contour(wks,potTavg(1,:,:),res)


gsn_panel(wks,plot1,(/1,2/),resP)


I want longitude from -44.5 E to 34.5 W, once I know how to do it for longitude, I can then apply the code to the lat.

thanks in advance!

Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140726/531f708d/attachment.html 


More information about the ncl-talk mailing list