Tag Info

New answers tagged

2

The straightforward solution is to construct the histogram from the list of bins and histogram heights returned by HistogramList (on which Histogram is based) explicitly: SeedRandom[1] data = RandomVariate[NormalDistribution[10, 2], 500]; hlist = HistogramList[data, Automatic, "PDF"]; Graphics[{RGBColor[1, 0.8, 0.5], EdgeForm[{Black, Thickness[Small]}], ...


5

You can also Plot the scaled PDF of the HistogramDistribution of data: SeedRandom[1] data = RandomVariate[NormalDistribution[10, 2], 500]; hd = HistogramDistribution[data]; {min, max, length} = Through@{Min, Max, Length}@data; Plot[Evaluate[Length[data] PDF[hd, x]], {x, min - 2, max + 2}, AxesOrigin -> {min - 2, 0}, Exclusions -> None, PlotStyle ...


9

The underlying problem is that Histogram creates a set of Rectangles which represent the bars. You can inspect this by looking at the underlying form of the created graphics h = Histogram[RandomVariate[NormalDistribution[10, 2], 500], Automatic, "PDF", PerformanceGoal -> "Speed"]; InputForm[h] This reveals that each bar in the histogram is ...


9

I think you could achieve what you want by overlaying two Histogram objects, one with no Edges but colored bars, the second one with Edges, but transparent bars, as in this example: data = RandomVariate[NormalDistribution[10, 2], 500]; Show[{ Histogram[data, ChartStyle -> Directive[Opacity[0], ...


6

Update: SeedRandom[123] d1 = BinormalDistribution[.75]; r = RandomVariate[d1, 20]; hg = Histogram3D[r, Automatic, "PDF", ChartStyle -> Opacity[.35]]; sh = SmoothHistogram3D[r, Automatic, "PDF", BoundaryStyle -> None, PlotStyle -> None, Mesh -> {{{.03, Directive[Thick, Orange]}, {.11, Directive[Thick, Red]}}}]; Row[{Show[hg, sh, PlotRange ...


3

Edit, based on the added info in the question: data1 = RandomVariate[BinormalDistribution[.75], 10]; distribution1 = SmoothKernelDistribution[data1]; data2 = RandomVariate[BinormalDistribution[.75], 10]; distribution2 = SmoothKernelDistribution[data2]; ContourPlot[ {PDF[distribution1, {x, y}] == 10^(-2), PDF[distribution2, {x, y}] == ...


1

You could just re-write the Ticks: Histogram[mydata, Automatic, "Probability", Ticks -> {{#, # + 1, {0.015, 0}} & /@ Range[-3, 3], {#, # + 1, {0.015, 0}} & /@ Range[0, 0.35, 0.05]}] Minor ticks are left as an exercise for the reader.


7

Update: An alternative approach is to use ChartElementFunction: Histogram[data, Automatic, "Probability", ChartStyle -> "Rainbow", ChartElementFunction -> (ChartElementDataFunction["GlassRectangle"][1 + #, ##2] &), AxesOrigin -> {-3, 1}, PlotRange -> All] Original post: SeedRandom[1]; data = RandomVariate[NormalDistribution[], 100]; ...


0

To shift left-to-right, merely add $1$ to each sampled point: SeedRandom[1]; 1 + #& /@ RandomVariate[NormalDistribution[], 100]; Histogram[%, Automatic, "Probability"] If one lists the vertical axis as "probability," then surely one doesn't want to add $1$ to each abscissa value as that would violate the definition of a probability measure.


4

The large list contains a lot of redundant data, but I think what you want is something like this: calling your list w, first simplify it by defining u = Length /@ w {17, 19, 21, 22, 21, 21, 22, 19, 24, 26, 27, 31, 35, 34, 29, 26, 29, 33, 31, 35, 35, 31, 32, 32, 37, 38, 31, 26, 27, 30, 28, 36, 35, 34, 35, 36, 37, 32, 35, 39, 39, 44, 38, 40, 38, 39, ...


4

More or less a duplicate of this answer, but just to demonstrate how it is used: Some data: d1 = RandomVariate[NormalDistribution[0, 1], 200]; d2 = RandomVariate[NormalDistribution[0, 1], 1000]; Create the individual plots and then combine them using Overlay optsall = {Axes -> False, Frame -> True, ImageSize -> 600, BaseStyle -> {Thick, ...



Top 50 recent answers are included