<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style><style type="text/css"></style><style type="text/css"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">I see, thanks a lot for the help! It works perfectly now.
<div><br>
</div>
<div>Cheers</div>
<div>Ty<br>
<div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF710850" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> Mary Haley [haley@ucar.edu]<br>
<b>Sent:</b> 11 April 2018 16:38<br>
<b>To:</b> Rashed Mahmood<br>
<b>Cc:</b> Ty Buckingham; ncl-talk@ucar.edu<br>
<b>Subject:</b> Re: [ncl-talk] Changing a color in a color table to transparent<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<div class="gmail_default" style="font-size:small">Just a minor suggestion: if you want transparency, the value to change is the "alpha" value, which is represented by index 3 (indexes 0 through 2 are the RGB values):</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">
<div style="color:rgb(34,34,34); font-size:12.8px; font-style: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)">
<font face="monospace, monospace"><span style="">cmap(<span class="gmail-m_-5391744944018697390gmail-aBn"><span class="gmail-m_-5391744944018697390gmail-aQJ"><span class="gmail-aBn" tabindex="0" style="border-bottom:1px dashed rgb(204,204,204)"><span class="gmail-aQJ" style="top:2px; z-index:-1">10:11</span></span></span></span>,3)
= 0.0 ; completely transparent</span><br>
</font></div>
<div style="color:rgb(34,34,34); font-size:12.8px; font-style: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)">
<span style="">
<div style="color:rgb(34,34,34); font-style:normal; font-weight:400; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; font-size:12.8px; background-color:rgb(255,255,255)">
<span style=""><font face="monospace, monospace">cmap(<span class="gmail-m_-5391744944018697390gmail-aBn"><span class="gmail-m_-5391744944018697390gmail-aQJ"><span class="gmail-aBn" tabindex="0" style="border-bottom:1px dashed rgb(204,204,204)"><span class="gmail-aQJ" style="top:2px; z-index:-1">10:11</span></span></span></span>,3)
= 0.5 ; half transparent</font></span></div>
</span></div>
<div style="color:rgb(34,34,34); font-size:12.8px; font-style: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)">
<span style=""><font face="monospace, monospace">cmap(10:11,3) = 1.0 ; no transparency (the default)</font></span></div>
<br class="gmail-Apple-interchange-newline">
See example newcolor_10.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/rgbacolor.shtml#ex10" target="_blank">http://www.ncl.ucar.edu/Applications/rgbacolor.shtml#ex10</a><br>
</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">I think other examples on that page may be useful.</div>
<div class="gmail_default"><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Apr 10, 2018 at 5:41 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>I think there is typo, replace:<br>
From:<br>
<span style="">cmap(<span class="m_-5391744944018697390gmail-aBn"><span class="m_-5391744944018697390gmail-aQJ">10:11</span></span>,) = 0.0</span><br>
<br>
</div>
to <span style="">cmap(<span class="m_-5391744944018697390gmail-aBn"><span class="m_-5391744944018697390gmail-aQJ">10:11</span></span>,:) = 0.0</span><br>
<div><br>
</div>
<div>If at later stage you are using "gsn_define_colormap" then it should be:<br>
<span style="">cmap(<span class="m_-5391744944018697390gmail-aBn"><span class="m_-5391744944018697390gmail-aQJ">10:11</span></span>,0:2) = 0.0</span><br>
</div>
<div><br>
</div>
<div>Cheers,<br>
</div>
<div>Rashed<br>
</div>
<div><br>
<br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">
<div>
<div class="h5">On Tue, Apr 10, 2018 at 4:55 PM, Ty Buckingham <span dir="ltr"><<a href="mailto:ty.buckingham@manchester.ac.uk" target="_blank">ty.buckingham@manchester.ac.<wbr>uk</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="h5">
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Hi there,
<div><br>
</div>
<div>Is it possible to change a single color in an already constructed color map to transparent?</div>
<div><br>
</div>
<div>As an example: I wish to use the "hotcold_18lev" color table, but wish to change the white to transparent. I do not have editing permission to the NCARG root hence cannot change the RGBA value directly. Is it possible to change it within the NCL script?</div>
<div><br>
</div>
<div>Initially, I tried this:</div>
<div><br>
</div>
<div>
<p style="margin-right:0px; margin-left:0px; font-size:11px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span style="">cmap = read_colormap_file("hotcold_18<wbr>lev")</span></p>
<p style="margin-right:0px; margin-left:0px; font-size:11px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span style="">cmap(10:11,) = 0.0 ; makes whites transparent</span></p>
<p style="margin-right:0px; margin-left:0px; font-size:11px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
res@cnFillColors = cmap</p>
<p style="margin-right:0px; margin-left:0px; font-size:11px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<br>
</p>
<p style="margin-right:0px; margin-left:0px; line-height:normal; background-color:rgb(255,255,255)">
<font size="2">Yet received the error:</font></p>
<p style="margin-right:0px; margin-left:0px; line-height:normal; background-color:rgb(255,255,255)">
<font size="2"><br>
</font></p>
<p style="margin-right:0px; margin-left:0px; font-size:11px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span style="">fatal:Error in subscript, normal subscripting is being used, make sure named subscripting has not been used</span></p>
<p style="margin-right:0px; margin-left:0px; font-size:11px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span style=""><br>
</span></p>
<p style="margin-right:0px; margin-left:0px; line-height:normal; background-color:rgb(255,255,255)">
<span style=""><font size="2">which is related to the "cmap(10:11,)" line. </font></span></p>
<p style="margin-right:0px; margin-left:0px; line-height:normal; background-color:rgb(255,255,255)">
<span style=""><font size="2"><br>
</font></span></p>
<p style="margin-right:0px; margin-left:0px; line-height:normal; background-color:rgb(255,255,255)">
<font size="2">Thanks in advance!</font></p>
<span class="m_-5391744944018697390HOEnZb"><font color="#888888">
<p style="margin-right:0px; margin-left:0px; line-height:normal; background-color:rgb(255,255,255)">
<font size="2">Ty</font></p>
</font></span></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>
<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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>