mardi 3 mai 2022

Cannot create Distplot with Python Dash

Upon running the following command:

fig = ff.create_distplot(hist_data, group_labels, show_hist=False, colors=colors

I receive the following error:

cannot import name 'ColorscaleValidator' from 'plotly.validators.heatmap'

I've tried downgrading my plotly version, but that didn't help either.

Thanks!

Full code (taken from Stackoverflow):

import plotly.figure_factory as ff

import numpy as np

x1 = np.random.randn(200) - 1

x2 = np.random.randn(200)

x3 = np.random.randn(200) + 1

hist_data = [x1, x2, x3]

group_labels = ['Group 1', 'Group 2', 'Group 3']

colors = ['#333F44', '#37AA9C', '#94F3E4']


fig = ff.create_distplot(hist_data, group_labels, show_hist=False, colors=colors)

fig.update_layout(title_text='Curve and Rug Plot')

fig.update_traces(line={'dash': 'dash'})

fig.show()



Aucun commentaire:

Enregistrer un commentaire