ggplot2 plots not rendering points if alpha in geom_points is set to other value than 1 in anaconda
<p>I am trying to use R through Anaconda python. rpy2 is installed. The problem I am running into is when I set alpha to a value other than 1 in geom_point the points do not show in the plot but will show if alpha is set to 1. Am I missing something? Here is the code that I am running (Ubuntu16.04):</p>

<pre><code>from rpy2 import robjects
from rpy2.robjects.packages import importr
import rpy2.robjects.lib.ggplot2 as ggplot2
from rpy2.robjects.packages import importr
base = importr('base')

#mtcars = datasets.__rdata__.fetch('mtcars')['mtcars']

rnorm = stats.rnorm
dataf_rnorm = robjects.DataFrame({'value': rnorm(300, mean=0) + rnorm(100, mean=3),
                                  'other_value': rnorm(300, mean=0) + rnorm(100, mean=3),
                                  'mean': IntVector([0, ]*300 + [3, ] * 100)})


gp = ggplot2.ggplot(dataf_rnorm)

pp = gp + \
     ggplot2.aes_string(x='value', y='other_value') + \
     ggplot2.geom_point(alpha = 1) + \
     ggplot2.geom_density2d(ggplot2.aes_string(col = '..level..')) + \
     ggplot2.ggtitle('point + density')
pp.plot()
</code></pre>

<p>Thanks for any insight.</p>

<p><a href="http://i.stack.imgur.com/qvd9N.png" rel="nofollow">alpha set to 0.4</a></p>

<p><a href="http://i.stack.imgur.com/JNRDl.png" rel="nofollow">alpha set to 1</a></p>

<p>This can happen if the R "graphics device" is not able to handle alpha transparency (this is most likely settled at build time, depending on the libraries used to compile the R devices).</p>

<p>For PNG, try specifying the use of /cairo/:</p>

<pre><code># rpy2 version 2.8.4 of later
# (see  https://bitbucket.org/rpy2/rpy2/issues/371))
from rpy2.robjects.lib import grdevices
with grdevices.render_to_file(grdevices.png,
                              filename="my-plot.png",
                              type="cairo-png") as p:
    pp.plot()



# Earlier versions of rpy2 where issue #371 is still present
from rpy2.robjects.lib import grdevices
grdevices.png("my-plot.png", type="cairo-png")
pp.plot()
grdevices.dev_off()
</code></pre>

python anaconda