@empet Hi again, I have another problem! I am trying to auto scale my y-axis but its failing to do so. How can I achieve it?
plotData=[dict(type=âscatterâ,
x=list(range(24)),
y=test_data[:0],
mode=âmarkersâ,
marker=dict(size=10, color=âredâ))
]
frames=[dict(data=[dict(y=test_data[:,k])],
traces=[0],
name=fâ{k+1}â) for k in range(31)]
sliders=[dict(steps= [dict(method= âanimateâ,
args= [[ fâ{k+1}â],
dict(mode= âeâ,
frame= dict( duration=1000, redraw= False ),
transition=dict( duration= 0)
)
],
label=fâday {k+1}â
) for k in range(31)],
transition= dict(duration= 30 ),
x=0,#slider starting position
y=0,
currentvalue=dict(font=dict(size=12),
prefix='Day: ',
visible=True,
xanchor= âcenterâ
),
len=1.0,
active=1) #slider length)
]
axis_style=dict(showline=True,
mirror=True,
zeroline=False,
ticklen=4)
layout=dict(title=âMayıs-GĂŒnlĂŒk Kullanıcı Sayılarıâ,
width=900,
height=600,
autosize=False,
xaxis=dict(axis_style, title=âZaman (saat)â, **dict(range=[0,24])),
yaxis=dict(axis_style, title=âKullanıcı Sayısıâ,auto=True),
hovermode=âclosestâ,
updatemenus=[dict(type=âbuttonsâ, showactive=True,
y=0,
x=1.15,
xanchor=ârightâ,
yanchor=âtopâ,
pad=dict(t=0, r=10),
buttons=[dict(label=âPlayâ,
method=âanimateâ,
args=[None,
dict(frame=dict(duration=2000,
redraw=True),
transition=dict(duration=2000),
fromcurrent=True,
mode=âimmediateâ
)
]
),
dict(label=âPauseâ,
method=âanimateâ,
args=[[None],
dict(frame=dict(duration=0,
redraw=False),
transition=dict(duration=30),
fromcurrent=True,
mode=âimmediateâ
)
]
)
]
)
],
sliders=sliders
)
Animated Plot
figure = {
âdataâ: plotData,
âlayoutâ: layout,
âframesâ: frames
}
fig=dict(data=plotData, frames=frames, layout=layout)
fig[âdataâ][0].update(mode=âmarkers+linesâ,
line=dict(width=1.5, color=âblueâ))
plot(fig, auto_open=False)