15

Given this data:

abTcells    1456.74119
Macrophages 5656.38478
Monocytes   4415.69078
StemCells   1752.11026
Bcells  1869.37056
gdTCells    1511.35291
NKCells 1412.61504
DendriticCells  3326.87741
StromalCells    2008.20603
Neutrophils 12867.50224

This plot: enter image description here

Is generated with the following code:

library(ggplot2)                  
df <- read.table("http://dpaste.com/1697602/plain/");
ggplot(df,aes(x=factor(1),y=V2,fill=V1))+
   geom_bar(width=1,stat="identity")+coord_polar(theta="y")

How can I remove the following:

  1. Circular coordinate, e.g. (0, 10000, 20000,30000)
  2. Y axis coordinate (e.g. 1)
  3. White circle.
pdubois
  • 7,640
  • 21
  • 70
  • 99
  • It's not about removing axis labels. But coordinates. So for example I do want to keep V2 as axis label, but I want to get rid of coordinate (0, 10000, 20000,30000). – pdubois Mar 07 '14 at 07:36
  • I hear you, but these labels make little sense on a polar plot. They can be removed by adding `+ labs(x="", y="")`. – Aren Cambre Nov 15 '18 at 20:25

1 Answers1

27

You may remove these elements by using relevant arguments in theme:

ggplot(df, aes(x = factor(1), y = V2, fill = V1))+
  geom_bar(width = 1, stat = "identity") +
  coord_polar(theta = "y") +
  theme(axis.text = element_blank(),
        axis.ticks = element_blank(),
        panel.grid  = element_blank())

enter image description here

After the entire grid is removed, you can manually add an own grid, using geom_hline and geom_vline (see here).

I recommend having a look in this tutorial.

Community
  • 1
  • 1
Henrik
  • 65,555
  • 14
  • 143
  • 159