title <- rep("A Really Rather Long Text Label", 25)
value <- runif(25, 1,10)
spacing <- seq(1:25)
df <- data.frame(title, value, spacing, stringsAsFactors = FALSE)

myplot <- ggplot(data=df, aes(x=spacing, y=value, label = title)) +
    geom_text(aes(colour = value),
        size = 2.5, fontface = "bold",
        vjust = 0,
        position = position_jitter(width=5, height=0)) +
    theme_bw() +
    scale_x_continuous(limits = c(-5, 30))+
    scale_colour_gradient(low = "#6BAED6", high = "#08306B") +
    opts(axis.title.x = theme_blank(),
        axis.ticks = theme_blank(),
        axis.text.x = theme_blank(),
        legend.position = "none")
myplot

================================

library("ggplot2")
tmp <- data.frame(x=-5:5, y=rnorm(11), lab=LETTERS[1:11])
p <- ggplot(aes(x=x, y=y, label=lab), data=tmp)+
geom_point()+
geom_text(data=subset(tmp, x >0), hjust=-0.5)+
geom_text(data=subset(tmp, x <=0), hjust=1.5)
print(p)
================================
dat <- read.table(text="
cars trucks suvs
1 2 4
3 5 4
6 4 6
4 5 6
9 12 16", header=TRUE,as.is=TRUE)
dat$day <- factor(c("Mo","Tu","We","Th","Fr"),
levels=c("Mo","Tu","We","Th","Fr")) library(reshape2)
library(ggplot2) mdat <- melt(dat, id.vars="day")
head(mdat)
ggplot(mdat, aes(variable, value, fill=day))+
geom_bar(stat="identity", position="dodge")
================================

http://sape.inf.usi.ch/quick-reference/ggplot2/colour
================================ http://docs.ggplot2.org/current/

最新文章

  1. python统计列表内元素个数
  2. js表单元素checked、radio被选中的几种方式-遁地龙卷风
  3. FAST特征点检测
  4. 第三个Sprint冲刺第三天
  5. git delete repository
  6. 【读书笔记】iOS-使用应用内支付注意事项
  7. Update From 用法
  8. windows phone 网易云阅读hubtile效果实现
  9. Spring Cloud介绍 Spring Cloud与Dubbo对比
  10. UVA507-- Jill Rides Again
  11. 50 tips of JavaScript
  12. kubernetes进阶(03)kubernetes的namespace
  13. Netty与网络编程
  14. python拟合数据,并通过拟合的曲线去预测新值的方法
  15. C# string.join
  16. 从零搭建 ES 搜索服务(五)搜索结果高亮
  17. [转]Python shutil 模块
  18. 12C -- ORA-28040
  19. 2-MAVEN 基本命令
  20. 问题1:jquery实现全选功能,第二次失效(已解决)

热门文章

  1. ios应用启动后的自动版本检测方式
  2. extern &quot;C&quot;——用“C”来规约在C++中用C的方式进行编译和链接
  3. win7 telnet命令无法使用
  4. ETL Pentaho Data Integration (Kettle) 插入/更新 问题 etl
  5. python 发邮件 utf-8
  6. POJ 3614 Sunscreen 贪心
  7. 【转载】VMWare ESXi 5.0和vSphere Client安装和配置
  8. 【BZOJ】【2594】【WC2006】水管局长数据加强版
  9. Guava文档翻译之 Guava简介
  10. POJ1182 食物链