I have this bar chart, obtained in Seaborn, using barplot
:
I have the bar chart for the same dataset, obtained by Matplotlib's bar
:
Is there a way, a switch, etc. to get the bars in Matplotlib's picture closer, like they are in the Seaborn version?
CodePudding user response:
Convert your x data to strings, since bar
can handle categorical data. Some sample code:
plt.bar(['1', '2', '97', '99'], [1, 2, 3, 4])
Output: