def get_figure(<EOL>self, emin=None, emax=None,<EOL>width=<NUM_LIT>, height=<NUM_LIT>,<EOL>margin_left=<NUM_LIT:100>, margin_bottom=<NUM_LIT>, margin_top=<NUM_LIT:30>, margin_right=<NUM_LIT:0>,<EOL>colorbar_size=<NUM_LIT>,<EOL>xaxis_label=None, yaxis_label=None,<EOL>xaxis_nticks=None, yaxis_nticks=None,<EOL>xtick_angle=<NUM_LIT:30>,<EOL>font='<STR_LIT>',<EOL>font_size=<NUM_LIT:12>, title_font_size=None,<EOL>show_sample_labels=True, **kwargs):
<EOL>if emax is None:<EOL><INDENT>emax = self.matrix.X.max()<EOL><DEDENT>if emin is None:<EOL><INDENT>emin = self.matrix.X.min()<EOL><DEDENT>title = self.title<EOL>if title_font_size is None:<EOL><INDENT>title_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, TypeError):<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.matrix.samples)<EOL>gene_labels = self.matrix.genes.tolist()<EOL>if self.gene_aliases:<EOL><INDENT>for i, gene in enumerate(gene_labels):<EOL><INDENT>try:<EOL><INDENT>alias = self.gene_aliases[gene]<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>gene_labels[i] = '<STR_LIT>' % (gene, alias)<EOL><DEDENT><DEDENT><DEDENT>gene_labels = fix_plotly_label_bug(gene_labels)<EOL>data = [<EOL>go.Heatmap(<EOL>z=self.matrix.X,<EOL>x=x,<EOL>y=gene_labels,<EOL>zmin=emin,<EOL>zmax=emax,<EOL>colorscale=self.colorscale,<EOL>colorbar=colorbar,<EOL>hoverinfo='<STR_LIT>',<EOL>**kwargs<EOL>),<EOL>]<EOL>xticks = '<STR_LIT>'<EOL>if not show_sample_labels:<EOL><INDENT>xticks = '<STR_LIT>'<EOL><DEDENT>if xaxis_label is None:<EOL><INDENT>if self.matrix.samples.name is not None:<EOL><INDENT>xaxis_label = self.matrix.samples.name<EOL><DEDENT>else:<EOL><INDENT>xaxis_label = '<STR_LIT>'<EOL><DEDENT>xaxis_label = xaxis_label + '<STR_LIT>' % self.matrix.n<EOL><DEDENT>if yaxis_label is None:<EOL><INDENT>if self.matrix.genes.name is not None:<EOL><INDENT>yaxis_label = self.matrix.genes.name<EOL><DEDENT>else:<EOL><INDENT>yaxis_label = '<STR_LIT>'<EOL><DEDENT>yaxis_label = yaxis_label + '<STR_LIT>' % self.matrix.p<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=show_sample_labels,<EOL>ticks=xticks,<EOL>nticks=xaxis_nticks,<EOL>tickangle=xtick_angle,<EOL>showline=True<EOL>),<EOL>yaxis=go.YAxis(<EOL>title=yaxis_label,<EOL>titlefont=dict(size=title_font_size),<EOL>nticks=yaxis_nticks,<EOL>autorange='<STR_LIT>',<EOL>showline=True<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.matrix.n-<NUM_LIT:0.5>],<EOL>ticks='<STR_LIT>',<EOL>showticklabels=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.matrix.p-<NUM_LIT:0.5>, -<NUM_LIT:0.5>],<EOL>ticks='<STR_LIT>',<EOL>showticklabels=False<EOL>)<EOL>for ann in self.gene_annotations:<EOL><INDENT>i = self.matrix.genes.get_loc(ann.gene)<EOL>xmn = -<NUM_LIT:0.5><EOL>xmx = self.matrix.n-<NUM_LIT:0.5><EOL>ymn = i-<NUM_LIT:0.5><EOL>ymx = i+<NUM_LIT:0.5><EOL>data.append(<EOL>go.Scatter(<EOL>x=[xmn, xmx, xmx, xmn, xmn],<EOL>y=[ymn, ymn, ymx, ymx, ymn],<EOL>mode='<STR_LIT>',<EOL>hoverinfo='<STR_LIT:none>',<EOL>showlegend=False,<EOL>line=dict(color=ann.color),<EOL>xaxis='<STR_LIT>',<EOL>yaxis='<STR_LIT>',<EOL>opacity=<NUM_LIT:1>-ann.transparency,<EOL>)<EOL>)<EOL>if ann.label is not None:<EOL><INDENT>layout.annotations.append(<EOL>go.Annotation(<EOL>text=ann.label,<EOL>x=<NUM_LIT>,<EOL>y=i-<NUM_LIT:0.5>,<EOL>xref='<STR_LIT>',<EOL>yref='<STR_LIT>',<EOL>xanchor='<STR_LIT:left>',<EOL>yanchor='<STR_LIT>',<EOL>showarrow=False,<EOL>bgcolor='<STR_LIT>',<EOL>opacity=<NUM_LIT>,<EOL>borderpad=<NUM_LIT:0>,<EOL>font=dict(color=ann.color)<EOL>)<EOL>)<EOL><DEDENT><DEDENT>for ann in self.sample_annotations:<EOL><INDENT>j = self.matrix.samples.get_loc(ann.sample)<EOL>xmn = j-<NUM_LIT:0.5><EOL>xmx = j+<NUM_LIT:0.5><EOL>ymn = -<NUM_LIT:0.5><EOL>ymx = self.matrix.p-<NUM_LIT:0.5><EOL>data.append(<EOL>go.Scatter(<EOL>x=[xmn, xmx, xmx, xmn, xmn],<EOL>y=[ymn, ymn, ymx, ymx, ymn],<EOL>mode='<STR_LIT>',<EOL>hoverinfo='<STR_LIT:none>',<EOL>showlegend=False,<EOL>line=dict(color=ann.color),<EOL>xaxis='<STR_LIT>',<EOL>yaxis='<STR_LIT>',<EOL>opacity=<NUM_LIT:1.0>)<EOL>)<EOL>if ann.label is not None:<EOL><INDENT>layout.annotations.append(<EOL>go.Annotation(<EOL>text=ann.label,<EOL>y=<NUM_LIT>,<EOL>x=j+<NUM_LIT:0.5>,<EOL>xref='<STR_LIT>',<EOL>yref='<STR_LIT>',<EOL>xanchor='<STR_LIT:left>',<EOL>yanchor='<STR_LIT>',<EOL>showarrow=False,<EOL>bgcolor='<STR_LIT>',<EOL>opacity=<NUM_LIT:1>-ann.transparency,<EOL>borderpad=<NUM_LIT:0>,<EOL>textangle=<NUM_LIT>,<EOL>font=dict(color=ann.color)<EOL>)<EOL>)<EOL><DEDENT><DEDENT>fig = go.Figure(<EOL>data=data,<EOL>layout=layout<EOL>)<EOL>return fig<EOL>
Generate a plotly figure of the heatmap.

        Parameters
        ----------
        emin : int, float, or None, optional
            The expression value corresponding to the lower end of the
            colorscale. If None, determine, automatically. [None]
        emax : int, float, or None, optional
            The expression value corresponding to the upper end of the
            colorscale. If None, determine automatically. [None]
        margin_left : int, optional
            The size of the left margin (in px). [100]
        margin_right : int, optional
            The size of the right margin (in px). [0]
        margin_top : int, optional
            The size of the top margin (in px). [30]
        margin_bottom : int, optional
            The size of the bottom margin (in px). [60]
        colorbar_size : int or float, optional
            The sze of the colorbar, relative to the figure size. [0.4]
        xaxis_label : str or None, optional
            X-axis label. If None, use `ExpMatrix` default. [None]
        yaxis_label : str or None, optional
            y-axis label. If None, use `ExpMatrix` default. [None]
        xtick_angle : int or float, optional
            X-axis tick angle (in degrees). [30]
        font : str, optional
            Name of font to use. Can be multiple, separated by comma, to
            specify a prioritized list.
            [' "Droid Serif", "Open Serif", "serif"']
        font_size : int or float, optional
            Font size to use throughout the figure, in points. [12]
        title_font_size : int or float or None, optional
            Font size to use for labels on axes and the colorbar. If None,
            use `font_size` value. [None]
        show_sample_labels : bool, optional
            Whether to show the sample labels. [True]

        Returns
        -------
        `plotly.graph_objs.Figure`
            The plotly figure.