当前位置: 首页>>代码示例>>Python>>正文


Python Figure.__init__方法代码示例

本文整理汇总了Python中matplotlib.figure.Figure.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Figure.__init__方法的具体用法?Python Figure.__init__怎么用?Python Figure.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在matplotlib.figure.Figure的用法示例。


在下文中一共展示了Figure.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from matplotlib.figure import Figure [as 别名]
# 或者: from matplotlib.figure.Figure import __init__ [as 别名]
    def __init__(self, sigs={}, fig=None):
        """ Instanciate a Figure.
        If a signal list is provided, add a graph with the signal list
        By default, create an empty list of graph and set the layout to horiz

        Parameters
        ----------
        sigs: dict of Signals
        If provided, the function instanciate the Figure with one Graph and
        insert the Signals

        fig: Not used

        Returns
        -------
        The figure instanciated and initialized
        """
        MplFig.__init__(self)

        self._layout = "horiz"
        self._MODES_NAMES_TO_OBJ = {'lin':LinGraph, 'polar':PolarGraph, 'smith':SmithChart, 'eye':EyeGraph}
        self._kid = None
        # FIXME: Slow way... Surely there exist something faster
        self._OBJ_TO_MODES_NAMES = {}
        for k, v in self._MODES_NAMES_TO_OBJ.items():
            self._OBJ_TO_MODES_NAMES[v] = k

        if not sigs:
            return
        elif isinstance(sigs, dict):
            self.add(sigs)
        else:
            print(sigs)
            assert 0, _("Bad type")
开发者ID:agardelein,项目名称:oscopy,代码行数:36,代码来源:figure.py

示例2: __init__

# 需要导入模块: from matplotlib.figure import Figure [as 别名]
# 或者: from matplotlib.figure.Figure import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     """
     custom kwarg figtitle is a figure title
     """
     figtitle = kwargs.pop('figtitle', 'hi mom')
     Figure.__init__(self, *args, **kwargs)
     self.text(0.5, 0.95, figtitle, ha='center')
开发者ID:,项目名称:,代码行数:9,代码来源:

示例3: __init__

# 需要导入模块: from matplotlib.figure import Figure [as 别名]
# 或者: from matplotlib.figure.Figure import __init__ [as 别名]
 def __init__(self):
     Figure.__init__(self)
     self.subfigures = []
     self.subplots_adjust(bottom=0.1, right=0.8)
     self.dayLocator = DayLocator()
     self.hourLocator = HourLocator(interval=3)
     self.dateFormat = DateFormatter('%H:%M \n %Y-%m-%d')
     self.set_size_inches(12, 4)
     self.dirTickLocator = MultipleLocator(45)
开发者ID:HyeonJeongKim,项目名称:tcrm,代码行数:11,代码来源:timeseries.py

示例4: __init__

# 需要导入模块: from matplotlib.figure import Figure [as 别名]
# 或者: from matplotlib.figure.Figure import __init__ [as 别名]
 def __init__(self, x_list, y_list, title=None):
     Figure.__init__(self, facecolor="white")
     ax = self.add_subplot(111)
     if title is not None:
         ax.set_title(title, fontsize=10)
     ax.scatter(x_list, y_list)
     ind = np.arange(len(x_list)) + 1
     ax.set_xticks(ind)
     ax.set_xlim(left=0, right=len(x_list) + 1)
开发者ID:bsherin,项目名称:shared_tools,代码行数:11,代码来源:matplotlib_window.py

示例5: __init__

# 需要导入模块: from matplotlib.figure import Figure [as 别名]
# 或者: from matplotlib.figure.Figure import __init__ [as 别名]
 def __init__(self, lat, lon, eP, cP, rMax, beta, beta1=1.5, beta2=1.4):
     Figure.__init__(self)
     self.R = np.array(range(1, 201), 'f')
     self.lat = lat
     self.lon = lon
     self.rMax = rMax
     self.eP = eP
     self.cP = cP
     self.beta = beta
     self.beta1 = beta1
     self.beta2 = beta2
开发者ID:HyeonJeongKim,项目名称:tcrm,代码行数:13,代码来源:plotProfiles.py

示例6: __init__

# 需要导入模块: from matplotlib.figure import Figure [as 别名]
# 或者: from matplotlib.figure.Figure import __init__ [as 别名]
 def __init__(self, x_name, y_name, *args, **kwargs):
     Figure.__init__(self, *args, **kwargs)
     self.plot_axes = self.add_subplot(111, xlabel=x_name,
                                       ylabel=y_name.upper())
     self.plot_line = None
     self.canvas = FigureCanvas(self)
     self.plot_xname = x_name
     self.plot_yname = y_name
     self.plot_xdata = []
     self.plot_ydata = []
     self.plot_line, = self.plot_axes.plot(self.plot_xdata, self.plot_ydata)
     self.plot_max_points = 200
开发者ID:rma,项目名称:guyton92,代码行数:14,代码来源:ui_qt_plot.py

示例7: __init__

# 需要导入模块: from matplotlib.figure import Figure [as 别名]
# 或者: from matplotlib.figure.Figure import __init__ [as 别名]
    def __init__(self, *args, **kwargs):
        name = kwargs.get('name', None)
        if name is not None:
            del kwargs[name]
            self.name = name
        else:
            self.name = 'figure{0}'.format(Figure.figure_index)
            Figure.figure_index += 1

        PLTFigure.__init__(self, *args, **kwargs)

        self.axes_   = {}
        self.series_ = {}
开发者ID:javier-cabezas,项目名称:figplotter,代码行数:15,代码来源:info.py

示例8: __init__

# 需要导入模块: from matplotlib.figure import Figure [as 别名]
# 或者: from matplotlib.figure.Figure import __init__ [as 别名]
 def __init__(self, **kwargs):
     if "dpi" in kwargs:
         dpi = kwargs["dpi"]
     else:
         dpi = 80
     if "title" in kwargs:
         title = kwargs["title"]
     else:
         title = None
     Figure.__init__(self, figsize=(self.width / dpi, self.height / 80), dpi=dpi)
     self.title = title
     self.dpi = dpi
     self.kwargs = kwargs
开发者ID:bsherin,项目名称:tactic,代码行数:15,代码来源:matplotlib_utilities.py

示例9: __init__

# 需要导入模块: from matplotlib.figure import Figure [as 别名]
# 或者: from matplotlib.figure.Figure import __init__ [as 别名]
    def __init__(self, *attributes):

        Figure.__init__(self, (5.0, 4.0), facecolor="white")

        self.attributes = attributes

        self.__axes = self.add_subplot(111)

        # Insert empty attributes with a dict for figure attributes
        if not self.attributes:
            self.attributes = [{}]

        self.draw_chart()
开发者ID:01-,项目名称:pyspread,代码行数:15,代码来源:charts.py

示例10: __init__

# 需要导入模块: from matplotlib.figure import Figure [as 别名]
# 或者: from matplotlib.figure.Figure import __init__ [as 别名]
 def __init__(self, master, size, dpi, task):
     Figure.__init__(
         self,
         figsize=(size[0] / dpi, size[1] / dpi),
         dpi=dpi,
         facecolor="w",
         edgecolor="b",
         frameon=True,
         linewidth=0,
     )
     FigureCanvas(self, master=master)
     self.master = master
     self._errors = collections.OrderedDict()
     self._dirty = True
     self._task = task
     self.add_subplot(111, axisbg="w")
开发者ID:schaul,项目名称:nnsandbox,代码行数:18,代码来源:Report.py

示例11: __init__

# 需要导入模块: from matplotlib.figure import Figure [as 别名]
# 或者: from matplotlib.figure.Figure import __init__ [as 别名]
 def __init__(self, locking=True, disable_output=None, display=None, toolbar=None, **figkw):
     if disable_output is not None:
         self._disable_output = disable_output
     else:
         self._disable_output = _p.rcParams['refigure.disableoutput']
     if display is not None:
         self.display = display
     else:
         self.display = _p.rcParams['refigure.display']
     if toolbar is not None:
         self._toolbar = toolbar
     else:
         self._toolbar = _p.rcParams['refigure.toolbar']
     if not self._toolbar and 'facecolor' not in figkw:
         figkw['facecolor'] = 'white'
     
     _Figure.__init__(self, **figkw)
     c = _FigureCanvasBase(self) # For savefig to work
     # Set this here to allow 'f = figure()'  syntax
     if not locking:
         self.__class__.current_fig = self # Another thread can tweak this!
开发者ID:rschroll,项目名称:refigure2,代码行数:23,代码来源:refigure2.py

示例12: __init__

# 需要导入模块: from matplotlib.figure import Figure [as 别名]
# 或者: from matplotlib.figure.Figure import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     Figure.__init__(self, *args, **kwargs)
开发者ID:tomparks,项目名称:PH2150,代码行数:4,代码来源:pset8ex2.py

示例13: __init__

# 需要导入模块: from matplotlib.figure import Figure [as 别名]
# 或者: from matplotlib.figure.Figure import __init__ [as 别名]
 def __init__(self):
     Figure.__init__(self)
     self.subfigures = []
开发者ID:HyeonJeongKim,项目名称:tcrm,代码行数:5,代码来源:figures.py

示例14: __init__

# 需要导入模块: from matplotlib.figure import Figure [as 别名]
# 或者: from matplotlib.figure.Figure import __init__ [as 别名]
 def __init__(self, parent, width, height, dpi):
     Figure.__init__(self, figsize=(width, height), dpi=dpi)
     self.parent = parent
开发者ID:CraigLoomis,项目名称:ics_sps_engineering_plotData,代码行数:5,代码来源:myfigure.py

示例15: __init__

# 需要导入模块: from matplotlib.figure import Figure [as 别名]
# 或者: from matplotlib.figure.Figure import __init__ [as 别名]
    def __init__(self, number_of_subplots):
        Figure.__init__(self)
        self.number_of_subplots = number_of_subplots
        
        #todo
        # there has to be an existing class that can hold four points together
        # Determine how multiple plots will be laid out, 2x1, 3x4 etc.
        if self.number_of_subplots <= 1:    
            self.num_rows = 1
            self.title_fontsize = 12
            self.legend_fontsize = 12
            self.axes_label_fontsize = 12
            self.axes_tick_fontsize = 10
            self.main_border_left = 0.05
            self.main_border_right = 0.05
            self.main_border_lower = 0.05
            self.main_border_upper = 0.05
            self.subplot_border_left = 0.0
            self.subplot_border_right = 0.0            
            self.subplot_border_lower = 0.05
            self.subplot_border_upper = 0.2
        elif ((self.number_of_subplots >= 2) and (self.number_of_subplots <= 6 )):
            self.num_rows = 2
            self.title_fontsize = 10
            self.legend_fontsize = 10
            self.axes_label_fontsize = 10
            self.axes_tick_fontsize = 8
            self.main_border_left = 0.05
            self.main_border_right = 0.05
            self.main_border_lower = 0.0
            self.main_border_upper = 0.05
            self.subplot_border_left = 0.0
            self.subplot_border_right = 0.0            
            self.subplot_border_lower = 0.05
            self.subplot_border_upper = 0.05
        else:
            self.num_rows = 3
            self.title_fontsize = 8
            self.legend_fontsize = 6
            self.axes_label_fontsize = 8
            self.axes_tick_fontsize = 6
            self.main_border_left = 0.05
            self.main_border_right = 0.05
            self.main_border_lower = 0.1
            self.main_border_upper = 0.0
            self.subplot_border_left = 0.0
            self.subplot_border_right = 0.0            
            self.subplot_border_lower = 0.0
            self.subplot_border_upper = 0.1
        
        self.num_cols = int(math.ceil(float(self.number_of_subplots)/float(self.num_rows)))    

        self.main_axes_width = 1.0 - (self.main_border_left + self.main_border_right)
        self.main_axes_height = 1.0 - (self.main_border_lower + self.main_border_upper)

        # Set up grid geometry
        self.col_width = (self.main_axes_width/self.num_cols)
        self.row_height = (self.main_axes_height/self.num_rows)

        self.subplot_width = self.col_width - (self.subplot_border_left + self.subplot_border_right) 
        self.subplot_height = self.row_height - (self.subplot_border_lower + self.subplot_border_upper)        
开发者ID:G4FKH,项目名称:pythonprop,代码行数:63,代码来源:voaMultiPlot.py


注:本文中的matplotlib.figure.Figure.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。