# 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),
value=fits[[i]]\$irf[][,1],
Lower=fits[[i]]\$Lower[][,1],
Upper=fits[[i]]\$Upper[][,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.
{"ft_lang_label":"__label__en","ft_lang_prob":0.7334122,"math_prob":0.9748988,"size":1094,"snap":"2021-43-2021-49","text_gpt3_token_len":352,"char_repetition_ratio":0.1,"word_repetition_ratio":0.0,"special_character_ratio":0.29981717,"punctuation_ratio":0.1889401,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99154687,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-11-28T14:19:11Z\",\"WARC-Record-ID\":\"<urn:uuid:01e24df5-e6a2-473b-a95e-310906027b1a>\",\"Content-Length\":\"22322\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:ce591f22-ad29-4e8c-8745-0a9746dcbeb9>\",\"WARC-Concurrent-To\":\"<urn:uuid:8659737c-c5be-4bba-acfe-f3afedb28ea0>\",\"WARC-IP-Address\":\"167.99.20.217\",\"WARC-Target-URI\":\"https://community.rstudio.com/t/individual-scales-for-combined-irf-ggplot/119051\",\"WARC-Payload-Digest\":\"sha1:SCEGCVWKS4T53QGFMTMC6IWSLHYBHQVB\",\"WARC-Block-Digest\":\"sha1:NEYP3NEKCDDOJV5YSKZFWXUQZE6NYGID\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-49/CC-MAIN-2021-49_segments_1637964358560.75_warc_CC-MAIN-20211128134516-20211128164516-00513.warc.gz\"}"}