(First a lollipop remake of Bill's solution.)
data = Tally[RandomInteger[{1, 10}, 100]];
ListPlot[data,
Epilog -> {Blue, Thickness[.02],
Line[data /. {a_, b_} :> {{a, 0}, {a, b}}]}, Frame -> True,
PlotRange -> {-.5, 20}, Axes -> None,
PlotStyle -> {PointSize[0.1], Red}]
and a solution of my own:
{xMin, yMin} = Min /@ Transpose@data;
{xMax, yMax} = Max /@ Transpose@data;
Graphics[{EdgeForm@{Thick, Black}, Blue,
Table[Rectangle[pair {1, 0}, pair + {1/2, 0}], {pair, data}]},
AspectRatio -> 1/GoldenRatio, Frame -> True]
Bobby
On Wed, 04 Nov 2009 00:40:00 -0600, Bill Rowe <readn...@sbcglobal.net>
wrote:
> On 11/3/09 at 2:54 AM, szhor
...@gmail.com (Szabolcs Horv=C3=A1t) wrote:
>> I would like to create a histogram-like plot. I already have the
>> frequency data, so I don't need to use the Histogram function
>> itself.
>> What is the easiest way to do this?
> Here is one way that seems simple to me.
> data = Tally[RandomInteger[{1, 10}, 100]];
> ListPlot[data,
> Epilog -> {Blue, Thickness[.05],
> Line[data /. {a_, b_} :> {{a, 0}, {a, b}}]}, Frame -> True,
> PlotRange -> {-.5, 20}, Axes -> None]
--
DrMajor...@yahoo.com