Re: Rotating a vector plot

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Thu Dec 19 2013 - 13:30:30 MST

Probably the only problem is that to set coordinate arrays for vectors you need to use vfXArray and vfYArray instead of sfXArray and sfYArray (sf indicates ScalarField, vf indicates VectorField)
 -dave

On Dec 19, 2013, at 12:30 PM, rK Aditya <aditya.rk@gmail.com> wrote:

> Dear all,
>
> I am able to rotate a contour plot according to the following example:
>
> http://www.ncl.ucar.edu/Applications/Scripts/rotatedltln_1.ncl
>
> But I am looking a way to rotate a vector plot. I used all the graphic interfaces for streamlines and vector ("gsm_csm_* ). But they are failed to have a similar capability as "gsm_csm_contour_map" does. It seems difficult to rotate a vector then scalar plot, I think.
>
> If you don't mind to direct me to any "resources" or "graphic interfaces" that possibly to rotate a vector, I am very grateful.
>
>
> Thank you for your help.
>
> Kindest regards,
> -r/K-
>
> res = True
> res@gsnMaximize = True ; maxmize plot in frame
>
> res@cnFillOn = True ; turn on color
> res@cnLinesOn = False ; no contour lines
> res@cnLineLabelsOn = False ; no contour labels
>
> res@gsnSpreadColors = True ; use full color map
> res@gsnSpreadColorEnd = -3 ; don't use added gray
>
>
> ;---Turn on tickmarks. 'conditional' prevents more than one tickmark object.
> res@pmTickMarkDisplayMode = "conditional"
>
> res@gsnAddCyclic = False
> res@gsnRightString = ""
>
> ;
> ; Since the Y-Axis of these data goes from north to south, the Y-Axis
> ; needs to be reversed to plot it correctly in a "native" projection.
> ;
> ; res@trYReverse = False
>
> ;
> ; To draw these contours on another map projection, the
> ; 2D (unrotated) lat/lon coordinates are required.
> ;
> res@tfDoNDCOverlay = False ; transform to standard lat/lon
>
> res@sfXArray = lon
> res@sfYArray = lat
>
> ;---Zoom in on map
> res@mpLimitMode = "Corners"
> res@mpLeftCornerLatF = 10 ;lat(nlat-1,0) - 10
> res@mpLeftCornerLonF = 32 ;lon(0,0) -10
> res@mpRightCornerLatF = 30 ;lat(0,nlon-1) + 5
> res@mpRightCornerLonF = 47.5 ; lon(nlat-1,nlon-1) + 10
>
> ;---Regular lat/lon plot when center lat is 0
>
> res@cnFillDrawOrder = "Predraw" ; draw contours first
> res@tiMainString = "velocity (m/s)"
> res@mpDataBaseVersion = "MediumRes" ; use GMT coastline
>
> ; plot = gsn_csm_contour_map(wks,velu(1,:,:),res)
>
> ; plot=gsn_csm_vector_scalar_map_ce(wks,velu(1,:,:),velv(1,:,:),\
> ; tracer(1,:,:),res)
>
> plot=gsn_streamline(wks,velu(1,:,:),velv(1,:,:),res) ; create plot
> end
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Dec 19 13:30:44 2013

This archive was generated by hypermail 2.1.8 : Mon Jan 06 2014 - 13:02:23 MST