Skip to content
Related Articles

Related Articles

Improve Article

How to make sliders in Plotly?

  • Last Updated : 01 Oct, 2020

A Plotly is a Python library that is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot, and many more. It is mainly used in data analysis as well as financial analysis. plotly is an interactive visualization library. 

Simple Slider Control

In plotly, a slider is a Tkinter object with which a user can set the values by moving an indicator. A slider can be vertically and horizontally arranged. In plotly, the slider can be formed by using the Scale method(). 

Example 1:


import plotly.graph_objects as px
import as go
import numpy as np
df =
x = df['total_bill']
y = df['day']
plot = px.Figure(data=[px.Scatter(


Example 2:


import as px
df =
fig = px.scatter(df, x="total_bill", y="tip"



 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up
Recommended Articles
Page :