r"""Close last created figure, alias to ``plt.close()``.
350659
def close(*args, **kwargs):
    """
    _, plt, _ = _import_plt()
    plt.close(*args, **kwargs)
914367
def close(self, ulBuffer):
        """"""

        fn = self.function_table.close
        result = fn(ulBuffer)
        return result
915043
def _Close(self):
    """"""
    # pylint: disable=protected-access
    super(RawFile, self)._Close()

    for file_object in self._file_objects:
      file_object.close()

    self._file_objects = []
631087
def close(self):
        """"""
        self.current = Token(self.current.lineno, TOKEN_EOF, '')
        self._next = None
        self.closed = True
26853
def _finalise_figure(fig, **kwargs):  # pragma: no cover
    
    title = kwargs.get("title") or None
    show = kwargs.get("show") or False
    save = kwargs.get("save") or False
    savefile = kwargs.get("savefile") or "EQcorrscan_figure.png"
    return_fig = kwargs.get("return_figure") or False
    if title:
        fig.suptitle(title)
    if show:
        fig.show()
    if save:
        fig.savefig(savefile)
        print("Saved figure to {0}".format(savefile))
    if return_fig:
        return fig
    return None
978863
def finish_plot():
    """"""
    plt.legend()
    plt.grid(color='0.7')
    plt.xlabel('x')
    plt.ylabel('y')
    plt.show()
310177
def finalize(self, **kwargs):
        
        # Set the title on the plot
        self.set_title(
            'Prediction Error for {}'.format(self.name)
        )

        # Square the axes to ensure a 45 degree line
        if self.shared_limits:
            # Get the current limits
            ylim = self.ax.get_ylim()
            xlim = self.ax.get_xlim()

            # Find the range that captures all data
            bounds = (
                min(ylim[0], xlim[0]),
                max(ylim[1], xlim[1]),
            )

            # Reset the limits
            self.ax.set_xlim(bounds)
            self.ax.set_ylim(bounds)

            # Ensure the aspect ratio is square
            self.ax.set_aspect('equal', adjustable='box')

        # Draw the 45 degree line
        if self.identity:
            draw_identity_line(
                ax=self.ax, ls='--', lw=2, c=self.colors['line'],
                alpha=0.5, label="identity"
            )

        # Set the axes labels
        self.ax.set_ylabel(r'$\hat{y}$')
        self.ax.set_xlabel(r'$y$')

        # Set the legend
        # Note: it would be nice to be able to use the manual_legend utility
        # here, since if the user sets a low alpha value, the R2 color in the
        # legend will also become more translucent. Unfortunately this is a
        # bit tricky because adding a manual legend here would override the
        # best fit and 45 degree line legend components. In particular, the
        # best fit is plotted in draw because it depends on y and y_pred.
        self.ax.legend(loc='best', frameon=True)
1360667
def end_output (self, **kwargs):
        """"""
        self.write_edges()
        self.end_graph()
        if self.has_part("outro"):
            self.write_outro()
        self.close_fileoutput()
394243
def close(self):
        
        self.grid._graph.add_edge(self.branch_nodes[0], self.branch_nodes[1], branch=self.branch)
        self.status = 'closed'
846724
def close(self):
    """"""
    self.emit(self.generate_epilog(self.settings), dest=ReporterDestination.ERR)
883783
def close(self):
        
        if self._fd is None:
            return

        try:
            os.close(self._fd)
        except OSError as e:
            raise LEDError(e.errno, "Closing LED: " + e.strerror)

        self._fd = None
883991
def close(self, end_time=None):
        
        super(Subsegment, self).close(end_time)
        self.parent_segment.decrement_ref_counter()
643548
def close(self):
        """"""
        if self.is_open():
            fd = self._fd
            self._fd = -1
            if self.uses_nanoconfig:
                wrapper.nc_close(fd)
            else:
                _nn_check_positive_rtn(wrapper.nn_close(fd))
1070613
def finalize(self, **kwargs):
        
        # Set the aspect ratio to make the visualization square
        # TODO: still unable to make plot square using make_axes_locatable
        # x0,x1 = self.ax.get_xlim()
        # y0,y1 = self.ax.get_ylim()
        # self.ax.set_aspect(abs(x1-x0)/abs(y1-y0))

        # Add the title to the plot if the user has set one.
        self.set_title("")

        # Set the legend with full opacity patches using manual legend.
        # Or Add the colorbar if this is a continuous plot.
        self.ax.legend(loc="best", frameon=True)

        # Finalize the histograms
        if self.hist:
            plt.setp(self.xhax.get_xticklabels(), visible=False)
            plt.setp(self.yhax.get_yticklabels(), visible=False)
            plt.sca(self.ax)

        # Call tight layout to maximize readability
        plt.tight_layout()
1317078
def end(self):
        """"""
        if self.lastUrl is not None:
            self.html.write(u'</li>\n')
        if self.lastComic is not None:
            self.html.write(u'</ul>\n')
        self.html.write(u'</ul>\n')
        self.addNavLinks()
        self.html.close()
98327
def finalize(self):
        """"""
        print('{} default sprite names found:'.format(self.total_default))
        for name in self.list_default:
            print(name)
1023094
def _finalize_axis(self, key):
        
        if 'title' in self.handles:
            self.handles['title'].set_visible(self.show_title)

        self.drawn = True
        if self.subplot:
            return self.handles['axis']
        else:
            fig = self.handles['fig']
            if not getattr(self, 'overlaid', False) and self._close_figures:
                plt.close(fig)
            return fig