Is there some built-in I can reuse to get a "stacked" number line plot? In other words, equivalent to NumberLinePlot
, but some numbers occur more than once, so that should be reflected by stacking them.
Neither NumberLinePlot
nor Histogram
quite do it
(* visualize values of Tr(ABAAB...) for all permutations of ABAB.. *)
SeedRandom[1];
d = 3; (* dimensions *)
s = 5; (* length of product *)
eigs1 = 1./Range[d];
eigs2 = 1./Range[d];
{b1, b2} = RandomVariate[CircularRealMatrixDistribution[d], 2];
A = b1 . DiagonalMatrix[eigs1] . b1\[Transpose];
B = b2 . DiagonalMatrix[eigs2] . b2\[Transpose];
Clear[a, b, singleTrajectory];
singleTrajectory[s_] := RandomChoice[{a, b}, s];
sub := {a -> A, b -> B};
numSamples = 100;
orders = Table[RandomChoice[{a, b}, s], {numSamples}];
evalOrder[order_] := Log@Tr[Dot @@ (order /. sub)];
vals = evalOrder /@ orders;
NumberLinePlot[vals]
SmoothHistogram[vals]
background on mathoverflow.SE