<div dir="ltr">Hi Alan,<div>I have checked in a fix for this problem. I will caution however that the fix is only good because the numbers are still resolvable (barely) with 4-byte floating point numbers. If the spacing between the numbers that define the X-Axis coordinate is decreased or their magnitude is increased then the issue may reappear. More robust fixes are possible but will require quite a bit more work.</div><div><br></div><div>A work-around is to subtract a uniform offset  (as large as possible) from the coordinates, and then use explicit tick mark labels to put the original values back into the plot. </div><div> -dave</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 23, 2017 at 11:20 AM, David Brown <span dir="ltr">&lt;<a href="mailto:dbrown@ucar.edu" target="_blank">dbrown@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Alan,<div>I will look into this.</div><div> -dave</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, May 22, 2017 at 3:36 PM, Alan Brammer <span dir="ltr">&lt;<a href="mailto:abrammer@albany.edu" target="_blank">abrammer@albany.edu</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div style="word-wrap:break-word">Hey NCL devs,<div><br></div><div>I’ve come across a sometimes avoidable but easily reproducible bug, that seems to still exist in 6.4.0 </div><div><br></div><div>Basically when a polyline is added to a plot with an axis on the order of time units (e.g. &quot;hours since 1800”  or  &gt; 1e6 ) and extends beyond the x limits of the plot,  it looks like the polyline function truncates the end of the lines erroneously.  </div><div>And then I just kind of broke it completely with the last plot.  </div><div><br></div><div>Couldn’t work out if the error is occurring in NhlAddPrimitive or in the create polytype section. </div><div><br></div><div>Simple example script inline below with the output plots attached. </div><div><br></div><div><br></div><div>Alan</div><div><br></div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;</div><div><div><br></div><div><div>wks = gsn_open_wks(&quot;png&quot;,&quot;polyline_e<wbr>rror&quot;)</div><div><br></div><div>times := fspan(1881552, 1881984, 73)</div><div>times@units = &quot;hours since 1800-01-01&quot;</div><div><br></div><div>stime = times(8)</div><div>ltime = times(50)</div><div><br></div><div>res := True</div><div>res@gsnDraw = False</div><div>res@gsnFrame = False</div><div>res@trXMinF = stime</div><div>res@trXMaxF = ltime</div><div><br></div><div>x := times</div><div>y := sin(x) +4.</div><div>res@trYMaxF = max(y)</div><div>res@trYMinF = min(y)</div><div><br></div><div>;;;; .000001.png</div><div>plot = gsn_csm_blank_plot(wks, res)</div><div>line = gsn_add_polyline(wks, plot, x, y, False)</div><div>draw(plot)</div><div>frame(wks)</div><div><br></div><div>;;;; .000002.png</div><div>res@trXMinF = stime</div><div>res@trXMaxF = times(15)</div><div>plot = gsn_csm_blank_plot(wks, res)</div><div>line = gsn_add_polyline(wks, plot, x, y, False)</div><div>draw(plot)</div><div>frame(wks)</div></div></div><div><br></div><div><br></div><div>; oh jeez,   it gets worse. </div><div>;;;; .000003.png</div><div><div>res@trYMinF = min(y)+0.00001    ;; trim just the very very bottom off the plot and watch all hell break lose. </div><div>plot = gsn_csm_blank_plot(wks, res)</div><div>line = gsn_add_polyline(wks, plot, x, y, False)</div><div>draw(plot)</div><div>frame(wks)</div></div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;</div><div><br></div><div><img id="m_2937899026386158851m_5987580027909153069C1F47FDF-659F-4819-A5E7-C58C3ADAAA12" src="cid:BF245268-C77B-4F62-837D-F0FA9F6CD324@eas.albany.edu"></div><div><img id="m_2937899026386158851m_5987580027909153069A5FF48E2-CCFD-4BBA-8C58-39A37DB16A61" src="cid:B9815ABD-0CCF-4E74-8F0D-99B5F831BE0C@eas.albany.edu"></div><div><img id="m_2937899026386158851m_59875800279091530698DF69526-2D0C-4128-9D02-F63BC9696D25" src="cid:3FC9420C-BB28-4B8B-921B-BCC7F3A4AA15@eas.albany.edu"></div><div><br></div><div><br></div><div><br></div><div><br></div></div><br></div></div>______________________________<wbr>_________________<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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>