Overlaying Plots - ganong-noel/lab_manual GitHub Wiki

How to overlay plots with transparency:

You need to use a photo editor that will allow you to adjust the transparency of layers. An example of an online photo editor with this feature is Photopea. To construct an image with overlay:

  1. Start a new document with appropriately sized canvas
  2. Paste both images into the editor
  3. The editor should have pasted the images as separate layers. In Photopea the layers can be accessed on the righthand side of the screen (circle 1). Choose the top layer and adjust its opacity downward (circle 2), until the bottom layer is clearly visible. If you would like to change the ordering of the layers this can be done by dragging and dropping the order.
  4. You can adjust the sizing of the image so that axes ticks line up using the "transform controls" in Photopea which can be accessed in a checkbox (circle 2) once the move tool (circle 1) is selected. In other image editors, they should similarly be accessed on some variation of the name "transform".

If you are replicating a plot using ggplot, you may find it helpful to use the breaks argument in scale functions (e.g. scale_y_continous(breaks = c(0, 0.1, 0.4)) to have common tick marks with the image you are replicating.