I have to compare histogram of rational numbers, associated each time with 3 dataset and, sometimes, one of these datasets is empty.
Example: consider
Data = {{3/194, 1/194, 1/194, 1/194, 2/97, 3/194, 1/194, 2/97, 9/194,
1/97, 1/194, 7/194, 1/194, 1/97, 2/97, 3/194, 2/97, 1/194, 2/97,
1/194, 1/194, 1/194, 2/97, 1/194, 4/97, 4/97, 1/194, 3/194, 1/194,
3/194, 2/97, 1/194, 1/97, 1/194, 4/97, 7/194, 1/194, 1/194, 2/97,
5/194, 1/97, 1/194, 1/194, 5/194, 3/194, 1/97, 5/194, 3/194,
1/194, 1/194, 1/97, 3/194, 3/194, 1/97, 3/194, 1/194, 2/97, 1/97,
1/97, 3/194, 1/97, 1/97, 3/194, 1/194, 1/194, 2/97, 1/97, 1/97,
3/194, 2/97, 1/97, 5/194, 3/194, 3/194, 1/194, 3/194, 1/97, 3/194,
1/97, 1/194, 2/97, 1/97, 1/97, 2/97, 1/97, 1/97, 1/97, 1/194,
1/97, 1/194, 1/194, 5/194, 5/194, 1/97, 1/194, 1/194, 1/97, 3/194,
5/194, 1/194, 3/194, 1/194, 3/194, 1/194, 2/97, 1/194, 3/194,
3/194, 1/194, 1/97, 1/194, 1/194, 1/97, 3/194, 3/194, 3/97, 1/194,
3/194, 2/97, 1/194, 5/194, 1/194, 1/97, 3/194, 2/97, 1/194,
3/194, 5/194, 1/97, 2/97, 1/97, 2/97, 2/97, 5/194, 1/194, 1/194,
1/194, 1/97, 5/194, 2/97, 3/194, 1/194, 2/97, 1/194, 3/97, 2/97,
1/194, 1/194, 1/97, 2/97, 3/194, 1/194, 1/97, 1/194, 1/194, 1/97,
3/194, 1/194, 1/194, 1/194, 2/97, 1/194, 1/194, 2/97, 1/194,
1/194, 2/97, 3/194, 2/97, 3/194, 2/97, 1/194, 1/97, 1/194, 1/194,
3/194, 1/97, 1/194, 3/194, 1/194, 3/194, 1/97, 1/194, 3/194,
1/194, 1/194, 1/194, 1/194, 5/194, 1/97, 2/97, 1/97, 1/194, 2/97,
2/97, 1/194, 1/97, 1/194, 2/97, 5/194, 1/194, 1/97, 1/194, 1/194,
1/97, 2/97, 1/194, 1/97, 1/194, 2/97, 3/194, 5/194, 1/194, 2/97,
1/194, 2/97, 1/194, 1/194, 2/97, 3/194, 1/97, 1/194, 1/97, 1/97,
5/194, 3/194, 3/194, 3/194, 1/194, 1/194, 1/97, 1/97, 3/194, 2/97,
1/97, 1/97, 3/194, 1/97, 1/97, 1/97, 1/194, 2/97, 1/194, 1/97,
1/194, 1/97, 1/194}, {1/97, 1/97}, {1/97, 3/194, 3/194, 1/194,
1/97, 1/97, 3/194, 3/194, 1/194, 3/194, 1/97, 1/194, 1/194, 1/97,
1/194, 1/194, 1/194, 1/194, 3/194, 1/97, 1/194, 1/194, 1/97,
1/194, 1/194, 1/194, 1/194, 1/97, 1/97, 1/194, 1/97, 5/194, 1/194,
1/97, 1/194, 1/97, 1/97, 1/194, 3/194, 3/194, 1/194, 1/194, 1/97,
1/97, 3/194, 1/97, 1/97, 3/97, 1/97, 2/97, 1/97, 3/194, 1/97,
3/97, 3/194, 1/194, 1/194, 1/97, 3/97, 5/194, 1/97, 3/194, 1/194,
1/194, 1/97, 1/97, 1/97, 1/97, 1/97, 1/194, 3/194, 1/194, 1/194,
5/194, 1/194, 2/97, 3/194, 1/194, 1/97, 1/194, 3/194, 1/194,
1/194, 1/97, 3/194, 1/194, 7/194, 1/97, 3/194, 3/194, 2/97, 1/97,
1/97, 1/194, 2/97, 1/194, 2/97, 1/97, 3/97, 1/97, 1/97, 1/194,
1/97, 3/194, 5/194, 5/194, 1/194, 3/194, 1/97, 1/194, 3/97, 1/97,
1/194, 2/97, 5/97, 1/194, 1/194, 2/97, 3/97, 1/194, 1/97, 4/97,
1/194, 4/97, 1/97, 1/194, 2/97, 1/194, 1/194, 1/194, 3/194, 1/194,
1/194, 1/97, 1/194, 1/194, 1/97, 3/194, 1/194, 1/194, 5/194,
3/97, 3/194, 2/97, 1/194, 1/97, 1/97, 3/194, 3/194, 3/194, 1/97,
1/97, 1/97, 1/194, 1/194, 1/194, 1/97, 3/194, 1/97, 2/97, 3/194,
1/194, 5/194, 1/97, 2/97, 1/97, 1/97, 1/97, 3/194, 2/97, 1/97,
1/97, 4/97, 1/97, 1/194, 2/97, 1/97, 1/97, 3/194, 3/194, 2/97,
1/97, 1/194, 3/194, 2/97, 1/97, 1/97, 3/194, 1/194, 5/194, 1/97,
3/194, 1/194, 1/194, 1/194, 2/97, 1/194, 1/97, 1/97, 3/194, 1/97,
1/97, 1/97, 3/194, 7/194, 1/97, 3/194, 3/194, 1/194, 1/194, 2/97,
1/97, 1/194, 1/97, 1/194, 2/97, 1/97, 3/194, 3/194, 11/194, 5/194,
1/194, 3/194, 3/97, 1/194, 1/194, 2/97, 1/194, 3/194, 1/97,
3/194, 1/97, 1/194, 2/97, 1/194, 3/194, 1/97, 1/97, 1/194, 1/194,
1/194, 1/97, 3/194, 3/194, 1/194, 1/97, 1/97, 1/97, 3/194, 3/194,
1/97, 1/194, 3/194, 1/194, 3/194, 1/97, 1/194, 1/194, 1/97, 1/194,
3/194, 1/194, 1/194, 1/97, 1/97, 1/194, 1/97, 3/194, 2/97, 1/97,
3/194, 1/194, 1/97, 2/97, 1/194, 3/194, 1/97, 2/97, 5/194, 1/194,
1/97, 1/97, 1/97, 1/194, 1/194, 3/194, 2/97, 1/97, 1/194, 1/97,
1/194, 1/194, 2/97, 2/97, 1/194, 1/194, 5/194}};
Masques = {"Matrice", "Résine", "Revetement"};
h = 1/194;
Then, build 2 lists, with an empty member:
artificial1 = {First@Data, Last@Data, {}};
artificial2 = {First@Data, {}, Last@Data};
and plot these histograms:
Histogram[Data, {h}, "Probability",
ChartLegends -> Placed[Masques, Above] ,
ChartStyle -> {Red, Green, Blue, Yellow}, ChartLayout -> "Stacked",
ImageSize -> Medium]
Histogram[artificial1, {h}, "Probability",
ChartLegends -> Placed[Masques, Above] ,
ChartStyle -> {Red, Green, Blue, Yellow}, ChartLayout -> "Stacked",
ImageSize -> Medium]
As it was requested, they are stacked. But the third one, with an intermediate empty list, is not stacked!
Histogram[artificial2, {h}, "Probability",
ChartLegends -> Placed[Masques, Above] ,
ChartStyle -> {Red, Green, Blue, Yellow}, ChartLayout -> "Stacked",
ImageSize -> Medium]
Is it a bug, or did I made a mistake somewhere?
Best regards, Claude