ggplot2-book icon indicating copy to clipboard operation
ggplot2-book copied to clipboard

Arranging plot and illustration side by side

Open GregorKachel opened this issue 4 years ago • 2 comments

The solutions for putting plots side-by-side and on top of each other are great. However, is there a good way to combine a plot and a graphic (e.g. a png image of all stimuli used or of a particular setup) in the same panel side by side.

this here is not convincing: https://stackoverflow.com/questions/25204127/is-it-possible-to-create-a-multiplot-of-data-and-images-with-ggplot

GregorKachel avatar Jun 21 '21 14:06 GregorKachel

Thanks!

I'm revisiting this as part of a general sweep through open issues. It's a question about ggplot2 itself rather than something specific to the book, so there's nothing specific to address right now, and the new "arranging plots" chapter implicitly answers this. That said, I think there's a case to be made that we should discuss use cases like this one when talking about patchwork. In real life you often have this problem, and it might be worth highlighting that you can create a "dummy" plot that simply displays an image and then let patchwork take care of the arrangement?

Leaving open for now because we might want to revisit this

djnavarro avatar Feb 03 '23 07:02 djnavarro

Also worth noting this sort of mixing is sometimes easier to solve at a higher level, e.g. with https://quarto.org/docs/authoring/figures.html#figure-panels

hadley avatar Feb 03 '23 18:02 hadley