[ncl-talk] Ref line problem

Kiswendsida Hyacinthe GUIGMA karongseba at gmail.com
Wed Jan 10 02:13:18 MST 2018


Dear Rick,as I said the reference lines I would like to plot are vertical: I set some values of x. 
But as you noted, it is quit confusing because I used gsnXRefLine but in the error description NCL is using gsnYRefLine!!!Concerning the dimensions, it is true that the leftmost dimension length is 3 but this is to have 3 different lines (actually each line represents one single latitude). The x-axis being the time, what I would like is to set 2 specific time values. And this is something which was possible in my previous scripts by affecting these values to gsnXRefLine. When I set res1 at gsnXRefLine=(/SJ_10,SJ_15/) I have a 1D array of length 2 that was allowing me to have these 2 vertical lines. 
So what I think it is that NCL is interpreting my gsnXRefLine as gsnYRefLine. If it is so, could you suggest me any solution.
Kindest regards

PS: I am attaching the data, the txt file(which was missing) and the code itself. To that I add a plot that I did by the past(and which was working perfectly) to explain you what is the expected result.
 -----------------------------
GUIGMA 

    On Tuesday, 9 January 2018, 14:58, Rick Brownrigg <brownrig at ucar.edu> wrote:
 

 Hi,

I was unable to run your script because it depends upon an ascii file that was not included. I'm also a bit confused about whether its gsnYRefLine or gsnXRefLine at issue, as only the later is referenced in your script. Assuming its the later, it is not actually a scalar, but a 1D array of length 2. It needs to be of the same size as the left-most dimensions of your data arrays: x_regrid_SJ_xy&time, x_regrid_SJ_xy.

Given these lines below, I would surmise the data's leftmost dimension is of length 3 -- try using printVarSummary on those variables to verify:

; xy plot
x_regrid_SJ_xy=x_regrid_SJ({5:15:5},:)

res1 = True                      ; plot mods desired
res1 at tiMainString = "lat-plot "+tostring(year)  
res1 at xyLineThicknesses = (/1.0,1.0,1.0/)         
res1 at xyLineColors      = (/"blue","green","red"/)          ; change line color

Hope that helps...
Rick

On Tue, Jan 9, 2018 at 4:16 AM, Kiswendsida Hyacinthe GUIGMA via ncl-talk <ncl-talk at ucar.edu> wrote:

Hello dear NCL users,I am running a NCL script and I am facing a error that I don't understand at all. Actually the script was working perfectly and then it stopped for a reason I ignore. Actually I am doing a simple xy-plot (with the gsn_csm_xy) and I want to add two reference lines (vertically). But I got the following error:" ref_line_interp: error: gsnYRefLine must be a scalar or an array of length ncurves". However when I print res at gsnXRefLine it gives me this: 
(0)     42179
(1)     42197which proves that they are scalars.Can anyone please help me?Please have a look at my code. 

I'd just like to mention that I have upgraded my NCL from  version 6.0.0 to 6.4.0. Could that be the problem?
 Thank you in advance. 

-----------------------------
GUIGMA
______________________________ _________________
ncl-talk mailing list
ncl-talk at ucar.edu
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/ mailman/listinfo/ncl-talk





   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180110/ca1e889a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: onset_x.nc
Type: application/octet-stream
Size: 183460 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180110/ca1e889a/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: SJ_in.txt
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180110/ca1e889a/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SJ_onset.ncl
Type: application/octet-stream
Size: 6406 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180110/ca1e889a/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lat-plot2015.png
Type: image/png
Size: 60946 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180110/ca1e889a/attachment.png>


More information about the ncl-talk mailing list