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


Python GraphProperties.html_file_output方法代码示例

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


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

示例1: ticker

# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import html_file_output [as 别名]
                finish_date = datetime.date.today(),            # finish date
                freq = 'daily',                                 # daily data
                data_source = 'google',                         # use Bloomberg as data source
                tickers = ['Apple', 'S&P500 ETF'],                  # ticker (Thalesians)
                fields = ['close'],                                 # which fields to download
                vendor_tickers = ['aapl', 'spy'],                   # ticker (Google)
                vendor_fields = ['Close'],                          # which Bloomberg fields to download
                cache_algo = 'internet_load_return')                # how to return data

    ltsf = LightTimeSeriesFactory()
    tsc = TimeSeriesCalcs()

    df = tsc.create_mult_index_from_prices(ltsf.harvest_time_series(time_series_request))

    gp = GraphProperties()
    gp.html_file_output = "output_data/apple.htm"
    gp.title = "S&P500 vs Apple"

    # plot first with PyThalesians and then Bokeh
    # just needs 1 word to change
    gp.display_legend = False

    pf = PlotFactory()
    pf.plot_generic_graph(df, type = 'line', adapter = 'pythalesians', gp = gp)
    pf.plot_generic_graph(df, type = 'line', adapter = 'bokeh', gp = gp)

# test simple Bokeh bar charts - monthly returns over past 6 months
if True:
    from datetime import timedelta
    ltsf = LightTimeSeriesFactory()
开发者ID:BryanFletcher,项目名称:pythalesians,代码行数:32,代码来源:bokeh_examples.py

示例2: ticker

# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import html_file_output [as 别名]
                data_source = 'bloomberg',                      # use Bloomberg as data source
                tickers = tickers,                              # ticker (Thalesians)
                fields = ['close'],                             # which fields to download
                vendor_tickers = vendor_tickers,                # ticker (Bloomberg)
                vendor_fields = ['PX_LAST'],                    # which Bloomberg fields to download
                cache_algo = 'internet_load_return')                # how to return data

        daily_vals = ltsf.harvest_time_series(time_series_request)

        pf = PlotFactory()

        gp = GraphProperties()

        gp.title = 'Spot values'
        gp.file_output = 'demo.png'
        gp.html_file_output = 'demo.htm'
        gp.source = 'Thalesians/BBG'

        # plot using PyThalesians
        pf.plot_line_graph(daily_vals, adapter = 'pythalesians', gp = gp)

        # plot using Bokeh (still needs a lot of work!)
        pf.plot_line_graph(daily_vals, adapter = 'bokeh', gp = gp)

    # do more complicated charts using several different Matplotib stylesheets (which have been customised)
    if True:
        ltsf = LightTimeSeriesFactory()

        # load market data
        start = '01 Jan 1970'
        end = datetime.datetime.utcnow()
开发者ID:quantcruncher,项目名称:pythalesians,代码行数:33,代码来源:plotfactory_examples.py

示例3: TimeSeriesRequest

# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import html_file_output [as 别名]
if True:

    time_series_request = TimeSeriesRequest(
                start_date = "01 Jan 2013",                     # start date
                finish_date = datetime.date.today(),            # finish date
                freq = 'daily',                                 # daily data
                data_source = 'google',                         # use Bloomberg as data source
                tickers = ['Apple', 'S&P500 ETF'],                  # ticker (Thalesians)
                fields = ['close'],                                 # which fields to download
                vendor_tickers = ['aapl', 'spy'],                   # ticker (Google)
                vendor_fields = ['Close'],                          # which Bloomberg fields to download
                cache_algo = 'internet_load_return')                # how to return data

    ltsf = LightTimeSeriesFactory()
    tsc = TimeSeriesCalcs()

    df = tsc.create_mult_index_from_prices(ltsf.harvest_time_series(time_series_request))

    gp = GraphProperties()
    gp.html_file_output = "apple.htm"
    gp.title = "S&P500 vs Apple"

    # plot first with PyThalesians and then Plotly (via Cufflinks)
    # just needs 1 word to change
    # (although, note that AdapterCufflinks does have some extra parameters that can be set in
    # GraphProperties)
    gp.display_legend = False

    pf = PlotFactory()
    pf.plot_generic_graph(df, type = 'line', adapter = 'pythalesians', gp = gp)
    pf.plot_generic_graph(df, type = 'line', adapter = 'bokeh', gp = gp)
开发者ID:CARLOSMANZUETA2000,项目名称:pythalesians,代码行数:33,代码来源:bokeh_examples.py

示例4: ticker

# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import html_file_output [as 别名]
            tickers=tickers,  # ticker (Thalesians)
            fields=["close"],  # which fields to download
            vendor_tickers=vendor_tickers,  # ticker (Bloomberg)
            vendor_fields=["PX_LAST"],  # which Bloomberg fields to download
            cache_algo="internet_load_return",
        )  # how to return data

        daily_vals = ltsf.harvest_time_series(time_series_request)

        pf = PlotFactory()

        gp = GraphProperties()

        gp.title = "Spot values"
        gp.file_output = "output_data/demo.png"
        gp.html_file_output = "output_data/demo.htm"
        gp.source = "Thalesians/BBG"

        # plot using PyThalesians
        pf.plot_line_graph(daily_vals, adapter="pythalesians", gp=gp)

        # plot using Bokeh (still needs a lot of work!)
        pf.plot_line_graph(daily_vals, adapter="bokeh", gp=gp)

    # do more complicated charts using several different Matplotib stylesheets (which have been customised)
    if False:
        ltsf = LightTimeSeriesFactory()

        # load market data
        start = "01 Jan 1970"
        end = datetime.datetime.utcnow()
开发者ID:swaraj007,项目名称:pythalesians,代码行数:33,代码来源:plotfactory_examples.py


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