How to extract outline of a grid-like plot when you have information about the lines? I am trying to get the outline of a plot that looks like: this