Plotly output not displaying correctly

I am trying to display a plotly figure, and streamlit.plotly_chart is not displaying it correctly. When I include at the end of my script, it appears correctly in a new window, so I know it is not a problem with the figure itself. Attached are images of how it appears from vs from st.plotly_chart(fig)


The figure is simple a bar chart with a horizontal line added:

Any help is much appreciated