<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi Adam,</div><div>Now it works like this but as you see in the plot, the colors are not setting correctly (my variables in 1D, y_a1 should have blue,y_b1 gold,y_c1 green same for data2):</div><div><br></div><div dir="ltr">data1 =(/y_a1,y_b1,y_c1/)</div><div dir="ltr"> x = (/1,1.3,1.6/)<br></div><div dir="ltr">plot = gsn_csm_xy(wks,x,data1,res)<br></div><div dir="ltr">data2 =(/y_a3,y_b3,y_c3/)<br></div><div dir="ltr">x2 =(/2,2.3,2.6/) <br></div><div dir="ltr">plot1 = gsn_csm_xy(wks, x2, data2, res)</div><div dir="ltr">res@xyMonoMarkerColor = False</div><div dir="ltr">res@xyMarkerColors = (/"blue",\<br> "gold",\<br> "green"/)<br><br></div></div></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 18 janv. 2019 à 21:51, Adam Phillips <<a href="mailto:asphilli@ucar.edu">asphilli@ucar.edu</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Amal,<div>If I understand you correctly, you're saying that inputting an x-array of dimension size 1 works with a bar chart but not a scatter plot? A short test here shows that turning gsnXYBarChart on and off results in the same error when you input a x-array of dimension size 1:</div><div><div><br></div><div>begin</div><div> f = addfile ("SOI.nc", "r") ; add file</div><div> date = f->yyyymm ; YYYYMM</div><div> dsoik = f->SOI_SIGNAL </div><div> wks = gsn_open_wks ("png", "bar" ) ; send graphics to PNG file</div><div> res = True</div><div> res@gsnXYBarChart = True</div><div> res@gsnXYBarChartBarWidth = 0.25</div><div>res@tiYAxisString = "Oxygen(millimol/m3) and Landing (10e2Ton)" </div><div> res@tmXBLabelAngleF = 70 </div><div>res@tmXBLabelFontHeightF = 0.012</div><div> res@tiMainString = "Oxygen and Landing in Med GSAs"</div><div> res@gsnXYBarChartColors = "blue"</div><div> plots1 = gsn_csm_xy(wks, date(0), dsoik, res)</div><div>end</div></div><div><br></div><div>I get the same error message either way:</div><div>(0)<span style="white-space:pre-wrap"> </span>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.<br></div><div><br></div><div>If you continue to have problems please provide a short, easy-to-run script that highlights the issue for all to see, as well as report which version of NCL you are running.</div><div>Adam</div><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail-m_3900299322722967245gmail_attr">On Fri, Jan 18, 2019 at 1:29 AM Amal Inge <<a href="mailto:amalingenieur89@gmail.com" target="_blank">amalingenieur89@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks Adam, but please have a look at this bar charts plot i did it with the script attached and it works with:<div> res@gsnXYBarChartColors = "blue"</div><div> plots1 = gsn_csm_xy(wks, x, y_a1, res)</div><div> res@gsnXYBarChartColors = "gold"</div><div> plots2 = gsn_csm_xy(wks, x+0.15, y_b1, res)</div><div> res@gsnXYBarChartColors = "green"</div><div> plots3 = gsn_csm_xy(wks, x+0.30, y_c1, res)</div><div> I want to do the same in a scatter plot and to add 2 other y axis.</div><div>I could not recognize my mistake!</div><div><div class="gmail_chip gmail_drive_chip" style="width:396px;height:18px;max-height:18px;background-color:rgb(245,245,245);padding:5px;font-family:arial;font-weight:bold;font-size:13px;border:1px solid rgb(221,221,221);line-height:1"><a href="https://drive.google.com/file/d/1hD9GiUCEqvOsbj7O3a4AxyzkfRK2wx22/view?usp=drive_web" style="display:inline-block;max-width:366px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration-line:none;padding:1px 0px;border:medium none" target="_blank"><img style="vertical-align: bottom; border: medium none;" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png"> <span dir="ltr" style="vertical-align:bottom">dox_AllGSAs_2014landing.eps</span></a><img style="display: none; opacity: 0.55; float: right;"></div><br></div><div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail-m_3900299322722967245gmail-m_3396300573168937487gmail_attr">Le jeu. 17 janv. 2019 à 23:35, Adam Phillips <<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@ucar.edu</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Amal,<div>Looking at your script, line 66 is this:<br>plots1 = gsn_csm_xy(wks,x,y_a1,res)<br></div><div>So NCL is failing on the plot call. Looking at how you are setting x and y_a1:</div><div> y_a1 = dim_avg_n_Wrap(dox_ave_a1,(/1,2/)) <br></div><div>x = (/1/)<br></div><div><br></div><div>NCL returned a list of error messages to you, but the most important one is the first one:</div><div>fatal:CheckArray:Each vector in the caXArray array must have at least 2 elements<br></div><div><br></div><div>Your x array has one element. Assyming y_a1 is a 1D array containing values at each timestep, your input array "x" should contain the times that you want to plot the timeseries against. A typical example of using gsn_csm_xy on an annual timeseries that runs from 1900-2017:</div><div>plot = gsn_csm_xy(wks,ispan(1900,2017,1),tseries,res)</div><div><br></div><div>Hope that helps. If you have any further questions please let the ncl-talk email list know.</div><div>Adam</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail-m_3900299322722967245gmail-m_3396300573168937487gmail-m_-6972833525739972428gmail_attr">On Thu, Jan 17, 2019 at 8:03 AM Amal Inge <<a href="mailto:amalingenieur89@gmail.com" target="_blank">amalingenieur89@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">sorry, this is the error:<div><div>fatal:CheckArray:Each vector in the caXArray array must have at least 2 elements</div><div>fatal:CoordArraysInitialize:caXArray resource is invalid</div><div>fatal:Unable to initialize layer-Can't Create</div><div>fatal:Unable to access object with id:-4</div><div>fatal:PID #-4 can't be found in NhlSetValues</div><div>fatal:Unable to access object with id:-4</div><div>warning:Unable to add DataItem "(null)" to DataList "xyCoordData"</div><div>fatal:CompileDataList:DataList has no valid members</div><div>fatal:Unable to access object with id:-4</div><div>warning:Unable to add DataItem "(null)" to DataList "xyCoordData"</div><div>fatal:CompileDataList:DataList has no valid members</div><div>fatal:Argument type mismatch on argument (0) of (attsetvalues_check) can not coerce</div><div>fatal:["Execute.c":8575]:Execute: Error occurred at or near line 12478 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl</div><div><br></div><div>fatal:["Execute.c":8575]:Execute: Error occurred at or near line 5083 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl</div><div><br></div><div>fatal:["Execute.c":8575]:Execute: Error occurred at or near line 66 in file dox-landing-xy.ncl</div></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail-m_3900299322722967245gmail-m_3396300573168937487gmail-m_-6972833525739972428gmail-m_6732594838883601991gmail_attr">Le jeu. 17 janv. 2019 à 13:37, Amal Inge <<a href="mailto:amalingenieur89@gmail.com" target="_blank">amalingenieur89@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dear NCL experts,<div><br></div><div>I tried this script attached to make a scatter plot with 3 y axis, then I had this error and i did not find my mistake. </div><div>Could you help me please.</div><div>I checked the script scatter_4.ncl to make a 2 regresseion line (one between all dox data and y2 and the second with y3) but i did not understand how to deal with this, it would be nice if you can tell me how.</div><div>exemple of variable:</div><div><div>Variable: y_a1</div><div>Type: float</div><div>Total Size: 4 bytes</div><div> 1 values</div><div>Number of Dimensions: 1</div><div>Dimensions and sizes:<span style="white-space:pre-wrap"> </span>[time | 1]</div><div>Coordinates: </div><div> time: [1402876800..1402876800]</div><div>Number Of Attributes: 7</div><div> _FillValue :<span style="white-space:pre-wrap"> </span>1e+20</div><div> standard_name :<span style="white-space:pre-wrap"> </span>mole_concentration_of_dissolved_molecular_oxygen_in_sea_water</div><div> long_name :<span style="white-space:pre-wrap"> </span>Mole concentration of Dissolved Molecular Oxygen in sea water</div><div> units :<span style="white-space:pre-wrap"> </span>millimol m-3</div><div> _ChunkSizes :<span style="white-space:pre-wrap"> </span>( 1, 22, 84, 161 )</div><div> average_op_ncl :<span style="white-space:pre-wrap"> </span>dim_avg_n over dimension(s): lat,lon</div><div> missing_value :<span style="white-space:pre-wrap"> </span>1e+20</div></div><div><br></div><div>many thanks</div><div>best regards</div><div>amal</div></div></div></div>
</blockquote></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_3900299322722967245gmail-m_3396300573168937487gmail-m_-6972833525739972428gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist, </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_3900299322722967245gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist, </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div>