<div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Dear Atul Saini,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Please post all follow-up messages back to the email list. I CC'ed ncl-talk instead of ncl-install in this case, because this is a usage question.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">There are a few ways you can add more curves to an existing XY plot. See examples xy_25.ncl, xy_overlay_25.ncl (which I added for you), and xy_26.ncl at:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/xy.shtml#ex25">http://www.ncl.ucar.edu/Applications/xy.shtml#ex25</a><br></div><div class="gmail_default"><div class="gmail_default" style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><a href="http://www.ncl.ucar.edu/Applications/xy.shtml#exoverlay25">http://www.ncl.ucar.edu/Applications/xy.shtml#exoverlay25</a></div></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/xy.shtml#ex26">http://www.ncl.ucar.edu/Applications/xy.shtml#ex26</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">The xy_overlay_25.ncl should answer the question you have</div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div><div class="gmail_default"><br></div><div class="gmail_default"><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 2, 2018 at 1:20 AM, Atul Saini <span dir="ltr"><<a href="mailto:atulsainimail@gmail.com" target="_blank">atulsainimail@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Thanks a lot respected sir, your guidance is of high imporance to me.<div dir="auto"><br></div><div dir="auto">Sir, in view of the script sent by you for two overlapping variables and therir panel plot, I would like to know what should be done if the variables to be overlapped are more than 2 e.g. total 4 variables i.e. tmin,tmean,tmax and rf?</div><div dir="auto"><br></div><div dir="auto">SIR, Your reply is of high value to me </div></div><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Fri, Nov 2, 2018, 03:00 Mary Haley <<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">In the future, please post NCL questions to <a href="mailto:ncl-talk@ucar.edu" rel="noreferrer" target="_blank">ncl-talk@ucar.edu</a>. ncl-install is for installation issues.</div><div class="gmail_default" style="font-size:small"><br class="m_797220604168415607m_8988420106040691905gmail-Apple-interchange-newline"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">You have several errors in your script:</span><br></div><div class="gmail_default" style="font-size:small"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_default" style="font-size:small"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_default" style="font-size:small">[0] You are using "draw" as variable name. "draw" is a reserved keyword in NCL, because it's a procedure that you call to draw plots. Hence you can't use it as a variable name. However, this variable is not really needed as I think you are creating more plots than you need to. Instead of calling gsn_csm_xy and gsm_csm_xy2 and overlaying the two plots, I think all you need is to call:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default">plot1=gsn_csm_x2y2(wks,tmean_<wbr>yfrac,raf_yfrac,tmeann,raf,<wbr>resmn,resr)</div><div><br></div><div><br></div><div>However, note that I have created two variables: tmean_yfrac and raf_yfrac. I converted the "time" variable of both variables to be a fractional year value, and noticed the two arrays were different, so you have to be careful about plotting them using a common "time" variable. Using gsn_csm_x2y2 allows me to specify a unique X and Y array for both curves.</div></div></div></div></div><div dir="ltr"><div dir="ltr"><div dir="ltr"><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">[1] You can't have a space after the "@" sign when setting attributes:</div><br><font face="monospace, monospace"> resmn@ tmXUseBottom =False</font><div><br></div><div><div class="gmail_default" style="font-size:small">This should be:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="monospace, monospace"> resmn@tmXUseBottom =False</font></span><br class="m_797220604168415607m_8988420106040691905gmail-m_-5047017094713393531m_967648833822522699gmail-Apple-interchange-newline"></div><div class="gmail_default" style="font-size:small"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_default" style="font-size:small">[2] These lines are wrong: </div><div class="gmail_default" style="font-size:small"><br></div></div></div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><div><div><div class="gmail_default"><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"> draw(1)=gsn_csm_xy2(wks,yyyy,<wbr>tmeann,raf,resmn,resr)</font></div></div></div></div></div></div><div><div><div><div class="gmail_default"><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"> overlay(plot(1),draw(1))</font></div></div></div></div></div><div><div><div><div class="gmail_default"><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"> plot(1)</font></div></div></div></div></div></blockquote><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default"><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">First, the "draw" variable will have been renamed to "plot2". Second, just calling "plot(1)" makes no sense. I think what you wanted was:</div><div class="gmail_default" style="font-size:small"><br></div></div></div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><div><div><div class="gmail_default"><div class="gmail_default"><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"> plot2(1)=gsn_csm_xy2(wks,<wbr>yyyy,tmeann,raf,resmn,resr)</font></div></div></div></div></div></div></div><div><div><div><div class="gmail_default"><div class="gmail_default"><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"> overlay(plot(1),draw(1))</font></div></div></div></div></div></div><div><div><div><div class="gmail_default"><div class="gmail_default"><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"> draw(plot(1))</font></div></div></div></div></div></div></blockquote><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default"><div class="gmail_default"><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">[3] If you are trying to put two plots in a panel, then they must both have the same "wks" variable associated with it. There's no reason to create two separate workstations.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">[4] When you call gsn_panel, you only want to give it the plots you want to panel. You passed in "plot" which consists of two base plots and two overlaid plots. You can't draw plots once they've been overlaid, so what you want is:</div><div class="gmail_default" style="font-size:small"><br></div></div></div></div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div class="gmail_default"><div class="gmail_default"><div class="gmail_default"><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">gsn_panel(wks,(/plot(1),plot(<wbr>3)/),(/1,2/),False) </font></div></div></div></div></div></div></div></div></blockquote><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default"><div class="gmail_default"><div class="gmail_default"><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">[5] You are getting a number of warnings when you run the script, because you are setting resources that have no meaning for the type of plot being created. For example, you set "gsMarkerIndex", but this resource is only good for when you are adding markers to a plot via "gsn_polymarker" or "gsn_add_polymarker". If you are trying to set a marker for an XY plot, then this should be:</div><div class="gmail_default" style="font-size:small"><br></div></div></div></div></div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><div><div><div class="gmail_default"><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">resmn@xyMarker = 1</font></div></div></div></div></div></div></div><div><div><div><div><div class="gmail_default"><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">resr@xyMarkLineMode = "MarkLines"</font></div></div></div></div></div></div></div></blockquote><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div class="gmail_default"><div class="gmail_default"><div class="gmail_default"><br>I set xyMarkLineMode to "MarkLines" because otherwise you will only get lines. If you only want markers, then set:</div><div class="gmail_default"><br></div><div class="gmail_default"><font face="monospace, monospace"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">resr@xyMarkLineMode = "Markers"</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"></font><br><br></div><div class="gmail_default">[6] There are no resources called "tbXMaxF" or "tbXMinF". I think you meant "trXMaxF" and "trXMinF".</div><div class="gmail_default"><br></div><div class="gmail_default">You need to be careful about resource misspellings. NCL will tell you if it doesn't recognize a resource you are setting, with this kind of warning:</div><div class="gmail_default"><br></div></div></div></div></div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">warning:tbXminF is not a valid resource in overlay_chamba_and_kangra_<wbr>plots_xy at this time</font></div></div></div></div></div></div></blockquote><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default"><div class="gmail_default"><br></div><div class="gmail_default">[7] The rest aren't really errors, but things I did to clean up the plot</div><div class="gmail_default"><br></div><div class="gmail_default">- I set vpWidthF and vpHeightF so that you get a plot that is wider than it is high. This is usually done for time series plots. If you don't like this, simply remove or comment all lines with these resources, and you will get the default square plot.</div><div class="gmail_default"><br></div><div class="gmail_default"> - I changed the panel so that the two plots are being drawn in two rows and one column.</div><div class="gmail_default"><br></div><div class="gmail_default"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> -<span> </span></span>I set some other resources to turn off the top labels and tickmarks.</div><div class="gmail_default"><br></div><div class="gmail_default"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> -<span> </span></span>I changed the color of the Y axis strings to match the color of their corresponding curves. This was mainly for me, to make sure I had the correct curve with the correct axis.</div><div class="gmail_default"><span style="font-size:small;text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255);float:none;display:inline"><br class="m_797220604168415607m_8988420106040691905gmail-Apple-interchange-newline"> -<span> </span></span><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">I noticed you are setting resr and resmn resource lists twice and setting them to exactly the same thing, with the exception of the main title (tiMainString). I removed the duplicate settings to clean things up.</span><br></div><div class="gmail_default"><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 class="gmail_default"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">- I reorganized the resources so they are hopefully easier to read and modify later. </span></div><div class="gmail_default"><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 class="gmail_default"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> -<span> </span></span>You may want to set trYMinF / trYMaxF for one or both axes depending on how you want the two curves displayed relative to each other.</div><div class="gmail_default"><br></div><div class="gmail_default">See the attached modified script and resultant plot.</div><div class="gmail_default"><br></div><div class="gmail_default">If you continue to have problems, please post them to ncl-talk. You must subscribe first:</div><div class="gmail_default"><br></div><div class="gmail_default"><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></div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div><div class="gmail_default"><br></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 30, 2018 at 10:26 PM, Atul Saini <span dir="ltr"><<a href="mailto:atulsainimail@gmail.com" rel="noreferrer" target="_blank">atulsainimail@gmail.com</a>></span> wrote:<br><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><font size="4">Respected Sir/Ma'am,</font></div><div><font size="4"> It is my humble request to guide me in the following issue.</font></div><div><font size="4"><br></font></div><div><font size="4"><span style="background-color:rgb(255,229,153)"><span style="color:rgb(0,0,255)">Sir/Ma'am,
I am overlaying xy plot { plot (2) over plot(1) and plot(3) over
plot(4) } and then trying to get plot(1) and plot (3) in the panel plot. <br></span></span></font></div><div><font size="4"><span style="background-color:rgb(255,229,153)"><span style="color:rgb(0,0,255)"><br></span></span></font></div><div><font size="4"><span style="background-color:rgb(255,229,153)"><span style="color:rgb(0,0,255)">The NCL code along with the required data files for the
purpose are attached herewith this mail.</span></span></font></div><div><font size="4"><br></font></div><div><font size="4"><u>I don't know what is the problem with the code, <span style="color:rgb(255,0,0)"><b>please help .</b></span></u></font><br></div><div><div><div dir="ltr" class="m_797220604168415607m_8988420106040691905gmail-m_-6085239386564560363gmail-m_-8480442844185927515gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div><div dir="ltr" class="m_797220604168415607m_8988420106040691905gmail-m_-6085239386564560363gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><br><br><br></div><div>Regards,<br><br></div><div dir="ltr"><br><img src="https://docs.google.com/uc?export=download&id=0Byj9ykpbAx3oSkNPc1pvekFBNWs&revid=0Byj9ykpbAx3oeW5mUjJtMDNKcnRrdjRnY0N0eVBHTnBNc3NrPQ" width="229" height="103"><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
<br>______________________________<wbr>_________________<br>
ncarg-talk mailing list<br>
<a href="mailto:ncarg-talk@ucar.edu" rel="noreferrer" target="_blank">ncarg-talk@ucar.edu</a><br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncarg-talk" rel="noreferrer noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncarg-talk</a><br>
<br></blockquote></div><br></div></div></div>
</blockquote></div>
</div></div></blockquote></div><br></div>