code: def save_image(self, image_file):
          
          self.ensure_pyplot()
          command = 'plt.gcf().savefig("%s")'%image_file
          #print 'SAVEFIG', command  # dbg
          self.process_input_line('bookmark ipy_thisdir', store_history=False)
          self.process_input_line('cd -b ipy_savedir', store_history=False)
          self.process_input_line(command, store_history=False)
          self.process_input_line('cd -b ipy_thisdir', store_history=False)
          self.process_input_line('bookmark -d ipy_thisdir', store_history=False)
          self.clear_cout()
docs: Saves the image file to disk.