Ax.text() causing ax.plot() to shift to one side

The Aim

To place ax.text() over the chart as shown in the Storytelling Data Visualization and Information Design course.

The Problem

If I copy and paste the code from the exercises, it works perfectly in my Jupyter Lab.

If I use the code below, I get the effect below…

What I have tried

I tried transform=transAxes as a kwarg for ax.text() but that just kicked the problem down the road and when I used ax.axvline() the same problem occurred. Plus, I should not have to much about with transforms.

I have tried different ways of slicing the data, with and without ‘time’ as the index column. It makes no difference.

Thanks in advance - this driving me nuts.

johnson_slice = euro_to_pound.set_index('time')['2019-06-15':]
johnson_slice.reset_index(inplace=True)

may_slice = euro_to_pound.set_index('time')['2016-06-15':'2019-06-15']
may_slice.reset_index(inplace=True)

cameron_slice = euro_to_pound.set_index('time')['2010-06-15':'2016-06-15']
cameron_slice.reset_index(inplace=True)

brown_slice = euro_to_pound.set_index('time')['2007-06-15':'2010-06-15']
brown_slice.reset_index(inplace=True)

blair_slice = euro_to_pound.set_index('time')[:'2007-06-15']
blair_slice.reset_index(inplace=True)
#Style
style.use('default')
style.use('ggplot')

fig,(ax1,ax2,ax3,ax4,ax5) = plt.subplots(ncols=1, nrows=5, figsize=(4,5))

# Useful lists
axes = [ax1,ax2,ax3,ax4,ax5]
sides = ['left','bottom','right','top']
p_ministers = ['Johnson','May','Cameron','Brown','Blair']

y_pos = 0

# Loop to set the attributes
for ax, pm in zip(axes,p_ministers):
    ax.grid(b=False)
    ax.plot(euro_to_pound['time'], euro_to_pound['uk_pound'], alpha=0.3, color='grey')
    y_pos += 0.5
    
    ax1.text(0.05,y_pos, s=pm, color='black', weight='bold')
    
    ax.set(facecolor='white')
    ax.set_yticklabels([])
    ax.set_xticklabels([])
    ax.tick_params(bottom=0, left=0) 
    for side in sides:
        ax.spines[side].set_visible(False)

# Create Sections
ax1.plot(blair_slice['time'], blair_slice['uk_pound'], alpha=1,color='#DC241f')
ax2.plot(brown_slice['time'],brown_slice['uk_pound'], alpha=1,color='#DC241f')
ax3.plot(cameron_slice['time'],cameron_slice['uk_pound'], alpha=1,color='#0087DC')
ax4.plot(may_slice['time'],may_slice['uk_pound'], alpha=1,color='#0087DC')
ax5.plot(johnson_slice['time'],johnson_slice['uk_pound'], alpha=1,color='#0087DC')

plt.show()