ohidano
0
Q:

scatter plot plotly

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()
2
df.plot('x_axis', 'y_axis', kind='scatter')
2
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()
1
# You can use matplotlib to create a scatter plot

# Import matplotlib.pyplot
import matplotlib.pyplot as plt

# Define x and y coordinates
x = [5,7,8,7,2,17,2,9,4,11,12,9,6]
y = [99,86,87,88,111,86,103,87,94,78,77,85,86]

# Create the scatter plot and show it
plt.scatter(x, y)
plt.show()
2

New to Communities?

Join the community