thomasp85 / ggforce

Accelerating ggplot2
https://ggforce.data-imaginist.com
Other
916 stars 106 forks source link

Wrong color using geom_arc_bar #315

Closed Hrq98 closed 9 months ago

Hrq98 commented 9 months ago

When using geom_arc_bar, the color of the plot doesn't match the color I input. code: ggplot()+ geom_arc_bar(data=df,aes(x0=x0, y0=y0,r0=r0,r=r,start=start,end=end,fill=c("green","blue"))) plot:

图片1

Please advise,thanks!

Hrq98 commented 9 months ago

the problem has been solved by scale_fill_identity(my_color) ,however I can't get rid of the borderline, I tried color=NA,color=NULL,color ="transparent",color=my_color,all failed to get rid of the borderline. Please advise,thanks!

thomasp85 commented 9 months ago

Can you provide a reproducible example.

The following shows that setting color to NA generally works

arcs <- data.frame(
    start = seq(0, 2 * pi, length.out = 11)[-11],
    end = seq(0, 2 * pi, length.out = 11)[-1],
    r = rep(1:2, 5)
)

# Behold the arcs
ggplot(arcs) +
    geom_arc_bar(aes(x0 = 0, y0 = 0, r0 = r - 1, r = r, start = start,
                     end = end, fill = r), colour = NA)