Histogram with marginal boxplot in R -


how make matching x-axis in histogram marginal boxplot?

data <- rnorm(1000) nf <- layout(mat = matrix(c(1,2),2,1, byrow=true),  height = c(1,3)) layout.show(nf) par(mar=c(5.1, 4.1, 1.1, 2.1)) boxplot(data, horizontal=true,  outline=false) hist(data) 

one solution set ylim= in boxplot() same range xlim= in hist().

set.seed(123) data <- rnorm(1000) nf <- layout(mat = matrix(c(1,2),2,1, byrow=true),  height = c(1,3)) par(mar=c(5.1, 4.1, 1.1, 2.1)) boxplot(data, horizontal=true,  outline=false,ylim=c(-4,4)) hist(data,xlim=c(-4,4)) 

enter image description here


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -