<div dir="ltr"><div class="gmail_default" style="font-size:small">Xiaoni,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I would recommend using Ngl.add_polymarker instead of trying to contour the data. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You can group the markers by whatever criteria you choose, and then draw this set of markers all at once setting the color via gsMarkerColor.  You can change what type of marker is drawn by using gsMarkerIndex.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">We don't have many PyNGL examples of this yet, but you can see some NCL examples which are similar.  Go to:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/polyg.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Applications/polyg.shtml</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">and look at examples polyg_8.ncl, polyg_8_lbar.ncl</div><div class="gmail_default"><br></div><div class="gmail_default">I've attached an example, along with its data file, to show the difference between smoothed contours, raster contours, and drawing markers.</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_extra"><br><div class="gmail_quote">On Mon, Nov 6, 2017 at 6:17 AM, Xiaoni Wang <span dir="ltr"><<a href="mailto:xiaoni.wang@obspm.fr" target="_blank">xiaoni.wang@obspm.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Dear Mary,<div>     Thank you for your explanation. (Excuse me for my late response).</div><div><br></div><div>     I have another question. I have some 1D data irregularly distributed over a region. I would like to plot these data on a 2D map, without gridding, without filling <span style="background-color:rgb(255,255,255)">polygons or triangles</span>. I just would like to show data in different colors (given different values) at their lat/lon locations. </div><div>     For your information, it is over a small region (3 by 3 degree for the latitude/longitude range), and number of data is not enormous over the region. I tried contour_map with resources.cnFillOn=True, resources.cnFillMode=<wbr>RasterFill;  and it works. But it used <span style="background-color:rgb(255,255,255);color:rgb(51,51,51)">TriangularMesh. If I set </span>resources.cnFillOn=False, <wbr>then it  produces no points or color on the map. If you have any suggestion, then I would appreciate !</div><div><br></div><div>      PS: If there is no way to display as I wished, then I would like just to add the data locations on the contour_map. Thanks in advance for your help.</div><div><br></div><div>Best regards</div><div><br></div><div>Xiaoni</div><div>     <br><div><div>Le 27 oct. 2017 à 00:37, Mary Haley <<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>> a écrit :</div><br class="m_106392940243244327Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div style="font-size:small">Xiaoni,</div><div style="font-size:small"><br></div><div style="font-size:small">I'm sorry for the delay. I didn't realize there was an unanswered question.</div><div style="font-size:small"><br></div><div style="font-size:small">When you say "specific value with white color" do you mean that you want to color a 0-level contour line in white, or that you want to specify a contour *fill* for values equal to 0?</div><div style="font-size:small"><br></div><div style="font-size:small">As an example of specifying a particular color for a contour line, see spaghetti.py at:</div><div style="font-size:small"><br></div><div><a href="http://www.pyngl.ucar.edu/Examples/gallery.shtml" target="_blank">http://www.pyngl.ucar.edu/<wbr>Examples/gallery.shtml</a><br></div><div><br></div><div>This uses only one contour level, and sets the color for this level using cnLineColor and an index value:</div><div><br></div><div><font face="monospace, monospace">res.cnLevelSelectionMode = "ExplicitLevels" # explicit contour levels</font></div><div><font face="monospace, monospace">res.cnLevels             = 5500             # which level(s) to plot</font></div><div><font face="monospace, monospace">res.cnLineColor          = 1      # index 1 in default color table. Can also </font></div><div><font face="monospace, monospace">                                  # use a named color, like "white"   </font>     <br></div><div><br></div><div>If you want to set multiple levels with multiple colors, then provide an array of values to cnLevels, and use cnLineColors to set the color for each.</div><div><br></div><div>If you want to set the colors for filling between contour levels, then you can use cnFillColors. See example hdf3.py, which does this with:</div><div><br></div><div><div><font face="monospace, monospace">res.cnLevelSelectionMode = "ExplicitLevels"</font></div><div><font face="monospace, monospace">res.cnLevels             = [0.01,0.02,0.04,0.08,0.16,0.<wbr>32,0.64, 0.96]</font></div><div><font face="monospace, monospace">res.cnFillColors         = ["white","cyan", "green","yellow",</font></div><div><font face="monospace, monospace">                            "darkorange","red","magenta","<wbr>purple","black"]</font></div><div><br></div></div><div style="font-size:small">--Mary</div><div style="font-size:small"><br></div><div style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 19, 2017 at 3:41 AM, Xiaoni Wang <span dir="ltr"><<a href="mailto:xiaoni.wang@obspm.fr" target="_blank">xiaoni.wang@obspm.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
     May I ask how to plot a specific value (0 for example) with white color by using NGL in a 2D contour plot ? Thank you in advance !<br>
<br>
Best wishes,<br>
<br>
Xiaoni Wang<br>
<br>
______________________________<wbr>_________________<br>
pyngl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/pyngl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/pyngl-talk</a><br>
</blockquote></div><br></div>
</blockquote></div><br></div></div></blockquote></div><br></div></div>