Bar Chart: Adding labels push data to the left.
- Dominant language
- Python
- Stars
- 2.8k
- Forks
- 419
- PR merge metrics
- No merged PRs in 30d
Description
Hi. When I plot a bar chart without applying object.x_labels, my bars plot across the screen and everything seems ok:

When I try to plot with object.x_labels defined, however, the bars push to the left of the graph and the labels go across the bottom of the screen:

This is the code I am using to create labels (histogram is my bar chart object):
histogram.x_labels = map(str,xaxislabels)
histogram.x_label_rotation=270
xaxislabels is a list that is equal in size to the number of bars I am plotting.
I have tried this using this as well:
histogram.xlabels = map(str,range(len(xaxislabels)))
histogram.x_label_rotation=270
Just for reference, I am using Google Chrome on Mac OSX 10.8.5 to view the SVG files. I will update this issue when I get a chance to view it with other browsers. Thanks.
Contributor guide
Research direction
Reproduce the bar chart using histogram.x_labels, x_label_rotation=270, and labels matching the number of bars, then inspect the generated SVG in Chrome on macOS. Compare it with the chart without x_labels and verify that labels render along the bottom without shifting the bars to the left.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100