Going off of @corey979 's comment.
A slightly more rigorous way to fix your problem with corey's comment is to use the standard deviation
, as opposed to the arbitrary rounding of 1
.
Length /@
DeleteDuplicates /@ {Round[#,
StandardDeviation[pts][[1]]/35] & /@
Transpose[
pts][[1]], (Round[#,
StandardDeviation[pts][[2]]/36] & /@
Transpose[pts][[2]])}
Note that the 35
isand 36
are arbitrary, and you should modify itthem to whatever works best for you.
Also, this works for pts*100a*pts
. In other words, this method is scale invariant, as you requested.
P.S. A prettier version of the code doesn't give the correct answer, unfortunately
Length /@
DeleteDuplicates /@ (Round[#, StandardDeviation[#]/35] & /@
Transpose[pts])