<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
The script can be found here: <a href="https://operations.nysmesonet.org/~nbassill/radar/radar.ncl" id="LPlnk703799">https://operations.nysmesonet.org/~nbassill/radar/radar.ncl</a> . As I said, there's a lot of (fairly poorly commented) stuff going on there,
 but the most relatable lines for what you're doing are in the middle:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<pre style="color: rgb(0, 0, 0); overflow-wrap: break-word;">   countyplot := gsn_csm_contour_map(wks2,newdata,resmap)

   pres                 = True
   pres@gsFillColor     = "transparent"
   pres@gsFillOpacityF = 0.0
   pres@gsEdgesOn = True
   pres@gsLineThicknessF = 8.0
   pres@gsLineColor= "gray40";"gray30"

 ; if roads.eq."yes"
   shpid = gsn_add_shapefile_polylines(wks2,countyplot,"tl_2015_36_prisecroads.shp",pres)
 ; end if</pre>
As I mentioned, my line thickness is much greater, though I'm not sure if that's the reason. </div>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif; color: rgb(0, 0, 0);">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<p style="margin-top:0px; margin-bottom:0px"><span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
Nick Bassill, PhD</span></p>
<p style="margin-top: 0px; margin-bottom: 0px; color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
Director of Research & Development, Center Of Excellence</p>
<p style="margin-top: 0px; margin-bottom: 0px; color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
Affiliated with NYS Mesonet</p>
<p style="margin-top: 0px; margin-bottom: 0px; color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
LC SB-28, 1400 Washington Ave.,</p>
<p style="margin-top: 0px; margin-bottom: 0px; color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
SUNY, University at Albany, NY 12222</p>
Contact: (518) 442-6375 | @NickPBassill |<span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"> </span><a href="http://operations.nysmesonet.org/~nbassill/" class="OWAAutoLink" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">http://operations.nysmesonet.org/~nbassill/</a></div>
</div>
</div>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Andrew Kren - NOAA Federal <andrew.kren@noaa.gov><br>
<b>Sent:</b> Wednesday, June 23, 2021 6:02 PM<br>
<b>To:</b> Bassill, Nicholas <nbassill@albany.edu><br>
<b>Cc:</b> Dave Allured - NOAA Affiliate <dave.allured@noaa.gov>; ncl-talk <ncl-talk@ucar.edu><br>
<b>Subject:</b> Re: [ncl-talk] Small issue plotting highways</font>
<div> </div>
</div>
<div>
<div dir="ltr">Sure go ahead and share if you like.</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Wed, Jun 23, 2021 at 5:21 PM Bassill, Nicholas <<a href="mailto:nbassill@albany.edu">nbassill@albany.edu</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Hi Andrew, all,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
   Sort of a shot in the dark here, but coincidentally, I also regularly make radar plots and overlay highways (also in gray), along with a whole bunch of other info and I have not noticed this with my png files. I also use a shapefile for the highways and
 more or less use your technique I think. I'm attaching two examples - one from an active day, and one from today just to demonstrate that I always see the same road behavior. I see your line thickness is very small - perhaps increasing the thickness would
 help a bit?</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
If you'd like I'd be happy to share this script, though fair warning it has a ton of stuff in so may be a bit hard to parse. </div>
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div id="x_gmail-m_3061576263689656795Signature">
<div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div id="x_gmail-m_3061576263689656795divtagdefaultwrapper" dir="ltr" style="font-size:12pt; font-family:Calibri,Helvetica,sans-serif; color:rgb(0,0,0)">
<div id="x_gmail-m_3061576263689656795divtagdefaultwrapper" dir="ltr" style="font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<p style="margin-top:0px; margin-bottom:0px"><span style="color:rgb(0,0,0); font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px"><br>
Nick Bassill, PhD</span></p>
<p style="margin-top:0px; margin-bottom:0px; color:rgb(0,0,0); font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px">
Director of Research & Development, Center Of Excellence</p>
<p style="margin-top:0px; margin-bottom:0px; color:rgb(0,0,0); font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px">
Affiliated with NYS Mesonet</p>
<p style="margin-top:0px; margin-bottom:0px; color:rgb(0,0,0); font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px">
LC SB-28, 1400 Washington Ave.,</p>
<p style="margin-top:0px; margin-bottom:0px; color:rgb(0,0,0); font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px">
SUNY, University at Albany, NY 12222</p>
Contact: (518) 442-6375 | @NickPBassill |<span style="color:rgb(0,0,0); font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt"> </span><a href="http://operations.nysmesonet.org/~nbassill/" target="_blank" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">http://operations.nysmesonet.org/~nbassill/</a></div>
</div>
</div>
</div>
</div>
<div id="x_gmail-m_3061576263689656795appendonsend"></div>
<hr style="display:inline-block; width:98%">
<div id="x_gmail-m_3061576263689656795divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> ncl-talk <<a href="mailto:ncl-talk-bounces@mailman.ucar.edu" target="_blank">ncl-talk-bounces@mailman.ucar.edu</a>>
 on behalf of Dave Allured - NOAA Affiliate via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>><br>
<b>Sent:</b> Wednesday, June 23, 2021 4:52 PM<br>
<b>To:</b> Andrew Kren - NOAA Federal <<a href="mailto:andrew.kren@noaa.gov" target="_blank">andrew.kren@noaa.gov</a>><br>
<b>Cc:</b> ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>><br>
<b>Subject:</b> Re: [ncl-talk] Small issue plotting highways</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>Andrew, the difference between your plots with and without the contour fill layer is surprising.  I can only speculate that there might be a branch somewhere inside NCL, that handles antialiasing differently, depending on which graphics layers are active. 
 Notice that the resolution of the lettering is also affected slightly.</div>
<div><br>
</div>
<div>I still think your best bets are to try the resource suggested by Rick, or to avoid the issue by using some form of vector graphics for output.  Thanks for showing that contrasting plot, and good luck.</div>
<div dir="ltr"><br>
</div>
<br>
<div>
<div dir="ltr">On Wed, Jun 23, 2021 at 8:08 AM Andrew Kren - NOAA Federal <<a href="mailto:andrew.kren@noaa.gov" target="_blank">andrew.kren@noaa.gov</a>> wrote:<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">Thanks Dave and Rick. I will try that. Here is what I get on a day when there is nothing on the radar to plot. The highways show up just fine with no changes to the code. I'm wondering if it has something to do with the contours overlaid or something
 similar? I will also try a PDF or PS file.
<div><br>
</div>
</div>
<br>
<div>
<div dir="ltr">On Tue, Jun 22, 2021 at 6:31 PM Dave Allured - NOAA Affiliate <<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>> wrote:<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div>Andrew, PNG is an image format that naturally consists of a grid of pixels.  The only pixellation that I see in your plot is the natural pixels in the PNG format.  Your highways are mostly very fine diagonal lines.  PNG decomposes a diagonal line into
 a group of small gray and black squares (pixels) on a regularly spaced pixel grid.  When the intended line is thin enough, it is difficult to get a clear representation on the pixel grid.  One of the possible results is apparently dashed lines like those I
 am seeing.</div>
<div><br>
</div>
<div>Try making the same plot using vector graphics such as PDF, postscript (PS), or SVG, as Rick suggested.  These vector formats preserve a true mathematical representation of line data.  The result is clean edges and fine lines that will not pixellate when
 you zoom in, when using proper viewing software that supports true vector mode display.</div>
<div dir="ltr"><br>
</div>
<br>
<div>
<div dir="ltr">On Tue, Jun 22, 2021 at 12:15 PM Andrew Kren - NOAA Federal via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">Thanks, I'll check it out. <br>
</div>
<br>
<div>
<div dir="ltr">On Tue, Jun 22, 2021 at 11:25 AM Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>> wrote:<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div>Hi Andrew,</div>
<div><br>
</div>
<div>It's odd that you are getting inconsistent results. Do you see the same thing if you write to a PS or PDF file? I don't know what's going on, but it looks like a  bit of overzealous anti-aliasing. There's a resource to control whether antialiasing is applied
 or not:</div>
<div><br>
</div>
<div><a href="https://www.ncl.ucar.edu/Document/Graphics/Resources/wk.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Graphics/Resources/wk.shtml</a></div>
<div><br>
</div>
<div>It's on by default and generally yields better results, but you might experiment with it.</div>
<div><br>
</div>
<div>Wish I had a better answer.</div>
<div>Rick</div>
<div><br>
</div>
</div>
<br>
<div>
<div dir="ltr">On Tue, Jun 22, 2021 at 8:45 AM Andrew Kren - NOAA Federal via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">Hi there,
<div><br>
</div>
<div>I am plotting radar data and overlaying highways onto the map. I first plot the radar analysis, then overlay the highway information by reading/plotting the shapefile.</div>
<div><br>
</div>
<div>At times, when I view the PNGs, the highways show up as blotched out (lack of detail and pixelated; see attached image). At other times, the highways show up very clear and darker as expected. Is there a reason for this? Below shows a snippet of my code
 that produces the radar plot and the highway overlay.</div>
<div><br>
</div>
<div> plot = gsn_csm_contour_map(wks,radar,res)<br>
<br>
 ; add highway polylines to the map from shapefile<br>
 plres = True<br>
 plres@gsLineColor = "grey48"<br>
 plres@gsLineThicknessF = 0.2<br>
 id = gsn_add_shapefile_polylines(wks,plot,SHAPE_DIR+"roadtrl020.shp",plres) <br>
</div>
<div><br>
</div>
<div>Thanks,<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<pre cols="72" style="white-space:pre-wrap; color:rgb(34,34,34); font-family:"arial black",sans-serif"><span style="font-family:arial,helvetica,sans-serif">Andrew Kren
Meteorologist 
NOAA's National Weather Service
Raleigh Forecast Office
1005 Capability Drive, Suite 300
Raleigh, North Carolina 27606
voice: 919-326-1035 
mailto: <a href="mailto:andrew.kren@noaa.gov" target="_blank">andrew.kren@noaa.gov</a></span><span style="font-family:arial,helvetica,sans-serif">
</span><span style="color:rgb(17,85,204); font-family:arial,helvetica,sans-serif"><a href="http://www.weather.gov/rah" target="_blank" style="color:rgb(17,85,204)">http://www.weather.gov/rah</a></span></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="x_gmail_signature">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<pre cols="72" style="white-space:pre-wrap; color:rgb(34,34,34); font-family:"arial black",sans-serif"><span style="font-family:arial,helvetica,sans-serif">Andrew Kren
Meteorologist 
NOAA's National Weather Service
Raleigh Forecast Office
1005 Capability Drive, Suite 300
Raleigh, North Carolina 27606
voice: 919-326-1035 
mailto: <a href="mailto:andrew.kren@noaa.gov" target="_blank">andrew.kren@noaa.gov</a></span><span style="font-family:arial,helvetica,sans-serif">
</span><a href="http://www.weather.gov/rah" target="_blank" style="color:rgb(17,85,204)"><span style="font-family:arial,helvetica,sans-serif">http://www.weather.gov/rah</span></a></pre>
</div>
<div dir="ltr"><img width="420" height="65" src="https://www.aoml.noaa.gov/pix/AOML/50th01.png"><span style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px"><br>
</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>