Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

histogram without vertical lines in Mathematica

I am trying to make an histogram without vertical lines. I'd like to have a plot which looks like a function. Like this: enter image description here

The same question has been asked for R before ( histogram without vertical lines ) but I'm on Mathematica.

I have been looking into the ChartStyle options without success.

like image 799
tos Avatar asked Jan 12 '12 17:01

tos


1 Answers

You could also use ListPlot with InterpolationOrder->0:

(* example data *)
data = RandomVariate[NormalDistribution[], 10^3];

hist = HistogramList[data, {.5}];

ListPlot[Transpose[{hist[[1]], ArrayPad[hist[[2]], {0, 1}, "Fixed"]}],
  InterpolationOrder -> 0, 
  Joined -> True, 
  AxesOrigin -> {hist[[1, 1]], 0}]

histogram

like image 117
Heike Avatar answered Sep 20 '22 16:09

Heike