(First time R user) So I'm trying to make overlapping histogram plots with different ranges for x axis values I can easily reproduce from an excel file. I feel like I'm on the right track because its plotting both histograms and making an x axis on 3. I cant seem to figure out how to make the axis(3) take the xlim= that I want. Below is the code Im using and a picture
## Open Xl Data into R
library(readxl)
dataset <- read_excel("location holder")
View(dataset)
## DLS subsets
Zone_1_DLS <- subset(dataset$DLS, dataset$Zone==1)
Zone_2_DLS <- subset(dataset$DLS, dataset$Zone==2)
Zone_3_DLS <- subset(dataset$DLS, dataset$Zone==3)
## ROP Subsets
Zone_1_ROP <- subset(dataset$DAVG_ROP, dataset$Zone==1)
Zone_2_ROP <- subset(dataset$DAVG_ROP, dataset$Zone==2)
Zone_3_ROP <- subset(dataset$DAVG_ROP, dataset$Zone==3)
## DLS Histograms
DLS1 <- hist(Zone_1_DLS)
DLS2 <- hist(Zone_2_DLS)
DLS3 <- hist(Zone_3_DLS)
## ROP Histograms
ROP1 <- hist(Zone_1_ROP)
ROP2 <- hist(Zone_2_ROP)
ROP3 <- hist(Zone_3_ROP)
## Plot Zone 1 Histograms
plot( ROP1, col=rgb(1,0,0,1), xlim=c(0,300), ylim = c(0,500))
plot( DLS1, axis(3),col=rgb(0,0,1,1), xlim=c(0,10), add = T)
axis(3,xlim=c(0,10))