干细胞之家 - 中国干细胞行业门户第一站

 

 

搜索

How to plot “+” shape coordinate with R

已有 343 次阅读 2015-6-20 01:29 |个人分类:R/Bioconductor|关键词:R, coordinate

First, we need initiate a new plot with plot function without x-y axis. If you want to define xlim and/or ylim, do this in this initiated plot with parameters xlim and ylim.


> plot (-2:4, c(-5, -4, 3, 4, 5, 2, 3), axes=FALSE, xlim=c(-6,6), ylim=c(-6, 6), xlab="", ylab="", main="")

Then, use axis to add the “+” shape coordinate.

> axis (1, pos=0, col="red", at=c(-6, -4, -2, 2, 4, 6))
> axis (2, pos=0, col="red", at=c(-6, -4, -2, 2, 4, 6))

“pos” show the x or y axis position, “at” show the ticks were marked at positions

For other properties, use ?axis to see.


路过

雷人

握手

鲜花

鸡蛋

评论 (0 个评论)

facelist

你需要登录后才可以评论 登录 | 注册
验证问答 换一个

Archiver|干细胞之家 ( 吉ICP备2021004615号-3 )

GMT+8, 2024-4-18 15:39

Powered by Discuz! X1.5

© 2001-2010 Comsenz Inc.