Get the parameters (heigth, width, etc.) to create a figure

        This method returns the number of the figure and a dictionary
        containing the necessary information for the
        :func:`matplotlib.pyplot.figure` function
17879
def inspect_figure(fig):
        """"""
        return fig.number, {
            'num': fig.number,
            'figsize': (fig.get_figwidth(), fig.get_figheight()),
            'dpi': fig.get_dpi() / getattr(fig.canvas, '_dpi_ratio', 1),
            'facecolor': fig.get_facecolor(),
            'edgecolor': fig.get_edgecolor(),
            'frameon': fig.get_frameon(),
            'tight_layout': fig.get_tight_layout(),
            'subplotpars': vars(fig.subplotpars)}
1357422
def parameters(self):
        
        parameters = []
        for k, v in self.__dict__.items():
            if k.startswith("_"):
                continue

            is_function = False
            is_set = False

            if callable(v):
                value = pickle.dumps(func_dump(v))
                is_function = True
            elif isinstance(v, set):
                value = list(v)
                is_set = True
            else:
                value = v

            parameters.append(dict(
                key=k,
                value=value,
                is_function=is_function,
                is_set=is_set
            ))

        return parameters
1069250
def get_parameters(self, params, graph=None):
        
        g = graph if graph is not None else self.tf_graph

        with g.as_default():
            with tf.Session() as self.tf_session:
                self.tf_saver.restore(self.tf_session, self.model_path)
                out = {}
                for par in params:
                    if type(params[par]) == list:
                        for i, p in enumerate(params[par]):
                            out[par + '-' + str(i+1)] = p.eval()
                    else:
                        out[par] = params[par].eval()
                return out
558895
def make_figure(plots):
    
    # NB: matplotlib is imported inside since it is a costly import
    import matplotlib.pyplot as plt

    fig, ax = plt.subplots()
    ax.grid(True)
    ax.set_xlabel('tasks')
    ax.set_ylabel('GB')
    start = 0
    for task_name, mem in plots:
        ax.plot(range(start, start + len(mem)), mem, label=task_name)
        start += len(mem)
    ax.legend()
    return plt
201342
def define_format(self, plotStyle, plotSize):

        #Default sizes for computer
        sizing_dict = {}
        sizing_dict['figure.figsize'] = (14, 8)
        sizing_dict['legend.fontsize'] = 15
        sizing_dict['axes.labelsize'] = 20
        sizing_dict['axes.titlesize'] = 24
        sizing_dict['xtick.labelsize'] = 14
        sizing_dict['ytick.labelsize'] = 14
        
        self.colorVector = {
        'iron':'#4c4c4c',
        'silver':'#cccccc',                  
        'dark blue':'#0072B2',
        'green':'#009E73', 
        'orangish':'#D55E00',
        'pink':'#CC79A7',
        'yellow':'#F0E442',
        'cyan':'#56B4E9',
        'olive':'#bcbd22',
        'grey':'#7f7f7f',
        'skin':'#FFB5B8'}

        #sizing_dict['text.usetex'] = True
        
        #--Update the colors/format
        if plotStyle == None:
            self.ColorVector = [None, None, None]
        
        elif plotStyle == 'dark':
            plt.style.use('dark_background')

        elif plotStyle == 'night':
            
            plt.style.use('seaborn-colorblind')
            
            iron_color = '#4c4c4c' #Iron: (76 76 76)
            silver_color = '#cccccc' #Silver: (204 204 204) 
            sizing_dict['axes.facecolor']   = iron_color
            sizing_dict['figure.facecolor'] = iron_color
            sizing_dict['axes.edgecolor']   = silver_color
            sizing_dict['text.color']       = silver_color
            sizing_dict['axes.labelcolor']  = silver_color
            sizing_dict['xtick.color']      = silver_color
            sizing_dict['ytick.color']      = silver_color
            sizing_dict['axes.edgecolor']   = silver_color

            
            #'plt.rc('axes', prop_cycle=(cycler('color', ['r', 'g', 'b', 'y']) + cycler('linestyle', ['-', '--', ':', '-.'])))'
            #This should be the set up for the cycler we just need to add the colors
            #axes.prop_cycle : cycler('color', 'bgrcmyk')

        elif plotStyle == 'colorblind':
            plt.style.use('seaborn-colorblind')

        else:
            plt.style.use(plotStyle)
        
        #--Load particular configuration for this plot
        if plotSize == 'medium':            
            rcParams.update(sizing_dict)
        
        elif type(plotSize) is dict:
            sizing_dict.update(plotSize)
            rcParams.update(sizing_dict)

        '''
        
        '''
 
    
        '''
        Matplotlib default palete
        #17becf dark blue
        #bcbd22 orange
        #2ca02c green
        #e377c2 red
        #8c564b purple
        #9467bd brown
        #d62728 pink
        #7f7f7f grey
        #ff7f0e olive
        #1f77b4 cyan
        '''


  
        '''
        --These are matplotlib styles
        seaborn-darkgrid
        seaborn-notebook
        classic
        seaborn-ticks
        grayscale
        bmh
        seaborn-talk
        dark_background
        ggplot
        fivethirtyeight
        seaborn-colorblind
        seaborn-deep
        seaborn-whitegrid
        seaborn-bright
        seaborn-poster
        seaborn-muted
        seaborn-paper
        seaborn-white
        seaborn-pastel
        seaborn-dark
        seaborn
        seaborn-dark-palette
        '''
192719
def get_size(self):
        
        rec = self.get_rectangle()
        return (int(rec[2]-rec[0]), int(rec[3]-rec[1]))
202807
def make_parameter_dict(pdict, fixed_par=False, rescale=True,
                        update_bounds=False):
    
    o = copy.deepcopy(pdict)
    o.setdefault('scale', 1.0)

    if rescale:
        value, scale = utils.scale_parameter(o['value'] * o['scale'])
        o['value'] = np.abs(value) * np.sign(o['value'])
        o['scale'] = np.abs(scale) * np.sign(o['scale'])
        if 'error' in o:
            o['error'] /= np.abs(scale)

    if update_bounds:
        o['min'] = o['value'] * 1E-3
        o['max'] = o['value'] * 1E3

    if fixed_par:
        o['min'] = o['value']
        o['max'] = o['value']

    if float(o['min']) > float(o['value']):
        o['min'] = o['value']

    if float(o['max']) < float(o['value']):
        o['max'] = o['value']

    return o
264717
def get_parameters(self, packet_count=None):
        
        params = super(InMemCapture, self).get_parameters(packet_count=packet_count)
        params += ['-i', '-']
        return params
13096
def parameters_dict(self):
        
        d = {}
        for k, v in self.__dict__.items():
            if not k.startswith("_"):
                d[k] = v
        return d
1136581
def make_fig(self):
        
        self.fig = plt.figure(figsize=(8, 4))
        self._all_figures.append(self.fig)
1048508
def info(cls, obj, ansi=True, backend='matplotlib', visualization=True,
             recursive=False, pattern=None, elements=[]):
        
        parameterized_object = isinstance(obj, param.Parameterized)
        parameterized_class = (isinstance(obj,type)
                               and  issubclass(obj,param.Parameterized))
        info = None
        if parameterized_object or parameterized_class:
            info = InfoPrinter.info(obj, ansi=ansi, backend=backend,
                                    visualization=visualization,
                                    pattern=pattern, elements=elements)

        if parameterized_object and recursive:
            hierarchy = obj.traverse(lambda x: type(x))
            listed = []
            for c in hierarchy[1:]:
                if c not in listed:
                    inner_info = InfoPrinter.info(c, ansi=ansi, backend=backend,
                                                  visualization=visualization,
                                                  pattern=pattern)
                    black = '\x1b[1;30m%s\x1b[0m' if ansi else '%s'
                    info +=  '\n\n' + (black % inner_info)
                    listed.append(c)
        return info
1142172
def _get_axis_dims(self, element):
        
        dims = element.dimensions()[:2]
        if len(dims) == 1:
            return dims + [None, None]
        else:
            return dims + [None]
443848
def parameters(self):
        
        if self._parameters is None:
            self.__init()
        for param in self._parameters:
            if not isinstance(param['defaultValue'], BaseGPObject):
                if param['dataType'] == "GPFeatureRecordSetLayer":
                    param['defaultValue'] = GPFeatureRecordSetLayer.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPString":
                    param['defaultValue'] = GPString.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPLong":
                    param['defaultValue'] = GPLong.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPDouble":
                    param['defaultValue'] = GPDouble.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPDate":
                    param['defaultValue'] = GPDate.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPBoolean":
                    param['defaultValue'] = GPBoolean.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPDataFile":
                    param['defaultValue'] = GPDataFile.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPLinearUnit":
                    param['defaultValue'] = GPLinearUnit.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPMultiValue":
                    param['defaultValue'] = GPMultiValue.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPRasterData":
                    param['defaultValue'] = GPRasterData.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPRasterDataLayer":
                    param['defaultValue'] = GPRasterDataLayer.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPRecordSet":
                    param['defaultValue'] = GPRecordSet.fromJSON(json.dumps(param))
        return self._parameters
44278
def figure_buffer(figs):
    ''''''
    assert len(figs) > 0, 'No figure buffers given. Forgot to return from draw call?'
    buffers = []
    w, h = figs[0].canvas.get_width_height()
    for f in figs:
        wf, hf = f.canvas.get_width_height()
        assert wf == w and hf == h, 'All canvas objects need to have same size'
        buffers.append(np.fromstring(f.canvas.tostring_rgb(), dtype=np.uint8).reshape(h, w, 3))

    return np.stack(buffers)
147260
def params(self):
        
        paramlist = [b.params for b in self.bases if b.params.has_value]

        if len(paramlist) == 0:
            return Parameter()
        else:
            return paramlist if len(paramlist) > 1 else paramlist[0]
296596
def create_figure(n_subplots, figsize):
    ""
    fig = plt.figure(figsize=figsize)
    axes = []

    for i in range(n_subplots):
        axes.append(fig.add_subplot(n_subplots, 1, i+1))

    return fig, axes
1155924
def plot(self):
		
		import matplotlib.pyplot as plt
		plt.plot(self.E)
		plt.show()