How to remove line sample? You can sample the pixels of an image in a line with the Sample Line option in UV/Image editor > Properties Region > Sample Line, then dragging a line across an image. 

However, I can't figure out how to remove the line afterwards. (I can zoom out and sample a new line far away from the image so it is less distracting, but this can't be the right way to do it)

How to remove or hide the sample line?
Basically you have to re-initiate it and then cancel that operation.
If you have a line you can just LMB on the button once to activate it then RMB on it again.
You can also invoke the space-function search menu and search 'Sample Color' activate it and hit ESC to cancel it.