solid lines around boxes on pdf

51 views
Skip to first unread message

fulz

unread,
Jul 28, 2017, 2:35:38 AM7/28/17
to ggplot2

I already asked this over at stackoverflow, but didn't get an answer yet. Might it be a bug?


I want to compare different peaks from histograms, so I put two of them into one plot with alpha=0.5. The default output in RStudio looks fine, but when I use pdf() or ggsave() or even CairoPDF() the resulting output has solid lines around the boxes. In my case these solid lines sometimes look very ugly when zooming the pdf display. I want to disable these solid lines or at least have the lines to be the same color/alpha as the filling.


Minimal Code Example:


library(ggplot2)

p1<-ggplot()+
  geom_histogram(data=diamonds[diamonds$cut == "Premium",],aes(x=depth,fill=cut),alpha=0.5)+
  geom_histogram(data=diamonds[diamonds$cut == "Ideal",],aes(x=depth,fill=cut),alpha=0.5)

ggsave("histoline.pdf",p1)


this is the output:




(sorry if I made a double post, I wanted to edit something, but didn't see my first post)

fulz

unread,
Jul 28, 2017, 6:07:12 AM7/28/17
to ggplot2
hmmm, maybe the bars are overlapping a tiny bit?
Reply all
Reply to author
Forward
0 new messages