Re: changing/swapping axis

From: Karin Meier-Fleischer <meier-fleischer_at_nyahnyahspammersnyahnyah>
Date: Thu Jun 19 2014 - 03:49:00 MDT

Hi Michael,

you should swap profile and data in the plot call:

plot = gsn_csm_xy(wks,data,profile,res)

Bye,
Karin
(Michael: Sorry for not answering yesterday, but I'm out of office this
week.)


Am 19.06.14 11:01, schrieb Hemming, Michael:
> Hello,
>
> I want to simply swap the x with the y axis (to have depth on y axis)
> and I can't find code to use anywhere on the website or searching
> google, can someone help me?
>
> Here is my code:
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
> ;-------------------------------------Temperature------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> ;--------------MPIOM profiles
>
> ;----------Coordinate 1
>
> data12 = addfile
> ("sector_icon_lr_12_mpiom_tho_ym_0000-0099.nc", "r")
>
> tho = data12->tho
>
> data = new((/3,dimsizes(tho&depth)/),float)
>
> data(0,:) = tho(1,:,{-30},{-48})
> data(1,:) = tho(10,:,{-30},{-48})
> data(2,:) = tho(50,:,{-30},{-48})
>
> variables = getfilevarnames(data12)
> print(variables)
>
> wks = gsn_open_wks("x11", "T_Profile_48W30S")
>
> res = True
> res@xyLineColors = (/"blue","red","green"/) ; change
> line color
> res@xyLineThicknesses = (/2.0,2.0,2.0/)
> res@xyDashPattern = 0
> res@pmLegendDisplayMode = "Always"
> res@lgPerimOn = False
> res@lgLabelFontHeightF = .015
> res@pmLegendHeightF = 0.1
> res@xyExplicitLegendLabels = (/"t = 1","t = 10","t = 50"/)
> res@tiMainString = "Temperature with depth at 30S 48W for
> different times"
>
> profile = (/tho&depth/)
>
> plot = gsn_csm_xy(wks,profile,data,res)
>
>
>
>
> thanks,
> Michael
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

--
Dipl. Geophys. Karin Meier-Fleischer
Application Support, Visualization

Deutsches Klimarechenzentrum GmbH E-Mail: meier-fleischer@dkrz.de
Bundesstrasse 45a Internet: http://www.dkrz.de/
20146 Hamburg Phone: +49 (0)40 460094 126
Germany Fax: +49 (0)40 460094 270

Gesch�ftsf�hrer: Prof. Dr. Thomas Ludwig
Sitz der Gesellschaft: Hamburg
Amtsgericht Hamburg HRB 39784



_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk


Received on Thu Jun 19 09:49:12 2014

This archive was generated by hypermail 2.1.8 : Wed Jul 23 2014 - 15:33:46 MDT