0
$\begingroup$

This question already has an answer here:

I remember the old way which was used in Mathematica 5.2 (maybe, 2003) for constructing histograms from data with already given counts over bins. It was so natural then to invoke:

<< Graphics`Graphics`
data = {10, 20, 35, 23, 15, 7, 2};
Histogram[data, FrequencyData -> True]

It saved us plenty of time in quick visualising simple items from quantum statistical physics, and we were using it alternately with ListPlot to have (not completely ugly) pictures of statistical distributions of energy levels in molecules. When I returned to these issues now, I discovered with surprise that this option has long ago disappeared, and no straight alternative is ever suggested in Wolfram's help. I know that recommendations are to plot BarChart instead, or to use some tricky combinations with Tally data or so, and there are many such questions on Stack Exchange (questions dated by 2010-1013). And I am aware that WeightedData objects appeared in some recent versions of Mathematica (which we do not possess: it is not our main math software now). But the question is now not "how", but: what were good reasons behind the withdrawal of such naturally looking option? As far as understand, it disappeared when Histogram migrated from external Graphics package into core facility, around Mathematica 7.0?

EDIT. maybe it is necessary to add the motivation to this question. The final outcome in the problem should be not histogram, but some interpolating function (smoothed kernel distribution) over such data, and x scale is not linear, but with predefined bins, distributed somewhere between logarithmic and linear. I found this functionality with BarChart, but it seemed rather unnatural to perform further analysis with smoothing, calculating PDF and CDF on nonlinear scale etc. In Histograms it is more "embedded" and straightforward.

$\endgroup$

marked as duplicate by Alex Trounev, LouisB, MarcoB, bbgodfrey, Michael E2 May 29 at 11:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ So, what version are you using now? $\endgroup$ – J. M. will be back soon Aug 17 '17 at 5:29
  • $\begingroup$ I'd say that using BarChart to plot pre-calculated frequencies is entirely natural. I was not familiar with the old usage, but I would have found it frankly rather confusing. What do you find unsatisfactory in the use of BarChart for this application? $\endgroup$ – MarcoB Aug 17 '17 at 5:42
  • $\begingroup$ @Marco, just for reference, old Mathematica's Histogram[{10, 20, 35, 23, 15, 7, 2}, FrequencyData -> True] is equivalent to BarChart[{10, 20, 35, 23, 15, 7, 2}] in the current Mathematica. You're right, it was a bit more circuitous back then... $\endgroup$ – J. M. will be back soon Aug 17 '17 at 5:45
  • $\begingroup$ The latest one is 7.0. Very old stuff, but, as said above, this business was postponed for some time (I use R for math now). They are developing too rapidly. $\endgroup$ – astrsk Aug 17 '17 at 13:23
  • $\begingroup$ And maybe it is necessary to add the motivation to this question. The final outcome in the problem should be not histogram, but some interpolating function (smoothed kernel distribution) over such data, and x scale is not linear, but with predefined bins, distributed somewhere between logarithm and linear. I found this functionality with BarChart, but it seemed rather unnatural to perform further analysis with smoothing, calculating PDF and CDF on nonlinear scale etc $\endgroup$ – astrsk Aug 17 '17 at 13:26

Browse other questions tagged or ask your own question.