Tag Info

New answers tagged

2

You might want to consider a simple implementation with a Toggler. The only change you will need to make to your code is to explicitly set the image size of the histograms (because if the image size option is left at the default Automatic, the Toggler will shrink them down). Reproducible data. SeedRandom[42]; data1 = RandomVariate[NormalDistribution[0, ...


1

This will easily generalize to more than two histograms: Manipulate[ Switch[whichHistogram, 1, histo1, 2, histo2 ], {{whichHistogram, 1, "Choose histogram"}, {1 -> "blue", 2 -> "green"}} ]


0

You can use this binning function to avoid having to recalculate the mean and standard deviation if the data changes, or manually decide on how many standard deviations to include. binFunction[l_List] := Module[{\[Mu] = Mean[l], \[Sigma] = StandardDeviation[l]}, Mean[l] + \[Sigma] Range[Floor[Min[(l - \[Mu])/\[Sigma]]], Ceiling[Max[(l - ...


4

LabelingFunction is your friend, see here: Histogram[RandomVariate[NormalDistribution[0, 1], 500], LabelingFunction -> Above] You can also use ToolTipe like so: Tooltip[Histogram[RandomVariate[NormalDistribution[0, 1], 500]]]


3

data = RandomVariate[NormalDistribution[0, 1], 200]; Histogram[data, 50, ImageSize -> 400, LabelingFunction -> Tooltip]


2

Perhaps: data = {0, 0, 0, 0, 80, 100, 120, 130, 130, 140, 140, 150, 150, 160, 170, 200, 220, 240, 350}; {mean, std} = Through@{Mean, StandardDeviation}@data; You can specify the bin delimiters as an explicit list: bins = {Table[mean + k std, {k , -5/2, 5/2, 1}]}; Histogram[data, bins, Epilog -> {PointSize[Large], Red, Point@{mean, 0}}] ...


1

I'm not exactly sure what you want but here's the solution to a possible interpretation. Here are some test data ds = RandomVariate[NormalDistribution[1, 1], {10^4}]; The histogram of which is h = Histogram[ds]; (* output not shown here *) Now there's a function HistogramList[] which gives hlst = HistogramList[ds] (* Out[324]= {{-(13/5), -(12/5), ...


2

You can use BinCounts for that purpose, e.g. in that fashion: Block[{bw = {0, 50, 2}, ds1 = #"Var1" & /@ Normal[ds[Select[#"Var2" == 1 &]]], ds2 = #"Var1" & /@ Normal[ds[Select[#"Var2" == 2 &]]], ds3 = #"Var1" & /@ Normal[ds[Select[#"Var2" == Null &]]], bc1, bc2, bc3}, {bc1, bc2, bc3} = (ToString@Total@BinCounts[#, bw]) ...



Top 50 recent answers are included