Plotting bar charts vertically and horizontally
The default display of bar charts is vertical. This is intuitive and easy to understand. Each category or item takes a separate position on the x axis, and the heights of the bars represent a certain quantity on the y axis. The same applies when the bars are displayed horizontally, only in this case, the width of the bars is what represents the quantity. Usually, with relatively fewer values, the vertical orientation is good. However, horizontal orientation can be more effective in two cases:
- When we have many categories: In this case, the bars might not fit on the screen, and we might need to either make them much thinner than the default width, or we might need to force horizontal scrolling, which is not as natural as vertical scrolling.
- When the names of the categories are relatively long: This is not really a big problem, and the solution is easy. Plotly already handles this for us, by automatically changing the angle...