繁体   English   中英

删除twoord图中的所有轴值和标签

[英]Remove all axis values and labels in twoord plot

我想删除所有包括x,左,右y的轴,但保留绘图的边界。 我试图将xaxtyaxt设置为'n'但是没有运气。

library(plotrix)

twoord.plot(2:10,seq(3,7,by=0.5)+rnorm(9),
        1:15,rev(60:74)+rnorm(15),
        type=c("bar","l"), 
        xaxt='n',
        yaxt='n')

有什么建议吗? 提前致谢。

从我所见,我不这么认为。 无论如何,创建此图很简单:

library('plotrix')
set.seed(1)
x1 <- 2:10
y1 <- seq(3,7,by=0.5)+rnorm(9)
x2 <- 1:15
y2 <- rev(60:74)+rnorm(15)

par(mfrow = c(1, 3), mar = c(3, 3,2,3))
twoord.plot(x1, y1, x2, y2, type=c("bar","l"), xaxt='n', yaxt='n', mar = c(3, 3,2,3))

## to recreate
plot(x1, y1, type = 'n', xlim = range(x2), ylim = range(y1))
rect(x1 - .4, 0, x1 + .4, y1, col = 'black')
par(new = TRUE)
plot(x2, y2, type = 'l', col = 'red', axes = FALSE)
axis(4, col.axis = 'red')

## again with no axes
plot(x1, y1, type = 'n', xlim = range(x2), ylim = range(y1), axes = FALSE)
rect(x1 - .4, 0, x1 + .4, y1, col = 'black')
par(new = TRUE)
plot(x2, y2, type = 'l', col = 'red', axes = FALSE)
box()

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM