I have a series of datasets of pairs of variables. I would like to measure how non-linear the relationship between the pairs of variables is. The correlation coefficient is not good enough because it doesn't really consider discontinuities in the dataset distribution, which is something I'm very interested in capturing.
The following picture has two examples of my datasets. Both have correlations bigger than $0.5$, but the one on the left shows some important discontinuties which I'd like to capture.

One option would be computing the sum of the residuals normalized by the y-mean, but that doesn explicitly account for the discontinuities either...
Any suggestions?
Thank you!
PS: I apologize for the (ab)use of the term discontinuous.