model.result().dataset().create(<dtag>,"GrainBin") creates a grain bin set. This dataset evaluates an expression over all grains and then groups them into subintervals, or bins, based on which grains return similar values. If this dataset is then used in any other grain positions plot or evaluation, each bin produces a single grain having position and other properties equal to the average over grains in the bin.