Coloring similar entries in a matrix with the same color

Short answer: probably use round.(A, sigdigits=2) or similar to assign colors. (Adjust sigdigits as desired, or use digits if you want an absolute tolerance.)

Longer answer: approximate comparison is not transitive, so trying to define “uniqueness subject to a tolerance” inevitably will encounter some odd behaviors. This has been a frequently discussed topic. See, for example:

1 Like