When posting to ncl-talk, it is very helpful if the
information from 'printVarSummary' is included.
eg: printVarSummary(tar)
--
TAR = tar(height|:,time|:)
plot TAR and height will be the ordinate and time the abscissa.
Good luck
On 7/18/13 6:10 AM, Katja Lohmüller wrote:
> Hello NCL-talk,
>
> I'm trying to create a contour plot with the variable time on the
> abscissa and height on the ordinate. The contours represent the target
> classification of cloud particles.
> My problem is now that the variable target classification is
> predefined as target_classification(time,height) so that ncl
> automatically puts time on the ordinate and height on the abscissa. So
> it's exactly the opposite from what I want to print.
> So my question is now if there's a fuction existing which switches the
> axes or how can I solve this problem. A big thing is that my data is
> present in a .nc and I don't know how to handle it.
> Thank you for your help
>
> My code is as follows:
>
>
> ;************************************************************
> ; Target Classification 2D
> ;************************************************************
>
> ;************************************************************
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> ;************************************************************
>
> begin
>
> a=addfile("/localdata/Lohmueller/BA/Daten_Lindenberg/Classification/20130101_lindenberg_classification.nc",
> "r")
>
> time=a->time
> tar=a->target_classification
> height=a->height
>
> ;print(tar(2,:))
>
>
>
> wks= gsn_open_wks("pdf","Target")
>
>
> slice=tar(:,:)
>
>
> ;printVarSummary(slice)
>
> ;print(slice(2,:))
>
> gsn_define_colormap(wks,"BkBlAqGrYeOrReViWh200")
>
>
> res = True
>
> res@gsnMaximize = True
> res@gsnPaperOrientation = "landscape"
> res@cnFillOn = True
> ;res@cnCellFillEdgeColor = "black"
> res@cnFillMode = "CellFill"
> res@cnLinesOn = False
> res@cnLineLabelsOn = False
> res@cnLevelSelectionMode = "ManualLevels" ; set manual
> contour levels
>
> res@lbLabelAlignment = "BoxCenters"
> res@cnMinLevelValF = 0.1 ; set the minimum contour level
> res@cnMaxLevelValF = 10 ; set the maximum contour level
> res@cnConstFLabelConstantSpacingF = 1
> res@cnFillColors =
> (/201,20,38,54,71,91,102,119,134,156,170,180/) ; set the
> colors to be used
> res@cnLevelSpacingF = 1
>
>
> res@lbLabelAutoStride = True
> res@lbPerimOn = False
> res@lbLabelStride = 2
>
>
> res@tiMainString = ""
>
> res@trGridType = "TriangularMesh"
>
>
> contour = gsn_csm_contour(wks,slice,res)
>
> end
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jul 18 06:32:13 2013
This archive was generated by hypermail 2.1.8 : Fri Jul 19 2013 - 15:39:06 MDT