简体   繁体   中英

R: common legend for multiple plots with different scales

I have 6 ggplots which I align with the arrange.grid into 3 rows. I want to create a common legend for all the plots. I read this answer from this question which explained things in a very nice way.

Add a common Legend for combined ggplots

but the problem is that the idea mentioned here will take the legend of p1.

in my case, the legend in each plot has a different scale.

i.e. p1 : 0.6 to 0.8
i.e. p2 : 1.6 to 2.2

hence this answer does not work in my case.

How can i make 1 legend that contain the scale limits of all the 6 plots.

我想我找到了一种解决方法,即创建一个包含所有其他图的所有比例的新图,并将其用作自定义图例。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM