Skip to content

Instantly share code, notes, and snippets.

@alienzj
Created June 10, 2017 09:15
Show Gist options
  • Save alienzj/1b3defc982d5e6f52f3cdf8789fb7f17 to your computer and use it in GitHub Desktop.
Save alienzj/1b3defc982d5e6f52f3cdf8789fb7f17 to your computer and use it in GitHub Desktop.
geom_bar plot
library(ggplot2)
library(tibble)
library(ggthemr)
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
# rm(list = ls())
ggthemr('pale',
layout = 'scientific',
spacing = 2,
type = 'inner')
SigTumor <-
data_frame(
tumor = c("ACC", "BLCA", "COAD", "DLBC", "FPPP", "HNSC",
"KICH", "LAML", "PAAD", "TGCT", "THYM", "UCEC"),
pvalue = c(12.04436579, 20.16520497, 68.27943137,
71.1663968, 67.00187081, 6.506952355,
4.024382401, 4.653271947, 3.448334588,
3.44587357, 3.574564826, 9.836858967))
p <-
ggplot(SigTumor, aes(tumor, pvalue)) +
geom_bar(aes(fill = tumor),
stat = "identity",
width = 0.5) +
scale_fill_manual(
name = "Group",
values = c("#a6cee3", "#1f78b4", "#b2df8a", "#33a02c",
"#fb9a99", "#e31a1c", "#fdbf6f", "#ff7f00",
"#cab2d6", "#6a3d9a","#ffff99", "#b15928")) +
ylab("-ln(-pvalue)")
p
ggthemr_reset()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment