Mathematica Asked by Jonathan Shock on February 5, 2021
I have two lists, which are pretty similar. They are given by:
list1=Flatten[Table[#[[1]], #[[2]]] & /@ {{1, 2},{2, 9},{3, 3},{4,73},{5, 38}}]
list2=Flatten[Table[#[[1]], #[[2]]] & /@ {{1, 2},{2, 10},{3, 8},{4,65},{5, 22}}]
ie. list1 is a list of 2 1’s, 9 2’s, 3 3’s, etc.
If I plot a histogram of them next to each other they come out like this:
{Histogram[list1],Histogram[list2]}
And I can’t figure out why the labelling is different. I would like to have all of my numbers in the centre of the column, so tried using the answer from this question. as so:
{Histogram[list1,
Ticks -> {{# + .5, #} & /@ HistogramList[list1][[1]], Automatic}],
Histogram[list2,
Ticks -> {{# + .5, #} & /@ HistogramList[list2][[1]], Automatic}]}
But that comes out like this:
Any idea what’s going on?
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP