Skip to content

Heatmap should look up category position when building brick data #1117

Closed
@colinfang

Description

@colinfang

The 2nd plot should start at Team B, instead of Team A.

fig = make_subplots(rows=2, cols=1, shared_yaxes=True, shared_xaxes=True)

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']

fig.append_trace(go.Heatmap(z=z, x=x, y=y), 1, 1)

z = [[.3, .5],  
     [.8, .6],
     [.4, .2]]

x = ['Team B', 'Team C']
y = ['Game Three', 'Game Two', 'Game One']

fig.append_trace(go.Heatmap(z=z, x=x, y=y), 2, 1)
iplot(fig)
fig.data

[{'type': 'heatmap',
  'x': ['Team A', 'Team B', 'Team C'],
  'xaxis': 'x1',
  'y': ['Game Three', 'Game Two', 'Game One'],
  'z': [[.1, .3, .5],  
     [1.0, .8, .6],
     [.6, .4, .2]],
  'yaxis': 'y1'},
 {'type': 'heatmap',
  'x': ['Team B', 'Team C'],
  'xaxis': 'x1',
  'y': ['Game Three', 'Game Two', 'Game One'],
  'z': [[.3, .5],  
     [.8, .6],
     [.4, .2]],
  'yaxis': 'y2'}]

fig.layout

{'xaxis1': {'anchor': 'y2', 'domain': [0.0, 1.0]},
 'yaxis1': {'anchor': 'free', 'domain': [0.575, 1.0], 'position': 0.0},
 'yaxis2': {'anchor': 'x1', 'domain': [0.0, 0.425]}}

newplot 6

https://codepen.io/anon/pen/qqdqWq

Metadata

Metadata

Assignees

Labels

bugsomething broken

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions