Bin size and number of bins #18
Replies: 1 comment 2 replies
-
Hi Joe. Thank you for using GrainSizeTools. To generate a histogram with a specific bin size you can use the # import numpy if you have not already done so
import numpy as np
# Create an array containing the limits of the bins using np.arange(Start of interval, End of interval, Spacing between values)
bin_size = 5.0
bin_edges= np.arange(dataset['diameters'].min(), dataset['diameters'].max() + bin_size, bin_size)
# generate the histogram
fig, ax = plot.distribution(dataset['diameters'], binsize=bin_edges) In the example above, I have used the minimum and maximum values of the distribution as the start and end values, and a step size of 5.0, but you can use any value you like. Note that the bin size should also be added to the maximum value to ensure no data is left out of the histogram. Let me know if it works for you. Best, Marco. PS. The way |
Beta Was this translation helpful? Give feedback.
-
I have been very impressed with this software and have been using it to understand differences between EBSD maps from a variety of samples. To make close comparisons I would like to have the same number of bins and bin sizes for each analysis. I can set the number of bins but I do not know how to set the bin size. Is this possible ?
Thanks
Joe Michael
Beta Was this translation helpful? Give feedback.
All reactions