def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
def close(figure):
        """!
        @brief Closes figure object that was used or allocated by the visualizer.