What causes the x-axis to have Year numbers in between the bars and the 0.5 attached to the Population Year
ru = px.bar(wakel, x = "Population Year", y = "Population", color = "City")
ru.show()
What causes the x-axis to have Year numbers in between the bars and the 0.5 attached to the Population Year
ru = px.bar(wakel, x = "Population Year", y = "Population", color = "City")
ru.show()
Copyright © 2021 Jogjafile Inc.
To avoid this behaviour (and rather than having to modify your data beforehand) you can tell plotly to treat the x axis values as 'categorical' by updating the layout for the x axes.