def get_figure(self, **kwargs):
emin = kwargs.pop('<STR_LIT>', -<NUM_LIT:1.0>)<EOL>emax = kwargs.pop('<STR_LIT>', <NUM_LIT:1.0>)<EOL>width = kwargs.pop('<STR_LIT:width>', <NUM_LIT>)<EOL>height = kwargs.pop('<STR_LIT>', <NUM_LIT>)<EOL>margin_left = kwargs.pop('<STR_LIT>', <NUM_LIT:100>)<EOL>margin_bottom = kwargs.pop('<STR_LIT>', <NUM_LIT>)<EOL>margin_top = kwargs.pop('<STR_LIT>', <NUM_LIT:30>)<EOL>margin_right = kwargs.pop('<STR_LIT>', <NUM_LIT:0>)<EOL>colorbar_size = kwargs.pop('<STR_LIT>', <NUM_LIT>)<EOL>xaxis_label = kwargs.pop('<STR_LIT>', None)<EOL>yaxis_label = kwargs.pop('<STR_LIT>', None)<EOL>xticks_angle = kwargs.pop('<STR_LIT>', <NUM_LIT:30>)<EOL>font = kwargs.pop('<STR_LIT>', '<STR_LIT>')<EOL>font_size = kwargs.pop('<STR_LIT>', <NUM_LIT:12>)<EOL>title = kwargs.pop('<STR_LIT:title>', None)<EOL>title_font_size = kwargs.pop('<STR_LIT>', None)<EOL>annotation_font_size = kwargs.pop('<STR_LIT>', None)<EOL>show_sample_labels = kwargs.pop('<STR_LIT>', '<STR_LIT:x>')<EOL>if show_sample_labels not in ['<STR_LIT:none>', '<STR_LIT:x>', '<STR_LIT:y>', '<STR_LIT>']:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>padding_top = kwargs.pop('<STR_LIT>', <NUM_LIT:0.1>)<EOL>padding_right = kwargs.pop('<STR_LIT>', <NUM_LIT:0.1>)<EOL>xaxis_nticks = kwargs.pop('<STR_LIT>', None)<EOL>if title_font_size is None:<EOL><INDENT>title_font_size = font_size<EOL><DEDENT>if annotation_font_size is None:<EOL><INDENT>annotation_font_size = font_size<EOL><DEDENT>colorbar_label = self.colorbar_label or '<STR_LIT>'<EOL>colorbar = go.ColorBar(<EOL>lenmode='<STR_LIT>',<EOL>len=colorbar_size,<EOL>title=colorbar_label,<EOL>titlefont = dict(<EOL>size=title_font_size,<EOL>),<EOL>titleside='<STR_LIT:right>',<EOL>xpad=<NUM_LIT:0>,<EOL>ypad=<NUM_LIT:0>,<EOL>outlinewidth=<NUM_LIT:0>,  <EOL>thickness=<NUM_LIT:20>,  <EOL>)<EOL>def fix_plotly_label_bug(labels):<EOL><INDENT>"""<STR_LIT>"""<EOL>assert isinstance(labels, Iterable)<EOL>fixed_labels = []<EOL>for l in labels:<EOL><INDENT>try:<EOL><INDENT>float(l)<EOL><DEDENT>except ValueError:<EOL><INDENT>fixed_labels.append(str(l))<EOL><DEDENT>else:<EOL><INDENT>fixed_labels.append(str(l) + '<STR_LIT:_>')<EOL><DEDENT><DEDENT>return fixed_labels<EOL><DEDENT>x = fix_plotly_label_bug(self.corr_matrix.samples)<EOL>y = x<EOL>data = [<EOL>go.Heatmap(<EOL>z=self.corr_matrix.X,<EOL>x=x,<EOL>y=y,<EOL>zmin=emin,<EOL>zmax=emax,<EOL>colorscale=self.colorscale,<EOL>colorbar=colorbar,<EOL>hoverinfo='<STR_LIT>',<EOL>**kwargs<EOL>),<EOL>]<EOL>xshowticklabels = False<EOL>yshowticklabels = False<EOL>if show_sample_labels == '<STR_LIT:x>':<EOL><INDENT>xshowticklabels = True<EOL><DEDENT>elif show_sample_labels == '<STR_LIT:y>':<EOL><INDENT>yshowticklabels = True<EOL><DEDENT>elif show_sample_labels == '<STR_LIT>':<EOL><INDENT>xshowticklabels = True<EOL>yshowticklabels = True<EOL><DEDENT>xticks = '<STR_LIT>'<EOL>yticks = '<STR_LIT>'<EOL>if xaxis_label is None:<EOL><INDENT>if self.corr_matrix.samples.name is not None:<EOL><INDENT>xaxis_label = self.corr_matrix.samples.name<EOL><DEDENT>else:<EOL><INDENT>xaxis_label = '<STR_LIT>'<EOL><DEDENT>xaxis_label = xaxis_label + '<STR_LIT>' % self.corr_matrix.n<EOL><DEDENT>if yaxis_label is None:<EOL><INDENT>yaxis_label = xaxis_label<EOL><DEDENT>layout = go.Layout(<EOL>width=width,<EOL>height=height,<EOL>title=title,<EOL>titlefont=go.Font(<EOL>size=title_font_size<EOL>),<EOL>font=go.Font(<EOL>size=font_size,<EOL>family=font<EOL>),<EOL>xaxis=go.XAxis(<EOL>title=xaxis_label,<EOL>titlefont=dict(size=title_font_size),<EOL>showticklabels=xshowticklabels,<EOL>ticks=xticks,<EOL>nticks=xaxis_nticks,<EOL>tickangle=xticks_angle,<EOL>showline=True,<EOL>zeroline=False,<EOL>showgrid=False,<EOL>),<EOL>yaxis=go.YAxis(<EOL>title=yaxis_label,<EOL>titlefont=dict(size=title_font_size),<EOL>showticklabels=yshowticklabels,<EOL>ticks=xticks,<EOL>nticks=xaxis_nticks,<EOL>autorange='<STR_LIT>',<EOL>showline=True,<EOL>zeroline=False,<EOL>showgrid=False,<EOL>),<EOL>margin=go.Margin(<EOL>l=margin_left,<EOL>t=margin_top,<EOL>b=margin_bottom,<EOL>r=margin_right,<EOL>pad=<NUM_LIT:0><EOL>),<EOL>)<EOL>layout['<STR_LIT>'] = go.XAxis(<EOL>overlaying='<STR_LIT:x>',<EOL>showline=False,<EOL>tickfont=dict(size=<NUM_LIT:0>),<EOL>autorange=False,<EOL>range=[-<NUM_LIT:0.5>, self.corr_matrix.n-<NUM_LIT:0.5>],<EOL>ticks='<STR_LIT>',<EOL>showticklabels=False,<EOL>zeroline=False,<EOL>showgrid=False,<EOL>)<EOL>layout['<STR_LIT>'] = go.YAxis(<EOL>overlaying='<STR_LIT:y>',<EOL>showline=False,<EOL>tickfont=dict(size=<NUM_LIT:0>),<EOL>autorange=False,<EOL>range=[self.corr_matrix.n-<NUM_LIT:0.5>, -<NUM_LIT:0.5>],<EOL>ticks='<STR_LIT>',<EOL>showticklabels=False,<EOL>zeroline=False,<EOL>showgrid=False,<EOL>)<EOL>k = len(self.block_annotations)<EOL>block_coords = np.zeros((k, <NUM_LIT:2>), dtype=np.float64)<EOL>block_labels = []<EOL>for i, ann in enumerate(self.block_annotations):<EOL><INDENT>block_coords[i, :] = [ann.start_index-<NUM_LIT:0.5>, ann.end_index+<NUM_LIT:0.5>]<EOL>block_labels.append(ann.label)<EOL><DEDENT>for i in range(k):<EOL><INDENT>mn = block_coords[i, <NUM_LIT:0>]<EOL>mx = block_coords[i, <NUM_LIT:1>]<EOL>data.append(<EOL>go.Scatter(<EOL>x=[mn, mx, mx, mn, mn],<EOL>y=[mn, mn, mx, mx, mn],<EOL>mode='<STR_LIT>',<EOL>hoverinfo='<STR_LIT:none>',<EOL>showlegend=False,<EOL>line=dict(color='<STR_LIT>'),<EOL>xaxis='<STR_LIT>',<EOL>yaxis='<STR_LIT>',<EOL>)<EOL>)<EOL><DEDENT>for i in range(k):<EOL><INDENT>mn = block_coords[i, <NUM_LIT:0>]<EOL>mx = block_coords[i, <NUM_LIT:1>]<EOL>layout.annotations.append(<EOL>dict(<EOL>x=mx,<EOL>y=(mn+mx)/<NUM_LIT>,<EOL>text=block_labels[i],<EOL>xref='<STR_LIT>',<EOL>yref='<STR_LIT>',<EOL>showarrow=False,<EOL>xanchor='<STR_LIT:left>',<EOL>yanchor='<STR_LIT>',<EOL>font=dict(<EOL>color='<STR_LIT>',<EOL>size=annotation_font_size,<EOL>family='<STR_LIT>',<EOL>),<EOL>bgcolor='<STR_LIT>',<EOL>opacity=<NUM_LIT>,<EOL>)<EOL>)<EOL><DEDENT>fig = go.Figure(<EOL>data=data,<EOL>layout=layout<EOL>)<EOL>return fig<EOL>
Get a plotly figure of the heatmap.