I'm looking to make a graph in R, something like this
Where plot 1, 2, and 3 are are at specified markings along the x-axis.
Noting an answer to a similar question, I think this can be done using the grconvertX
function with fig
, but I can't seem to get the code I wrote to plot more than one of the subplots. Here is the toy data and code.
#example
#main plot variables
x = seq(0,1, by=.1)
y = (x/(.2+x))
plot(x,y, type='b')
#subplot variables
xlocations = c(.2,.6,.8)
nXticks = length(xlocations)
for(i in 1:nXtick){
xloc = xlocations[i]
xRad = .05
par(fig = c(grconvertX(c(xloc-xRad, xloc+xRad), from="user", to="ndc"),
grconvertY(c(0, 0.1), from="user", to="ndc")),
mar = c(0,0,0,0),
new = TRUE)
plot(1:10,1:10, axes=F, xlab='', ylab=''); box();
}