2

I want to add an additional tick to my plot in ggplot2, and used Solution 2 as described in the post Annotate ggplot with an extra tick and label.

It worked fine for me, giving the following result in R Studio:

enter image description here

But when I try to save the result using ggsave() to create the a .pdf, .ps, or .png file, the red number is cut off half like this:

enter image description here

I have the feeling that the inner plot is printed first and later the margins are plotted on top of this.

Anybody has a hint?

Michael Harper
  • 13,303
  • 2
  • 55
  • 79
arnohakk
  • 43
  • 4

1 Answers1

1

Thank you Z. Lin! I just had a grid.draw(g) instead of g <- grid.draw(g). This dot in R always activates my python brain region :)

arnohakk
  • 43
  • 4