# Individual Scales for combined IRF ggplot

I have been estimating a VAR system using R. I have attached a picture of IRFs from this system that I compiled using the following code below:

"
VAR1

#Plots
RESPONSE = c("Dollar","residual","USWealthShare","USWealthShareChange")
IMPULSE = "GlobalConsumption"

fits = lapply(RESPONSE,function(i){
irf(SVAR1,response=i,impulse=IMPULSE,
})
names(fits) = c("Dollar","residual","USWealthShare","USWealthShareChange")

plotdf = lapply(names(fits),function(i){
data.frame(
index = 1:nrow(fits[[i]]\$irf[[1]]-1),
value=fits[[i]]\$irf[[1]][,1],
Lower=fits[[i]]\$Lower[[1]][,1],
Upper=fits[[i]]\$Upper[[1]][,1],
Impulse = i)
})
plotdf=do.call(rbind,plotdf)

p=ggplot(plotdf,aes(x=index,y=value)) +
geom_line() +facet_wrap(~Impulse) +
geom_ribbon(aes(ymin=Lower,ymax=Upper),fill=NA,col="salmon",linetype="solid", alpha = 0.25) +
geom_hline(yintercept=0,col="salmon") + theme_bw()

"

However as you can see the scales for the bottom two graphs are much smaller, so I am looking to adjust the scales for these graphs to range between 0.01 and -0.01. How would I go about doing this?

Try setting the scales argument of facet_wrap() to "free_y".

``````facet_wrap(~Impulse, scales = "free_y")
``````

I tried this but it still doesn't adjust the scales. The graph remains the same- the scales are uniform.

Can you post the version of plotdf that is used in the ggplot call? You can run

``````dput(plotdf)
``````

and paste the output here. Please put a line with three back ticks just before and after the output, like this
```
dput output here
```

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.