Plotly autoscale/update issue

I am building a dashboard / measurement application using plotly for line scatter plots. When there is no acutal measurement running, I use a timer while loop to display some information. The problem is, that on each update of the streamlit page caused by the while loop, the plotly plot is also refreshed and in particular zooming done by the user is reseted. There is an autorange setting inside plotly but that does not help either. The code fragment below demonstrates the issue. I know this is probably more of a plotly question than an streamlit issue but maybe someone has had that problem before.

import streamlit as st
import numpy as np
import as px
import time

st.write('try to zoom into the data! The range is always reset when the page refreshes')
btn = st.button('restart')
info = st.empty()
ascale =st.checkbox('autoscale',value=True)

pts = 50
fig1 = px.line(x=np.arange(pts),y=np.random.random(pts))
if ascale :
    fig1.update_layout(xaxis_autorange = True,yaxis_autorange = True)    
else :
    fig1.update_layout(xaxis_autorange = False,yaxis_autorange = False)      

t0 = time.time()
while True: # some timer loop to display things while not running big jobs
    if btn:
        st.experimental_rerun()"{time.time() - t0:.3}")