Better axis limits when using shared axes and empty subplots

This is one possible solution to #2356