I want to create a histogram which has spacing between its bins (as shown below):
to create this I used the following method:
data1 = RandomVariate[NormalDistribution[0, 1], 500];
f2[d_][{{xmin_, xmax_}, {ymin_, ymax_}}, ___] := Rectangle[{xmin + d (xmax - xmin)/2, ymin}, {xmax - d (xmax - xmin)/2, ymax}]
h1=Histogram[data1, Automatic, ChartElementFunction -> f2[0.1]]
However, I want to export this data as is to a list so I can apply some functions and try to see how much worse my fits get as I try to increase the space in between the bins. To export the data to a list I use:
histData=HistogramList[h1]
which understandably gives me errors. Is there a way I can get the data as it is shown in the drawn histogram (image above) to a list so I can try to apply fits on it with a function etc. This is just a test example, my real function is for 10^7 points and has a custom probability distribution function
HistogramList[data1]
but you'd want to add any specifications of bin spacing, etc. $\endgroup${{-3, -(5/2), -2, -(3/2), -1, -(1/2), 0, 1/2, 1, 3/2, 2, 5/2, 3, 7/ 2}, {1, 8, 22, 59, 67, 112, 80, 80, 42, 22, 6, 0, 1}}
. The first element consists of the boundaries of the bins. The specifications for the bins is done inHistogramList
and not inRandomVariate
. $\endgroup$d
goes from 0.1 to 0.5. The point is not that you're doing something wrong but rather many of us aren't understanding what you want. $\endgroup$