<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Ehsan,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">There are a few issues with your script:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">1. When plotting against time that is in YYYYMM/YYYYMMDD/YYYYMMDDHH type of format, it is best to use one of our "yyyymmxxx_to_yyfrac" routines to create a fractional year array, and then you can plot against this array. In your case, I did this:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><div class="gmail_default" style="font-size:small"><span style="white-space:pre">     </span>yfrac = yyyymmdd_to_yyyyfrac (toint(date),0)</div><div style="font-size:small"><br></div><div style="font-size:small">and then plotted against yfrac.</div><div style="font-size:small"><br></div><div style="font-size:small">2. Once you've done #1, then labeling the X axis would look something like this:</div><div style="font-size:small"><br></div><div><div><font face="monospace, monospace"><span style="white-space:pre">       </span>mmdd            = str_get_cols(date,4,5) + "/" + str_get_cols(date,6,7)</font></div><div><font face="monospace, monospace"><span style="white-space:pre">        </span>resL@tmXBMode   = "Explicit" ; explicit labels                                       </font></div><div><font face="monospace, monospace"><span style="white-space:pre">  </span>resL@tmXBValues = yfrac(::2)    ; only label every other tick mark                                                                      </font><span style="font-family:monospace,monospace">resL@tmXBLabels = mmdd(::2)</span></div></div><div><br></div><div><br class="gmail-Apple-interchange-newline"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">3. To avoid all of these warnings:</span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><div style="background-color:rgb(255,255,255)"><font face="monospace, monospace">warning:tofloat: A bad value was passed to (string) tofloat, input strings must contain numeric digits, replacing with missing value</font></div><div style="background-color:rgb(255,255,255);font-size:small"><br></div><div style="background-color:rgb(255,255,255);font-size:small">which are occurring because you are trying to convert "" to a float, you want to replace all the "" with missing values using str_sub_str, and then convert it to float:</div><div style="background-color:rgb(255,255,255);font-size:small"><br></div><div style=""><div style=""><font face="monospace, monospace">        msg     = default_fillvalue("float")      ; 9.969212e+36<span></span><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span></span><span style="font-family:monospace,monospace;font-size:small;color:rgb(34,34,34)">msg_str = "" + msg</span></p>        sm_str  = str_get_field(data_col(1:),3,delim)<br>        sm      = tofloat(str_sub_str(sm_str,"",msg_str))<br>        sm@_FillValue   = ms</font><span style="background-color:rgb(255,255,255);font-family:monospace,monospace">g</span><br></div><div style="background-color:rgb(255,255,255);font-size:small"><br></div></div></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">4.  When plotting two curves in the same space that have different ranges, you have to be very careful about setting the trX/Y/Min/MaxF resources. NCL is effectively taking two individual XY plots and drawing them on top of each other, so if you change the trYMaxF for one and not the other, then the curves from both plots are not going to be quite lined up properly.  I fixed this by setting these values to the actual min/max of your data.</span><br></div><div style="font-size:small"><br></div><div style="font-size:small">5. Since your prec array has a lot of isolated values, it might be best plotted as a series of markers (resR@xyLineMode = "Markers") instead of curves. When you plot curves, you will not see the single isolated values. You can also plot as both markers and curves (resR@xyLineMode = "MarkLines")</div><div style="font-size:small"><br></div><div style="font-size:small">See the attached script.</div><div style="font-size:small"><br></div><div style="font-size:small">--Mary</div><div style="font-size:small"><br></div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 2, 2018 at 3:05 AM, Ehsan Taghizadeh <span dir="ltr"><<a href="mailto:ehsantaghizadeh@yahoo.com" target="_blank">ehsantaghizadeh@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div><div style="font-family:bookman old style,new york,times,serif;font-size:16px"><div style="font-family:bookman old style,new york,times,serif;font-size:16px"><span><div style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif">Hi,</div><div style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif">I tried to plot something like "requested.png" in attached files. My input data are "data.txt". I've prepared attached ncl script "meteogram2.ncl". However its output "GPM_SMAP_20170401_30.png" has some problems.</div><div style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif">First its "sm" data are not shown correctly.</div><div style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif">Second I want its x bottom tickmarks string (/'04/01', '04/03', ...,'04/03'/). However as I understood x label in "gsn_csm_xy2" could be numeric only!</div><div style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif">Third y right axis should be displayed 2 digit after floating point.</div><div style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif"><br></div><div style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif">I'll be thankful if I could have any help or reference about them.</div><div style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif"><br></div><div style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif">Sincerely</div><div style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif">Ehsan</div></span></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>