I am trying to have free scales on a Boxplot faceted image.
Using this sample dataset, if I try this:
ggplot(data=mpg) + geom_boxplot(aes(x=cty, y=model))+ facet_grid(manufacturer ~ drv, scales = "free", space = "free")
Wrong rectangular graph http://dl.dropbox.com/u/9788680/plot1.png
Here, free scales are implemented exactly as we would like, with different scales for the y axis, depending on the number of available factors for the horizontal facet rule. Boxes, however, are not correctly shown (i.e., as solid lines instead of boxes). When I was looking for a solution, I found that I had to use the coord_flip () function to display boxplot correctly, i.e.
ggplot(data=mpg) + geom_boxplot(aes(x=model,y=cty))+ facet_grid(manufacturer ~ drv, scales = "free", space = "free")+ coord_flip()
Plan the rectangle, but without scaling http://dl.dropbox.com/u/9788680/plot2.png
In the above figure, the boxes are now correct. However, the free scale for the coefficients (for example, along the y axis) is deleted. Now, for each horizontal line of facets, all available factors for the dataset are now available, not just the factors available for each face (as shown in Figure 1).
I would like to know how I can get the correct face with a free scale on both axes by correctly representing the box.
If someone can point me in the right direction, I would appreciate it.
Thanks.