[英]How to set the matplotlib axes tick labels fontweight to bold?
I was trying the following code:我正在尝试以下代码:
fig, ax1 = plt.subplots()
#data is a geopandas DataFrame
data.plot(ax=ax1, kind='bar', color= barcolor, width= 0.8)
ax1.set_yticklabels(ax1.get_yticklabels(), weight='bold')
ax1.set_xticklabels(ax1.get_xticklabels(), rotation=0, weight='bold', size=12)
Only x-axis gets affected by this code and y-axis labels are getting removed.只有 x 轴会受到此代码的影响,并且 y 轴标签会被移除。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.