Save the currently selected figure.
549318
def save_current_figure_as(self):
        """"""
        if self.current_thumbnail is not None:
            self.save_figure_as(self.current_thumbnail.canvas.fig,
                                self.current_thumbnail.canvas.fmt)
996849
def update(self):
        
        DEBUG_MSG("update()", 1, self)
        self._axes = self.canvas.figure.get_axes()
        self._menu.updateAxes(len(self._axes))
227268
def save(self, fn:PathOrStr):
        ""
        x = image2np(self.data*255).astype(np.uint8)
        PIL.Image.fromarray(x).save(fn)
136952
def write_data(self, output):
        
        if self.figure:
            canvas = FigureCanvas(self.figure)
            self.figure.savefig(output, format='png', bbox_inches='tight')
            output.seek(0)
            return output.getvalue()
        return None
1232320
def save(self, fname):
        
        element = _transform.SVGFigure(self.width, self.height)
        element.append(self)
        element.save(os.path.join(CONFIG['figure.save_path'], fname))
936406
def save_model(model, output_file):
    """"""
    if not output_file:
        return

    with open(output_file, 'wb') as f:
        pickle.dump(model, f)
    print("Saved model to file '{}'.".format(output_file))
1134293
def save(self):
        
        out = Outgest(self.output, self.selection_array.astype('uint8'), self.headers, self.config_path)
        out.save()
        out.upload()
1195547
def save(opts = {})
      save_png(opts) if Array(opts[:format]).include? :png
      save_pdf(opts) if Array(opts[:format]).include? :pdf
      self
    end
605705
def save_image(self, cat, img, data):
        """"""
        filename = self.path(cat, img)
        mkdir(filename)
        if type(data) == np.ndarray:
            data = Image.fromarray(data).convert('RGB')
        data.save(filename)
842799
def run(self, fig):
        
        # Calling savefig executes the draw() command, putting elements
        # in the correct place.
        fig.savefig(io.BytesIO(), format='png', dpi=fig.dpi)
        if self.close_mpl:
            import matplotlib.pyplot as plt
            plt.close(fig)
        self.crawl_fig(fig)
7307
def save(self, obj):
        """"""
        cur = self._conn().cursor()

        tabname = obj.__class__.get_table_name()

        index_names = obj.__class__.index_names() or []

        col_names = ['id', 'value'] + index_names
        value_holders = ['%s'] * len(col_names)
        updates = ['%s = EXCLUDED.%s' % (cn, cn) for cn in col_names[1:]]

        if not obj.id:
            id = uuid()
            obj.id = id

        query = 'insert into {0} ({1}) values ({2}) on conflict(id) do update set {3};'.format(
            tabname,
            ','.join(col_names),
            ','.join(value_holders),
            ','.join(updates),
        )

        values = [obj.id, obj.to_data()]

        index_vals = obj.indexes() or {}
        values += [index_vals.get(name, 'NULL') for name in index_names]

        with self._conn() as conn:
            with conn.cursor() as cur:
                cur.execute(query, tuple(values))
993485
def set_figure(self, figure, handle=None):
        """"""
        self.figure = figure
        self.bkimage = None
        self._push_handle = handle

        wd = figure.plot_width
        ht = figure.plot_height

        self.configure_window(wd, ht)

        doc = curdoc()
        #self.logger.info(str(dir(doc)))
        doc.add_periodic_callback(self.timer_cb, 50)
        self.logger.info("figure set")
932424
def save(self):
        """"""
        data = str.encode( json.dumps(self.simpleAttrs, indent=4, sort_keys=True) )
        with open(self.filename, "wb") as f:
            f.write(data)
258003
def copy_figure(self):
        """"""
        if self.figviewer and self.figviewer.figcanvas.fig:
            self.figviewer.figcanvas.copy_figure()
66969
def draw(self):
        """"""
        for fig in set(chain(*map(
                lambda arr: arr.psy.plotter.figs2draw, self.with_plotter))):
            self.logger.debug("Drawing figure %s", fig.number)
            fig.canvas.draw()
        for arr in self:
            if arr.psy.plotter is not None:
                arr.psy.plotter._figs2draw.clear()
        self.logger.debug("Done drawing.")
968540
def __save_plots_of_the_current_page(self, section, page, output_path):
        """"""
        
        for key in self.sections[section].pages[page].elements.keys():
            print(section, page, key) # debug print
            
            buf_temp = self.sections[section].pages[page].elements[key].plot_object
            if buf_temp is not None :

                plot_path = os.path.join(output_path, "output", self.name, "site", section, key + ".svg")
                
                
                try :
                    my_file = open(plot_path, "wb")
                    my_file.write(buf_temp)
                    my_file.close()
                except Exception as e:
                    print (e)
                    print ("In {section} and {page}, an element exists without a valid plot object.".format(section = section, page = page))
1051264
public function saveLean() {
		$fh = fopen($this->getDirname().'/'.$this->getLeanName(),'w');
		fwrite($fh, $this->leanCSS->render());	
	}