Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created February 8, 2021 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/e3fa1b21a20b4a00ce6086bdcecdc637 to your computer and use it in GitHub Desktop.
Save amankharwal/e3fa1b21a20b4a00ce6086bdcecdc637 to your computer and use it in GitHub Desktop.
PLOT = go.Figure()
for C in list(data.Cluster.unique()):
PLOT.add_trace(go.Scatter3d(x = data[data.Cluster == C]['Income'],
y = data[data.Cluster == C]['Seniority'],
z = data[data.Cluster == C]['Spending'],
mode = 'markers',marker_size = 6, marker_line_width = 1,
name = str(C)))
PLOT.update_traces(hovertemplate='Income: %{x} <br>Seniority: %{y} <br>Spending: %{z}')
PLOT.update_layout(width = 800, height = 800, autosize = True, showlegend = True,
scene = dict(xaxis=dict(title = 'Income', titlefont_color = 'black'),
yaxis=dict(title = 'Seniority', titlefont_color = 'black'),
zaxis=dict(title = 'Spending', titlefont_color = 'black')),
font = dict(family = "Gilroy", color = 'black', size = 12))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment