Re: two different axes

From: ahmed lasheen <ahmed4kernel_at_nyahnyahspammersnyahnyah>
Date: Thu Feb 17 2011 - 10:00:23 MST

thanks for your nice replay, this remarks make it works.

On Thu, Feb 17, 2011 at 6:30 PM, Mary Haley <haley@ucar.edu> wrote:

> You are calling gsn_csm_x2y2 with (x1,y1,x2,y2):
>
> (...x_jacopi,y_jacopi,x_gauss,y_gauss)
>
> it should be (x1,x2,y1,y2):
>
> (...x_jacopi,x_gauss,y_jacopi,y_gauss)
>
> Also, you need to fix these two lines::
>
> res1@trYMaxF = min(y_jacopi)
> res2@trYMaxF = min(y_gauss)
>
> to be "max", not "min":
>
> res1@trYMaxF = max(y_jacopi)
> res2@trYMaxF = max(y_gauss)
>
> --Mary
>
> On Feb 17, 2011, at 2:13 AM, ahmed lasheen wrote:
>
> Hello,
> i am trying to plot two ASCII files on the same window , each file has two
> column data.
> due to the difference of the dimension in two files ,i have used the
> interface gsn_csm_x2y2
> but i still have the following error
> * (0) gsn_csm_xy: Fatal: X and Y must have the same dimensions sizes, or
> one must be one-dimensional and both have the same rightmost dimension.*
> *warning:TransInitialize: Zero Y coordinate span: defaulting:[errno=1104]*
> *(0) gsn_csm_xy: Fatal: X and Y must have the same dimensions sizes, or
> one must be one-dimensional and both have the same rightmost dimension.*
> *warning:TransInitialize: Zero Y coordinate span: defaulting:[errno=1104]*
>
>
> here is the ncl file
>
> ;*************************************************
> ; gsn_xy_1.ncl
> ;*****************************************************************
> 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")
> x_jacopi = data_jacopi(:,0)
> y_jacopi = data_jacopi(:,1)
> x_gauss = data_gauss(:,0)
> y_gauss = data_gauss(:,1)
>
> ;**************************************************
> ; create plot
> ;**************************************************
> res1 = True ; plot mods desired
> res1@trXMinF = min(x_jacopi)
> res1@trXMaxF = max(x_jacopi)
> res1@trYMinF = min(y_jacopi)
> res1@trYMaxF = min(y_jacopi)
> res1@tiMainString = "relaxation error" ; title
> res1@tiYAxisString = "error" ; y axis title
> res1@tiXAxisString = "number of iteraion" ; X axis title
> res1@xyLineColor = (/"red"/) ; control the line colors.
>
> res2 = True
> res2@trXMinF = min(x_gauss)
> res2@trXMaxF = max(x_gauss)
> res2@trYMinF = min(y_gauss)
> res2@trYMaxF = min(y_gauss)
>
>
> wks = gsn_open_wks("x11","gsn_xy") ; Open an ps workstation.
> ; plot = gsn_csm_xy(wks,x_jacopi,y_jacopi,res) ; Draw an XY plot with 1
> curve.
> plot = gsn_csm_x2y2(wks,x_jacopi,y_jacopi,x_gauss,y_gauss,res1,res2)
>
> end
> ~
> i have attached the data files
> thanks in advance
> --
> ===============
> Ahmed Lasheen
> Junior researcher at Cairo Numerical Weather Prediction Center (CNWPC)
> Egyptian Meteorological Authority(EMA)
> Cairo,Egypt
> ===============
>
> <gauss.error><jacopi.error>
> _______________________________________________
> 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 Thu Feb 17 10:01:48 2011

This archive was generated by hypermail 2.1.8 : Thu Feb 17 2011 - 22:00:17 MST