[ncl-talk] gsMarkerOpacity != 1. and MarkerIndex 16 or 1

Alan Brammer abrammer at albany.edu
Tue Dec 2 14:53:15 MST 2014


I think your comments are sound.  It was a pdf converted to png.  The original pdf was 1.5MB so my email got kicked back. 

My "desired behaviour" sentence was written when I believed using “dot” instead of “filled circle” would solve my problem.  Didn’t think about the boldness coming from the overlay of the transparencies.  


Anyhow, I’ve found a solution (workaround) to my own problem.  The overlay idea got me thinking, so I created my own marker.  Which no longer has the border that is imposed by the predefined marker. 
I would still consider the original post a bug, though the increase in opaqueness through overlapping transparencies is generally a nice feature. 



;   **************** test code;   
wks = gsn_open_wks("pdf","test") 
res = True
res at gsnDraw = False
res at gsnFrame = False
plot = gsn_blank_plot(wks, res)
gs_res = True
gs_res at gsMarkerIndex = 16
gs_res at gsMarkerSizeF = 0.14     
gs_res at gsMarkerColor = "Red"
gs_res at gsLineOpacityF = 0.
mark0 = gsn_add_polymarker(wks, plot, 0.3, 0.3, gs_res)
gs_res at gsMarkerOpacityF = 0.6
mark1 = gsn_add_polymarker(wks, plot, 0.5, 0.5, gs_res)

  mstring = "7"
  fontnum = 34
  xoffset = 0.0
  yoffset = 0.0
  ratio   = 1.0
  size    = 1.0
  angle   = 0.0

  new_index = NhlNewMarker(wks, mstring, fontnum, xoffset, yoffset, ratio, size, angle)
  gs_res at gsMarkerIndex = new_index
  mark2 = gsn_add_polymarker(wks, plot, 0.7, 0.7, gs_res)

draw(plot)
frame(wks)

;   **************** test code;  










From: Rick Brownrigg <brownrig at ucar.edu>
Reply: Rick Brownrigg <brownrig at ucar.edu>>
Date: December 2, 2014 at 16:25:16
To: Alan Brammer <abrammer at albany.edu>>
Subject:  Re: [ncl-talk] gsMarkerOpacity != 1. and MarkerIndex 16 or 1  

Actually -- I may take part of my comments back --- was your example.png originally rendered as a png, or was it converted from something?


On Tue, Dec 2, 2014 at 2:17 PM, Rick Brownrigg <brownrig at ucar.edu> wrote:
Hi Alan,

I see what you mean, and I can't say this is desired behavior.  It curiously shows up only in the so-called document-based formats (ps, pdf, svg), but not in the image-based formats (X11, png).  I believe its the result of the circle's interior is filled, then the border drawn, and where those two markings overlap, the opacities accumulate.   I unfortunately don't know offhand how to resolve the problem, nor suggest a work-around. I will file a bug ticket however. 

Rick


On Tue, Dec 2, 2014 at 12:35 PM, Alan Brammer <abrammer at albany.edu> wrote:
Dear All.

Problem:  
When combining gsMarkerIndex 16 with gsMarkerOpacity < 1.0 a small but sometimes significant perimeter circle is drawn with Opacity = 1.0. Leaving a bold perimeter around the marker. 
Maybe this is the desired behaviour?  


Code and Examples:

wks = gsn_open_wks("pdf","test") 
res = True
res at gsnDraw = False
res at gsnFrame = False
plot = gsn_blank_plot(wks, res)
gs_res = True
gs_res at gsMarkerIndex = 16
gs_res at gsMarkerSizeF = 0.14     
gs_res at gsMarkerColor = "Red"
mark1 = gsn_add_polymarker(wks, plot, 0.3, 0.3, gs_res)
gs_res at gsMarkerOpacityF = 0.6
mark = gsn_add_polymarker(wks, plot, 0.5, 0.5, gs_res)
draw(plot)
frame(wks)

test.pdf   <- zoomed in from the above code. On the semi transparent marker the perimeter is evident.  This is normally not noticeable however. 
example.png  <-  map with lots of polymarkers on it.  The bold perimeter becomes rather evident in this use.  


Solutions?
gsLineOpacity does not seem to influence the perimeter line. 

I guess I should be using MarkerIndex 1 instead of 16  MarkerIndex 1 also does the same thing.  After testing it at the end of this email. 




Thanks,

Alan. 


P.s. Apologies if this comes thru twice, the first version had a pdf which was too large. 



-- 
Alan Brammer
PhD Candidate — African Easterly Waves and TC genesis
University At Albany, NY
www.atmos.albany.edu/student/abrammer

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141202/b335782c/attachment.html 


More information about the ncl-talk mailing list