I need some help with creating this graph using matplotlib.
This is where the event id and the count are being extracted from:

I need to create a graph. For this I have attempted some code for this but I keep getting errors as there are lists to extract and I am honestly quite confused and this is the code I have done so far:
def plotnew():
event = []
eventcount = []
with open("path here", 'r') as visualise:
for line in visualise:
if line.startswith("Event ID: "):
event.append(line.split([2]))
elif line.startswith("Count:"):
eventcount.append(int(line.split()[2]))
plt.barh(event, eventcount)
plt.xlabel('Event Count')
plt.ylabel('Event ID')
plt.title('EventID Count')
plt.tight_layout()
plt.show()
I have tried to add [3] after the line split to get the count value or event id but I keep getting errors all over the place and I am quite confused.

eveandeventcountreturn after your for loop has completed?