Functions, Descriptions, Syntax, Examples for Easy Learning
Plotly Express
FUNCTION | DESCRIPTION | SYNTAX | EXAMPLE |
---|---|---|---|
scatter | Create a scatter plot | px.scatter(dataframe, x=x_column, y=y_column) | px.scatter(df, x=age_array, y=income_array) |
line | Create a line plot | px.line(x=x_column, y=y_column,'title') | px.line(x=months_array, y=no_bicycle_sold_array) |
Plotly Graph Objects
FUNCTION | DESCRIPTION | SYNTAX | EXAMPLE |
---|---|---|---|
Scatter | Create a scatter | go.Scatter(x=x, y=y, mode='markers') | go.Scatter(x=age_array, y=income_array, mode='markers') |
Dash Components
FUNCTION | DESCRIPTION | SYNTAX | EXAMPLE |
---|---|---|---|
Input | Create an input component | dcc.Input(value='', type='text') | dcc.Input(value='Hello', type='text') |
Graph | Create a graph component | dcc.Graph(figure=fig) | dcc.Graph(figure=fig) |
More Dash Components!
FUNCTION | DESCRIPTION | SYNTAX | EXAMPLE |
---|---|---|---|
Div | Create a div element | html.Div(children=component_list) | html.Div(children=[html.H1('Hello Dash'), html.P('Welcome to Dash')]) |
Dropdown | Create a dropdown component | dcc.Dropdown(options=options_list, value=default_value) | dcc.Dropdown(options=[{'label': 'Option 1', 'value': '1'}, {'label': 'Option 2', 'value': '2'}], value='1') |
Get ready to create stunning plots and dashboards like a pro!