• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python backend_webagg_core.FigureManagerWebAgg类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中matplotlib.backends.backend_webagg_core.FigureManagerWebAgg的典型用法代码示例。如果您正苦于以下问题:Python FigureManagerWebAgg类的具体用法?Python FigureManagerWebAgg怎么用?Python FigureManagerWebAgg使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: __init__

 def __init__(self, canvas, num):
     FigureManagerWebAgg.__init__(self, canvas, num)
     toolitems = []
     for name, tooltip, image, method in self.ToolbarCls.toolitems:
         if name is None:
             toolitems.append(['', '', '', ''])
         else:
             toolitems.append([name, tooltip, image, method])
     canvas._toolbar_items = toolitems
     self.web_sockets = [self.canvas]
开发者ID:stonebig,项目名称:jupyter-matplotlib,代码行数:10,代码来源:backend_nbagg.py


示例2: __init__

    def __init__(self):

        super(MyApplication, self).__init__([
            # Static files for the CSS and JS
            (r'/_static/(.*)',
            #(r'/(.*)',
             tornado.web.StaticFileHandler,
             {'path': FigureManagerWebAgg.get_static_file_path()}),

            (r'/', MainPage),

            # The pages that contain the plot (or maybe the plots)
            (r'/DataFrame\d', PlotPage),

            (r'/mpl.js', self.MplJs),

            # Sends images and events to the browser, and receives
            # events from the browser
            (r'/([0-9]+)/ws', self.WebSocket),

            # Handles the downloading (i.e., saving) of static images
            (r'/download.([a-z0-9.]+)', self.Download),

            ],
            static_path='static',
            template_path='templates',
            debug=True
            )
开发者ID:bmu,项目名称:webagg_examples,代码行数:28,代码来源:plot_server.py


示例3: __init__

    def __init__(self, stop_callback=None):
        super(MyApplication, self).__init__([
            # Static files for the CSS and JS
            (r'/_static/(.*)',
             tornado.web.StaticFileHandler,
             {'path': FigureManagerWebAgg.get_static_file_path()}),

            # The page that contains all of the pieces
            ('/', self.MainPage),

            ('/mpl.js', self.MplJs),

            # Sends images and events to the browser, and receives
            # events from the browser
            ('/ws', self.WebSocket),

            # Handles the downloading (i.e., saving) of static images
            (r'/download.([a-z0-9.]+)', self.Download),
        ])

        figure = Figure()

        self.manager = new_figure_manager_given_figure(
            id(figure), figure)

        ax = figure.add_subplot(1, 1, 1)

        def callback(event):
            '''Sends event to front end'''
            event.info.pop('caller', None)  # HACK: popping caller b/c it's not JSONizable.
            self.manager._send_event(event.type, **event.info)

        self.fc_manager = fc_widget.FCGateManager(ax, callback_list=callback)
        self.stop_callback = stop_callback
开发者ID:eyurtsev,项目名称:FlowCytometryTools,代码行数:34,代码来源:gui.py


示例4: create_application

def create_application():
    application = Application([
        ('/_static/(.*)', StaticFileHandler, {'path': FigureManagerWebAgg.get_static_file_path()}),
        ('/mpl.js', MplJavaScriptHandler),

        (url_pattern('/mpl/download/{{base_dir}}/{{figure_id}}/{{format_name}}'), MplDownloadHandler),
        (url_pattern('/mpl/figures/{{base_dir}}/{{figure_id}}'), MplWebSocketHandler),

        (url_pattern('/'), WebAPIVersionHandler),
        (url_pattern('/exit'), WebAPIExitHandler),
        (url_pattern('/api'), JsonRpcWebSocketHandler, dict(
            service_factory=service_factory,
            validation_exception_class=ValidationError,
            report_defer_period=WEBAPI_PROGRESS_DEFER_PERIOD)
         ),
        (url_pattern('/ws/res/plot/{{base_dir}}/{{res_name}}'), ResourcePlotHandler),
        (url_pattern('/ws/res/geojson/{{base_dir}}/{{res_id}}'), ResFeatureCollectionHandler),
        (url_pattern('/ws/res/geojson/{{base_dir}}/{{res_id}}/{{feature_index}}'), ResFeatureHandler),
        (url_pattern('/ws/res/csv/{{base_dir}}/{{res_id}}'), ResVarCsvHandler),
        (url_pattern('/ws/res/html/{{base_dir}}/{{res_id}}'), ResVarHtmlHandler),
        (url_pattern('/ws/res/tile/{{base_dir}}/{{res_id}}/{{z}}/{{y}}/{{x}}.png'), ResVarTileHandler),
        (url_pattern('/ws/ne2/tile/{{z}}/{{y}}/{{x}}.jpg'), NE2Handler),
        (url_pattern('/ws/countries'), CountriesGeoJSONHandler),
    ])
    application.workspace_manager = FSWorkspaceManager()
    return application
开发者ID:CCI-Tools,项目名称:ect-core,代码行数:26,代码来源:start.py


示例5: __init__

 def __init__(self, routes, **kwargs):
   # routes common to all webagg servers
   mplweb_routes = [
       (r'/([0-9]+)/download.([a-z0-9.]+)', DownloadHandler),
       (r'/([0-9a-f]+)/([0-9]+)/ws', WebSocketHandler),
       (r'/mpl.js', MplJsHandler),
       (r'/_static/(.*)', tornado.web.StaticFileHandler,
        dict(path=FigureManagerWebAgg.get_static_file_path())),
   ]
   tornado.web.Application.__init__(self, routes + mplweb_routes, **kwargs)
   self.prog_states = {}  # uid -> ProgramState
   self.fig_managers = {}  # fignum -> manager
   # hack in a mock manager for keep-alive sockets
   self.fig_managers['0'] = _MockFigureManager()
开发者ID:asudhakar-umass,项目名称:HappyHapke,代码行数:14,代码来源:mplweb.py


示例6: __init__

    def __init__(self, figure):
        self.figure = figure
        self.manager = new_figure_manager_given_figure(id(figure), figure)

        super().__init__([
            # Static files for the CSS and JS
            (r'/_static/(.*)',
             tornado.web.StaticFileHandler,
             {'path': FigureManagerWebAgg.get_static_file_path()}),

            # The page that contains all of the pieces
            ('/', self.MainPage),

            ('/mpl.js', self.MplJs),

            # Sends images and events to the browser, and receives
            # events from the browser
            ('/ws', self.WebSocket),

            # Handles the downloading (i.e., saving) of static images
            (r'/download.([a-z0-9.]+)', self.Download),
        ])
开发者ID:NelleV,项目名称:matplotlib,代码行数:22,代码来源:embedding_webagg_sgskip.py


示例7: __init__

 def __init__(self, canvas, num):
     self._shown = False
     FigureManagerWebAgg.__init__(self, canvas, num)
开发者ID:ADSA-UIUC,项目名称:workshop-twitter-bot,代码行数:3,代码来源:backend_nbagg.py


示例8: get

 def get(self):
     self.set_header('Content-Type', 'application/javascript')
     js_content = FigureManagerWebAgg.get_javascript()
     with open('static/mpl.js', 'r') as fh:
         local_content = fh.read()
     self.write(local_content)
开发者ID:bmu,项目名称:webagg_examples,代码行数:6,代码来源:plot_server.py


示例9: get

        def get(self):
            self.set_header('Content-Type', 'application/javascript')
            js_content = FigureManagerWebAgg.get_javascript()

            self.write(js_content)
开发者ID:HDembinski,项目名称:matplotlib,代码行数:5,代码来源:embedding_webagg_sgskip.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python backend_wx._load_bitmap函数代码示例发布时间:2022-05-27
下一篇:
Python backend_tkagg.FigureCanvasTkAgg类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap