I'm plotting, but find that I need to increase the area underneath chart such that I can plot the labels vertically but in a font size that is not so tiny. At the moment, I have:
plt.figure(count_fig) fig, ax = plt.subplots() rects1 = ax.bar(ind, ratio_lst, width, color='r', linewidth=1, alpha=0.8, log=1) ax.set_ylabel('') ax.set_title('') ax.set_xticks(ind_width) ax.set_xticklabels(labels_lst, rotation='vertical', fontsize=6)
At the moment it works, but the labels often run-off the edge of the plot.
To adjust the spacing between the edge of the plot and the X-axis, we can use tight_layout() method or set the bottom padding of the current figure. Set the figure size and adjust the padding between and around the subplots.
If we want to change the font size of the axis labels, we can use the parameter “fontsize” and set it your desired number.
The space between bars can be added by using rwidth parameter inside the “plt. hist()” function. This value specifies the width of the bar with respect to its default width and the value of rwidth cannot be greater than 1.
subplots_adjust
will do it. You can play with the bottom
keyword to get a good placement of the bottom of the plot.
fig.subplots_adjust(bottom=0.2)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With