ggplot pie chart start in anti-clockwise direction while coord_polar(direction=1)

38 views
Skip to first unread message

Botao Fa

unread,
Jan 18, 2017, 9:17:40 PM1/18/17
to ggplot2
Hi there,
    
      I am using ggplot2 package to get a pie chart. The direction is anti-clockwise while I was using coord_polar with the default parameter (direction=1).
After testing with the classical code online, the result is still strange.

Here is the code:

#' # A pie chart = stacked bar chart + polar coordinates pie <- ggplot(mtcars, aes(x = factor(1), fill = factor(cyl))) + geom_bar(width = 1) pie + coord_polar(theta = "y")




The chart online is A(http://docs.ggplot2.org/current/coord_polar.html),  my result is B. Can anyone known tell how dose this happen?

A                                                                                                                                                                         B    



Many thanks!

Bert, F






Reply all
Reply to author
Forward
0 new messages