Answers for "go.scatter"

3

scatter plot plotly

import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species",
                 size='petal_length', hover_data=['petal_width'])
fig.show()
Posted by: Guest on May-11-2020
3

go.scatter

import plotly.graph_objects as go

fig = go.Figure()

# Add traces
fig.add_trace(go.Scatter(x=df['col_x'], y=df['col_y'],
                    mode='markers',
                    name='markers'))
fig.add_trace(go.Scatter(x=df2['col_x'], y=df2['col_y'],
                    mode='lines+markers',
                    name='lines+markers'))

fig.show()
Posted by: Guest on April-28-2020

Browse Popular Code Answers by Language