Hi all. I’m trying to create a heatmap but want to assign different color scales for each category. I thought building with Plotly Graph Objects would be the best bet. However, I’m running into a strange problem where it creates a third x-dimension category in my heatmap:
Does anyone have any insight on how to fix this? My code is below:
test = go.Figure(
data=go.Heatmap(
z = [[3], [5], [3], [8]],
y = ['topic a', 'topic b', 'topic c', 'topic d'],
x = ['Republican Support'],
colorscale = 'reds',
showscale = False,
))
test.add_trace(go.Heatmap(
z = [[2], [7], [9], [3]],
y = ['topic a', 'topic b', 'topic c', 'topic d'],
x = ['Democrat Support'],
colorscale = 'blues',
showscale = False,
))
test.show()