I am looking for a way to make a part of a plot related to the y-axis wider in R. My code is quite long, so I only attach the final picture here. I would like the y-axis between 0 and 2 to be a bit wider and between 2 and 10 to be a bit narrower. I appreciate your suggestions and thank you in advance!
Asked
Active
Viewed 123 times
0
-
3If you change the scaling of an axis at arbitrary points, you make the plot very difficult to interpret. Are you sure that's what you want? It basically defaults the point of creating a visualization that you can compare with your eye. Maybe a transformation across all your data would be better. Or some other way to look at the data. At the very least you should include some sort of [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input data that can be used for testing. – MrFlick Dec 22 '20 at 01:25
-
Thank you for your answer. Since the last two boxplots are collapsed, it is not quite likable. However, I agree changing a part of scaling could make the interpretation difficult across all the plots. I may consider some transformation. Providing a reproducible example code is quite difficult for this case. Thank you for all the suggestions! – Sarah Dec 22 '20 at 02:04
-
1As a counter-point: the fact that one cannot discern differences between the components of the boxplot *is very notable*. That is, not just the IQR, but the whole `1.5*IQR`-span is compressed into a very tight space, suggesting very low variance. Now if it is this "tight" due to very low "n" or because the value is of different units, then this plot is not appropriate for that. Barring that, though, I find even flat boxplots somewhat informative. (I do think boxplots in isolation don't tell the whole story, adding the "N" with each boxplot may be quite useful here.) – r2evans Dec 22 '20 at 02:32
-
For all of them N is 1000. – Sarah Dec 22 '20 at 02:55
-
Would transforming your data help? E.g. `+ scale_y_continuous(trans = log2_trans(), breaks = trans_breaks("log2", function(x) 2^x), labels = trans_format("log2", math_format(2^.x)))` – jared_mamrot Dec 22 '20 at 03:00