tsne
date: 2020-08-28 excerpt: tsne
tag:
tsne
plotlyで描画するときなど
plotly
import plotly.offline as py
py.init_notebook_mode(connected=True)
import plotly.graph_objs as go
import plotly.tools as tls
trace0 = go.Scatter(
x = rec["0"],
y = rec["1"],
mode = 'markers',
text = rec["r_str"] + "|" + rec["something_value"].rank(method="dense").apply(str) + "|" + rec["r_sum"],
showlegend = False,
marker = dict(
size = 8,
color = rec["something_value"].rank(method="dense"),
colorscale ='Jet',
showscale = False,
line = dict(
width = 2,
color = 'rgb(255, 255, 255)'
),
opacity = 0.8
)
)
data = [trace0]
layout = dict(title = 'tnse',
# hovermode= 'x unified',
yaxis = dict(zeroline = False),
xaxis = dict(zeroline = False),
showlegend= True
)
fig = dict(data=data, layout=layout)
py.iplot(fig, filename='styled-scatter')