달력

122025  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

ggplot2(pie chart)

Coding/R 2012. 9. 7. 11:47

data

Type Mapped upmapped
GSE 29642 625
GPL 4608 3519
GDS 2720 1
GSM 694599 14528
IDF 948 30
ADF 297 2151
SDRF 883 28





code

library(reshape2) # data 형태 변환

library(ggplot2)

setwd("C:\\Users\\jjbang\\Desktop\\GEE paper\\data\\")

f = read.table("mp.txt", header=TRUE,sep='\t')

tt = melt(f)

p <- ggplot(tt, aes(x = factor(1), y = value, fill = variable)) 

p = p +  geom_bar(width = 1) + coord_polar(theta = "y") + facet_wrap(~Type, scales = "free_y")

p = p+ scale_fill_manual(values=c("#191970", "#CAE1FF"))

p = p + opts(title = "mapping result of GEE when using ontology", legend.title=theme_blank())

p = p + xlab(" ") + ylab(" ")

p

'Coding > R' 카테고리의 다른 글

[plot] barplot with text  (0) 2017.06.13
line plot  (0) 2014.03.14
line plot  (0) 2014.01.28
ggplot histogram  (0) 2012.09.19
ggplot2 barplot  (0) 2012.09.07
Posted by jjbang
|