簡體   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