Re: two different axes

From: ahmed lasheen <ahmed4kernel_at_nyahnyahspammersnyahnyah>
Date: Sat Feb 19 2011 - 06:28:24 MST

thanks ,here is the code, it is working
; ***********************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
;************************************************
begin
  data_jacopi = asciiread("jacopi.error",(/584,2/),"float")
  data_gauss = asciiread("gauss.error",(/301,2/),"float")

  xjacopi =data_jacopi(:,0)
  yjacopi =data_jacopi(:,1)

  xgauss =data_gauss(:,0)
  ygauss =data_gauss(:,1)

 n1 = dimsizes(yjacopi)
 n2 = dimsizes(ygauss)
 N = max( (/n1,n2/) )

 xx = new((/2,N/),typeof(yjacopi))
 yy = new((/2,N/),typeof(ygauss))

 xx(0,0:n1-1) = (/ xjacopi /)
 yy(0,0:n1-1) = (/ yjacopi /)
 xx(1,0:n2-1) = (/ xgauss /)
 yy(1,0:n2-1) = (/ ygauss /)
print(xx)

;;>>>>>>>>>plotting commands<<<<<<<<<<<<<<<<<<<
 wks = gsn_open_wks ("pdf","xy") ; open workstation
 res = True ; plot mods desired
 res@tiMainString = "relaxaion methodes" ; add title
 res@xyLineColors = (/"blue","red"/) ; change line color

 plot = gsn_csm_xy (wks,xx,yy,res) ; create plot

end

On Fri, Feb 18, 2011 at 3:55 PM, Dennis Shea <shea@ucar.edu> wrote:

> Use something like Example 2 at
> http://www.ncl.ucar.edu/Applications/xy.shtml
>
> x1[*], y1[*]
> x2[*], y2[*]
> n1 = dimsizes(y1)
> n2 = dimsizes(y2)
> N = max( (/n1,n2/) )
>
> xx = new((/2,N/),typeof(y1))
> yy = new((/2,N/),typeof(y1))
>
> xx(0:n1-1) = (/ x1 /)
> yy(0:n1-1) = (/ y1 /)
> xx(0:n2-1) = (/ x2 /)
> xx(0:n2-1) = (/ y2 /)
>
> ;************************************************
> wks = gsn_open_wks ("ps","xy") ; open workstation
>
> res = True ; plot mods desired
> res@tiMainString = "Mulitple XY plot" ; add title
> res@xyLineThicknesses = (/1.0,2.0/) ; specify thickness
> res@xyLineColors = (/"blue","red"/) ; change line color
> ;res@tiMainString = "..."
> ;res@gsnLeftString = "..."
> ;res@gsnCenterString = "..."
> ;res@gsnRightString = "..."
>
> plot = gsn_csm_xy (wks,xx,yy,res) ; create plot
>
>
>
> On 2/18/11 2:27 AM, ahmed lasheen wrote:
>
>> can NCL plot the two drawing on the same x axis , the difference is that
>> jacopi.error file has 583 number and gauss.error file has 300 number.
>> i do it in gnuplot and i have attached it .
>>
>> On Fri, Feb 18, 2011 at 7:37 AM, ahmed lasheen <ahmed4kernel@gmail.com
>> <mailto:ahmed4kernel@gmail.com>> wrote:
>>
>> thanks so much
>>
>>
>> On Fri, Feb 18, 2011 at 12:13 AM, Mohamad Ibrahim OMAR
>> <egy_mohamad@yahoo.com <mailto:egy_mohamad@yahoo.com>> wrote:
>>
>> Hi, Ahmed
>> you have an error in writing the gsn_csmx2y2 order it must be
>> plot =
>> gsn_csm_x2y2(wks,x_jacopi,x_gauss,y_jacopi,y_gauss,res1,res2)
>> instead of
>> plot =
>> gsn_csm_x2y2(wks,x_jacopi,y_jacopi,x_gauss,y_gauss,res1,res2)
>> and some lines I changed for resources you can check them and I
>> attached the script
>> Regards
>>
>> Mohamed Ibrahim El-Sayed OMAR
>>
>> Egyptian Meteorological Authority
>>
>> Scientific Research Department
>>
>> Climate Studies Centre
>> Kobry El-Quobba, P.O.Box. 11784
>> Cairo, EGYPT
>>
>> Mobil phone : 002 0160802805
>> Home Phone : 002 0482370261
>>
>>
>>
>>
>>
>>
>> --
>> ===============
>> Ahmed Lasheen
>> Junior researcher at Cairo Numerical Weather Prediction Center (CNWPC)
>> Egyptian Meteorological Authority(EMA)
>> Cairo,Egypt
>> ===============
>>
>>
>>
>>
>> --
>> ===============
>> Ahmed Lasheen
>> Junior researcher at Cairo Numerical Weather Prediction Center (CNWPC)
>> Egyptian Meteorological Authority(EMA)
>> Cairo,Egypt
>> ===============
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>

-- 
===============
Ahmed Lasheen
Junior researcher at Cairo Numerical Weather Prediction Center (CNWPC)
Egyptian Meteorological Authority(EMA)
Cairo,Egypt
===============

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Feb 19 06:29:14 2011

This archive was generated by hypermail 2.1.8 : Wed Feb 23 2011 - 16:47:57 MST