is there any way to solve the annotation of overlap, or increase the size of chart, or the range of X-axis
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
label_list=['PointNet',
'PointNet++',
'EdgeConv',
'PointCNN',
'Convpoint',
'LightConvPoint',
'SplineCNN',
'RSConv']
y1 = [90,
90,
85,
90,
95,
95,
87.5,
75
]
y2= [89.2,
90.7,
91.7,
92.2,
92.5,
92.5,
92.65,
93.6]
x = np.arange(len(label_list)) # the label locations
width = 0.4 # the width of the bars
fig, ax = plt.subplots()
rects1 = ax.bar(x - width/2, y1, width, label='Church')
rects2 = ax.bar(x + width/2, y2, width, label='Modelnet40')
# Add some text for labels, title and custom x-axis tick labels, etc.
ax.set_ylim(70,100)
ax.set_ylabel('Best achieved Test accuracy%')
ax.set_title('performance comparison modelnet40 and Churchdata')
ax.set_xticks(x)
ax.set_xticklabels(label_list,rotation='vertical')
ax.legend(loc='lower left')
def autolabel(rects):
"""Attach a text label above each bar in *rects*, displaying its height."""
for rect in rects:
height = rect.get_height()
ax.annotate('{}'.format(height),
xy=(rect.get_x() + rect.get_width() / 2, height),
xytext=(0, 3), # 3 points vertical offset
textcoords="offset points",
ha='center', va='bottom')
autolabel(rects1)
autolabel(rects2)
plt.show()