<div dir="ltr"><div class="gmail_default" style="font-size:small">Dear Guigma,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I started looking into this, because I'm the person who has modified the reference line code over the last few years.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Even with the ASCII file, I was still unable to run your script. For starters, you are missing an "end if" at the very end of the script.</div><div class="gmail_default" style="font-size:small"><br>When I fixed this, I was able to get three plots, but didn't get any errors, I then realized it's because the code that does the x reference lines is not being reached at all. This is because year=1996, and the code only executes the reference line if year > 1996. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default">I tried to fudge around this by forcing the XRefLine code to be executed anyway, but then this failed because now both SJ_10 and SJ_15 are strings, which doesn't work for setting an x reference line.</div>
<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Please, in the future, you must provide a clean script that clearly shows the problem, because it is time-consuming for us to fix your code to try to get it to break in the first place.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I finally got it to break by substituting dummy values for gsnXRefLine. You are correct that the error is confusing. This was a bug in NCL V6.4.0 that has since been fixed in NCL V6.5.0, which hasn't been released yet.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">There are a couple of work-arounds. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The first one is to force gsnXRefLine to have the same number of values as you have curves, by duplicating one of your values:</div><div class="gmail_default" style="font-size:small"><br></div>res1@gsnXRefLine=(/SJ_10,SJ_15<div class="gmail_default" style="font-size:small;display:inline">,SJ_15</div>/) ;vertical line for the onset dates <br><div class="gmail_default" style="font-size:small;display:inline"></div>res1@gsnXRefLineColor=(/"Black","grey"<div class="gmail_default" style="font-size:small;display:inline">,"grey"</div>/)<div><br></div><div><div class="gmail_default" style="font-size:small">The second is to add the two lines yourself with gsn_add_polyline. I think the above work-around is easier!</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The reason this error message is showing up is because originally, the reference lines were meant to be created one-per-curve. In NCL 6.4.0 the reference line code was overhauled for other reasons, and the restriction got added back in inadvertently.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">My apologies for the inconvenience. Let ncl-talk know if the work-around doesn't fix your issue.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 10, 2018 at 3:13 AM, Kiswendsida Hyacinthe GUIGMA via ncl-talk <span dir="ltr"><<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:verdana,helvetica,sans-serif;font-size:16px"><div id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_5351">Dear Rick,</div><div id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_5572" dir="ltr">as I said the reference lines I would like to plot are vertical: I set some values of x. <br></div><div id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_5573" dir="ltr">But as you noted, it is quit confusing because I used <span id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_5672">gsnXRefLine but in the error description NCL is using </span><span id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_5673">gsnYRefLine!!!</span></div><div id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_5739" dir="ltr"><span id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_6079">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 </span><span id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_6080">gsnXRefLine. When I set res1@gsnXRefLine=(/SJ_10,SJ_<wbr>15/) I have a 1D array of length 2 that was allowing me to have these 2 vertical lines. <br></span></div><div id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_6355" dir="ltr"><span id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_6385">So what I think it is that NCL is interpreting my </span><span id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_6390">gsnXRefLine as </span><span id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_6391">gsnYRefLine. If it is so, could you suggest me any solution.</span></div><div id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_6644" dir="ltr"><br><span id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_6391"></span></div><div id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_6677" dir="ltr"><span id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_6391">Kindest regards<br></span></div><div id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_6442" dir="ltr"><br><span id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_6391"></span></div><div id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_6633" dir="ltr"><span id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_6391">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.<br></span></div><div id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_5284"><span></span></div><div id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_5579"> </div><div id="m_8690198600824684696yui_3_16_0_ym19_1_1515573291997_5580" class="m_8690198600824684696signature">-----------------------------<br>GUIGMA</div><div><div class="h5"> <div class="m_8690198600824684696qtdSeparateBR"><br><br></div><div style="display:block" class="m_8690198600824684696yahoo_quoted"> <div style="font-family:verdana,helvetica,sans-serif;font-size:16px"> <div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,Sans-Serif;font-size:16px"> <div dir="ltr"><font size="2" face="Arial"> On Tuesday, 9 January 2018, 14:58, Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>> wrote:<br></font></div> <br><br> <div class="m_8690198600824684696y_msg_container"><div id="m_8690198600824684696yiv2000427597"><div><div dir="ltr"><div><div><div><div>Hi,<br clear="none"><br clear="none"></div>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 gsn<span style="color:rgb(255,0,0)">Y</span>RefLine or gsn<span style="color:rgb(255,0,0)">X</span>RefLine 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.<br clear="none"><br clear="none"></div>Given these lines below, I would surmise the data's leftmost dimension is of length 3 -- try using printVarSummary on those variables to verify:<br clear="none"><br clear="none">; xy plot<br clear="none">x_regrid_SJ_xy=x_regrid_SJ({<span style="color:rgb(255,0,0)">5:<wbr>15:5}</span>,:)<br clear="none"><br clear="none">res1 = True ; plot mods desired<br clear="none">res1@tiMainString = "lat-plot "+tostring(year) <br clear="none">res1@xyLineThicknesses = (/<span style="color:rgb(255,0,0)">1.0,1.0,1.0/</span>) <br clear="none">res1@xyLineColors = (/"<span style="color:rgb(255,0,0)">blue","green","red"</span>/) <wbr> ; change line color<br clear="none"><br clear="none"></div>Hope that helps...<br clear="none"></div>Rick<br clear="none"></div><div class="m_8690198600824684696yiv2000427597gmail_extra"><br clear="none"><div class="m_8690198600824684696yiv2000427597gmail_quote">On Tue, Jan 9, 2018 at 4:16 AM, Kiswendsida Hyacinthe GUIGMA via ncl-talk <span dir="ltr"><<a rel="nofollow" shape="rect" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>></span> wrote:<br clear="none"><blockquote class="m_8690198600824684696yiv2000427597gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_8690198600824684696yiv2000427597yqt7756562387" id="m_8690198600824684696yiv2000427597yqt63822"><div><div style="color:#000;background-color:#fff;font-family:verdana,helvetica,sans-serif;font-size:16px"><div id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_3034"><span id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_3070">Hello dear NCL users,</span></div><div dir="ltr" id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_3050"><span id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_3058">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. </span></div><div dir="ltr" id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_3133"><span id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_3058">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:</span></div><div dir="ltr" id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_4832"><span id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_3058">" ref_line_interp: error: gsnYRefLine must be a scalar or an array of length ncurves". However when I print res@gsnXRefLine it gives me this: <br clear="none"></span></div><div dir="ltr" id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_4934"><span id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_3058">(0) 42179<br id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_4939" clear="none">(1) 42197</span></div><div dir="ltr" id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_4969"><span id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_3058">which proves that they are scalars.</span></div><div dir="ltr" id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_4970"><span id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_3058">Can anyone please help me?</span></div><div dir="ltr" id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_4971"><span id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_3058">Please have a look at my code. <br clear="none"></span></div><div dir="ltr" id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_4972"><br clear="none"><span id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_3058"></span></div><div dir="ltr" id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_4973"><span id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_3058">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?<br clear="none"></span></div><div id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_3049"><div id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_4996"> </div><div id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_5079">Thank you in advance. <br clear="none"></div><div id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_5008"><br clear="none"></div></div><div class="m_8690198600824684696yiv2000427597m_-2011562530845677968signature" id="m_8690198600824684696yiv2000427597m_-2011562530845677968yui_3_16_0_ym19_1_1515495507640_3114">-----------------------------<br clear="none">GUIGMA</div></div></div></div><br clear="none">______________________________ _________________<br clear="none">
ncl-talk mailing list<br clear="none">
<a rel="nofollow" shape="rect" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br clear="none">
List instructions, subscriber options, unsubscribe:<br clear="none">
<a rel="nofollow" shape="rect" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/ mailman/listinfo/ncl-talk</a><br clear="none">
<br clear="none"></blockquote></div><br clear="none"></div></div></div><br><br></div> </div> </div> </div></div></div></div></div><br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>