We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating an annotated heatmap with figure factory using a custom color scale (as seen below) leads to a ValueError: "map object not subscriptable."
import plotly.figure_factory as ff data_test2 = ff.create_annotated_heatmap(z=z, x=x, y=y, colorscale=[[0.0, 'rgb(250,0,0)'], [0.5, 'rgb(250,250,250)'], [1.0, 'rgb(0,0,0)']], annotation_text=df_str, showscale=True)
import plotly.figure_factory as ff
data_test2 = ff.create_annotated_heatmap(z=z, x=x, y=y, colorscale=[[0.0, 'rgb(250,0,0)'], [0.5, 'rgb(250,250,250)'], [1.0, 'rgb(0,0,0)']], annotation_text=df_str, showscale=True)
I fixed this by explicitly defining the map objects for min_col and max_col in _AnnotatedHeatMap.get_text_color() as lists.
min_col
max_col
_AnnotatedHeatMap.get_text_color()
The text was updated successfully, but these errors were encountered:
Thanks for the report @andy-lz . Could you add a quick example that results in this error?
Basically, just include some simple definitions of x, y, z, etc. so that someone can copy and paste it into a notebook cell and see the error.
x
y
z
Thanks!
Sorry, something went wrong.
Used a modified example from plotly documentation.
import plotly.plotly as py import plotly.figure_factory as ff z = [[.1, .3, .5], [1.0, .8, .6], [.6, .4, .2]] x = ['Team A', 'Team B', 'Team C'] y = ['Game Three', 'Game Two', 'Game One'] z_text = [['Win', 'Lose', 'Win'], ['Lose', 'Lose', 'Win'], ['Win', 'Win', 'Lose']] fig = ff.create_annotated_heatmap(z, x=x, y=y, annotation_text=z_text, colorscale=[[0.0, 'rgb(250,0,0)'], [0.5, 'rgb(250,250,250)'], [1.0, 'rgb(0,0,0)']])
Done in #1151
No branches or pull requests
Creating an annotated heatmap with figure factory using a custom color scale (as seen below) leads to a ValueError: "map object not subscriptable."
import plotly.figure_factory as ff
data_test2 = ff.create_annotated_heatmap(z=z, x=x, y=y, colorscale=[[0.0, 'rgb(250,0,0)'], [0.5, 'rgb(250,250,250)'], [1.0, 'rgb(0,0,0)']], annotation_text=df_str, showscale=True)
I fixed this by explicitly defining the map objects for
min_col
andmax_col
in_AnnotatedHeatMap.get_text_color()
as lists.The text was updated successfully, but these errors were encountered: