<div dir="ltr">Rashed: Thanks for that example! That's quite helpful.<div><br></div><div>Adam: When I use getvalues plot@contour like you suggested, the fill_colors array is full of 30-bit integers. Is there a handy function or translation tool to convert those back to RGBA values and/or string color names, or would I have to write my own? The rgb.txt file on NCL's named colors page provides a way to compare named colors to RGB values, but does not include the corresponding 30-bit integers that would allow for quick string parsing and pattern matching.</div><div><br></div><div>Jared</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 13, 2018 at 2:41 PM, Adam Phillips <span dir="ltr"><<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@ucar.edu</a>></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 Jared,<div>To add to Rashed's suggestions:</div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">You can set cnFillColors to exactly the colors you want, via named colors, indexes from a color map, or RGB or RGBA values.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><a href="http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnFillColors" style="color:rgb(17,85,204)" target="_blank">http://www.ncl.ucar.edu/Docume<wbr>nt/Graphics/Resources/cn.<wbr>shtml#cnFillColors</a></div><br></div><div>See numerous examples here: (Search on the page for "cnFillColors")</div><div><a href="http://www.ncl.ucar.edu/Applications/res_list.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Applications/res_list.shtml</a><br></div><div><br></div><div><div>To answer your query: You can use getvalues to return the colors used in a specific plot:</div><div>plot = gsn_csm_contour_map(.....</div><div><div>getvalues plot@contour       ; use plot@contour for contour plots created using gsn_*_map, otherwise just use "plot"</div><div> "cnFillColors" : fill_colors </div><div>end getvalues </div></div><div>print(fill_colors)</div><div><br></div><div>Hope that helps!<br>Adam</div></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Tue, Feb 13, 2018 at 1:51 PM, Jared Lee <span dir="ltr"><<a href="mailto:jaredlee@ucar.edu" target="_blank">jaredlee@ucar.edu</a>></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 Rashed,<div><br></div><div>Thanks for the example! That method works fine if you have your threshold contour line (0ºC, say) is exactly in the middle of your set of contour lines, but not if you have different numbers of contours above and below your threshold value to split the colorbars/colormaps, unfortunately. And it also limits you to combining colormaps that would total no more than 256 colors.</div><div><br></div><div>What I ended up doing to get a similar effect (though not explicitly blending two colormaps) was to play with cnFillPatterns and make the contour intervals below 0ºC be either cross-hatched or stippled (and cnFillScaleF changes the stipple density), as in the attached image (note that cnFillMode must be set to "AreaFill" to use fill patterns). That might be my compromise solution, at least for now.</div><div><br></div><div>It would still be nice to be able to return the names of colors (or RBGA values) that are assigned to the various contour levels (after setting cnFillPalette to a named colormap and setting cnMinLevelValF, cnMaxLevelValF, and cnLevelSpacingF), and then explicitly supply different color names (or opacities) for some of the intervals. I'm not sure how to return the names of colors that are actually being used with a given set of contour levels, though.</div><div><br></div><div>Jared</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 12, 2018 at 6:50 PM, Rashed Mahmood <span dir="ltr"><<a href="mailto:rashidcomsis@gmail.com" target="_blank">rashidcomsis@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="ltr"><div><div><div>Hi Jared,<br></div>I think it's easy combine two color maps to get what you want. See attached script and the figure. the input file is NCEP surface air temperature.<br><br></div>Cheers,<br></div>Rashed<br><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_620824583962334211m_-5728912661145368503h5">On Mon, Feb 12, 2018 at 4:33 PM, Jared Lee <span dir="ltr"><<a href="mailto:jaredlee@ucar.edu" target="_blank">jaredlee@ucar.edu</a>></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="m_620824583962334211m_-5728912661145368503h5"><div dir="ltr">Hi all,<div><br></div><div>Has anyone out there made any plots where the colorbar/colormap is part grayscale, part color? For example, what I'd like to do for one application is make some plots with a color palette like "NCV_bright," for instance, where temperatures below 0ºC (say) get plotted in a grayscaled version of the color palette, but grid cells with values above 0ºC get plotted with the regular full-color palette. How would I go about doing that? Would I have to manually replace the sub-zero part of my color palette with various named gray colors? Thanks for any tips or ideas!</div><div><br></div><div>Jared<br clear="all"><div><br></div>-- <br><div class="m_620824583962334211m_-5728912661145368503m_-1383902786888717873m_-2356655758053042897gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div><div><div><div><font face="courier new, monospace">==============================<wbr>=<br>Jared A. Lee, Ph.D.<br></font></div><font face="courier new, monospace">Project Scientist I<br></font></div><font face="courier new, monospace">Research Applications Laboratory<br></font></div><font face="courier new, monospace">National Center for Atmospheric Research<br>Boulder, Colorado, USA</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">Member, AMS Planning Commission<br><br></font></div><font face="courier new, monospace">Email: <a href="mailto:jaredlee@ucar.edu" target="_blank">jaredlee@ucar.edu</a> (w)<br></font></div><font face="courier new, monospace">Phone: <a href="tel:(303)%20497-8485" value="+13034978485" target="_blank">303.497.8485</a> (w)</font><div><font face="courier new, monospace">Web: <a href="https://staff.ucar.edu/users/jaredlee" target="_blank">https://staff.ucar.edu/users/j<wbr>aredlee</a><br>==============================<wbr>=</font><br></div></div></div></div></div>
</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><br clear="all"><div><br></div>-- <br><div class="m_620824583962334211m_-5728912661145368503gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div><div><div><div><font face="courier new, monospace">==============================<wbr>=<br>Jared A. Lee, Ph.D.<br></font></div><font face="courier new, monospace">Project Scientist I<br></font></div><font face="courier new, monospace">Research Applications Laboratory<br></font></div><font face="courier new, monospace">National Center for Atmospheric Research<br>Boulder, Colorado, USA</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">Member, AMS Planning Commission<br><br></font></div><font face="courier new, monospace">Email: <a href="mailto:jaredlee@ucar.edu" target="_blank">jaredlee@ucar.edu</a> (w)<br></font></div><font face="courier new, monospace">Phone: <a href="tel:(303)%20497-8485" value="+13034978485" target="_blank">303.497.8485</a> (w)</font><div><font face="courier new, monospace">Web: <a href="https://staff.ucar.edu/users/jaredlee" target="_blank">https://staff.ucar.edu/users/j<wbr>aredlee</a><br>==============================<wbr>=</font><br></div></div></div></div></div>
</div>
<br>______________________________<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><br clear="all"><div><br></div>-- <br></div></div><span class="HOEnZb"><font color="#888888"><div class="m_620824583962334211gmail_signature" data-smartmail="gmail_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/<wbr>asphilli/</a>   </font></span><span><font color="#888888"><a href="tel:(303)%20497-1726" value="+13034971726" target="_blank">303-497-1726</a> </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>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div><div><div><div><font face="courier new, monospace">===============================<br>Jared A. Lee, Ph.D.<br></font></div><font face="courier new, monospace">Project Scientist I<br></font></div><font face="courier new, monospace">Research Applications Laboratory<br></font></div><font face="courier new, monospace">National Center for Atmospheric Research<br>Boulder, Colorado, USA</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">Member, AMS Planning Commission<br><br></font></div><font face="courier new, monospace">Email: <a href="mailto:jaredlee@ucar.edu" target="_blank">jaredlee@ucar.edu</a> (w)<br></font></div><font face="courier new, monospace">Phone: 303.497.8485 (w)</font><div><font face="courier new, monospace">Web: <a href="https://staff.ucar.edu/users/jaredlee" target="_blank">https://staff.ucar.edu/users/jaredlee</a><br>===============================</font><br></div></div></div></div></div>
</div>