I'm trying to insert a ragged line on a plot axis by using an inset. However, I always get white space around the inset such that my axis is broken at some point. What can I do to remove the white space?

Plot[x, {x, 0, 1}, ImageSize -> 300, 
Epilog -> {{Inset[
  ImageSize -> 15], 
  Background -> White],
  {0.5, 0}]}},
  ImagePadding -> 15,PlotRangeClipping -> False]

enter image description here

  • $\begingroup$ Is there a specific reason why you use this whole Inset[Style[Graphics[Line[...] ...]]] and not just give the graphics directive directly in Epilog, like Epilog -> {White, Rectangle[{0.475, -.1}, {.525, .1}], Black, Thickness[0.002], Line[...]}? $\endgroup$
    – Theo Tiger
    Apr 5, 2018 at 13:04
  • $\begingroup$ There is no specific reason other than my limited knowledge about alternatives. $\endgroup$
    – Fabian
    Apr 5, 2018 at 16:26

1 Answer 1


Just add PlotRangePadding -> 0, ImagePadding -> 0 to the inner Graphics object.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.