Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R: {ggplot2}: How / Can I independently adjust the x-axis limits on a facet_grid plot?

I created a faceted set of three univariate densities -- comparing MCMC methods. Shown below

enter image description here

For the moment, I don't care about the tails. So how can I change the x-axis limits on the plots above to be:

c(-3,1)
c(-2,0)
c(-10, -8)

Is this even possible? I've already read this thread from 2009, but it doesn't seem to work. Was this implemented?

like image 970
M. Tibbits Avatar asked Nov 04 '22 18:11

M. Tibbits


1 Answers

You can always allow limits to be set independently for each facet by specifying

+ facet_wrap(...,scales = "free_x")

There are also "free" and "free_y" options.

like image 76
joran Avatar answered Nov 09 '22 04:11

joran