Вместо выделения маркера вокруг него появляется квадрат.
Моя попытка кода:
Код: Выделить всё
from sklearn.datasets import make_blobs
import pandas as pd
import plotly.express as px
X, y = make_blobs(n_samples=30, centers=3, n_features=2,
random_state=0)
ff = PCA(n_components= 2)
clusters = pd.DataFrame(data = ff.fit_transform(X), columns = ['PC1', 'PC2'])
clusters['target'] = y
id = [0, 4, 7]
updatemenus = [dict(buttons=list(dict(label = idd ,method = 'relayout', args = ['shapes', [dict(markers = dict(color = 'Red', size = 120), type = "markers", xref = 'x', yref = 'y', x0 = clusters.loc[idd, 'PC1'], y0=clusters.loc[idd, 'PC2'])]]) for idd in id))]
fig = px.scatter(clusters, x = 'PC1', y = 'PC2', color = 'target', hover_data = ['target'])
fig.update_layout(updatemenus = updatemenus)
fig.show()

Что такое Я делаю неправильно
Подробнее здесь: https://stackoverflow.com/questions/790 ... opbown-bar