本文整理汇总了Python中pythalesians.graphics.graphs.graphproperties.GraphProperties.plotly_world_readable方法的典型用法代码示例。如果您正苦于以下问题:Python GraphProperties.plotly_world_readable方法的具体用法?Python GraphProperties.plotly_world_readable怎么用?Python GraphProperties.plotly_world_readable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pythalesians.graphics.graphs.graphproperties.GraphProperties
的用法示例。
在下文中一共展示了GraphProperties.plotly_world_readable方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: g10_plot_gdp_cpi_une
# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import plotly_world_readable [as 别名]
def g10_plot_gdp_cpi_une(self, start_date, finish_date, data_type = 'cpi'):
country_group = 'g10'
if data_type == 'cpi':
df = self.get_CPI_YoY(start_date, finish_date, country_group)
elif data_type == 'gdp':
df = self.get_GDP_YoY(start_date, finish_date, country_group)
elif data_type == 'une':
df = self.get_UNE(start_date, finish_date, country_group)
df = self.hist_econ_data_factory.grasp_coded_entry(df, -1)
from pythalesians.graphics.graphs.plotfactory import PlotFactory
from pythalesians.graphics.graphs.graphproperties import GraphProperties
gp = GraphProperties()
pf = PlotFactory()
gp.plotly_location_mode = 'world'
gp.plotly_choropleth_field = 'Val'
gp.plotly_scope = 'world'
gp.plotly_projection = 'Mercator'
gp.plotly_world_readable = False
gp.plotly_url = country_group + "-" + data_type
gp.title = "G10 " + data_type
gp.units = '%'
pf.plot_generic_graph(df, type = 'choropleth', adapter = 'plotly', gp = gp)
示例2: usa_plot_une
# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import plotly_world_readable [as 别名]
def usa_plot_une(self, start_date, finish_date):
country_group = 'usa-states'; source = 'bloomberg'
une = self.get_UNE(start_date, finish_date, country_group, source = 'bloomberg')
une = self.hist_econ_data_factory.grasp_coded_entry(une, -1)
from pythalesians.graphics.graphs.plotfactory import PlotFactory
from pythalesians.graphics.graphs.graphproperties import GraphProperties
gp = GraphProperties()
pf = PlotFactory()
gp.plotly_location_mode = 'USA-states'
gp.plotly_choropleth_field = 'Val'
gp.plotly_scope = 'usa'
gp.plotly_projection = 'albers usa'
gp.plotly_world_readable = False
gp.plotly_url = country_group + "-unemployment"
gp.title = "USA Unemployment"
gp.units = 'pc'
pf.plot_generic_graph(une, type = 'choropleth', adapter = 'plotly', gp = gp)
示例3: europe_plot_une
# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import plotly_world_readable [as 别名]
def europe_plot_une(self, start_date, finish_date):
country_group = 'all-europe'
une = self.get_UNE(start_date, finish_date, country_group)
une = self.hist_econ_data_factory.grasp_coded_entry(une, -1)
from pythalesians.graphics.graphs.plotfactory import PlotFactory
from pythalesians.graphics.graphs.graphproperties import GraphProperties
gp = GraphProperties()
pf = PlotFactory()
gp.plotly_location_mode = 'europe'
gp.plotly_choropleth_field = 'Val'
gp.plotly_scope = 'europe'
gp.plotly_projection = 'Mercator'
gp.plotly_world_readable = False
gp.plotly_url = country_group + "-unemployment"; gp.title = "Europe Unemployment"
gp.units = '%'
pf.plot_generic_graph(une, type = 'choropleth', adapter = 'plotly', gp = gp)
示例4: world_plot_cpi
# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import plotly_world_readable [as 别名]
def world_plot_cpi(self, start_date, finish_date):
country_group = 'world-liquid'
cpi = self.get_CPI_YoY(start_date, finish_date, country_group)
cpi = self.hist_econ_data_factory.grasp_coded_entry(cpi, -1)
from pythalesians.graphics.graphs.plotfactory import PlotFactory
from pythalesians.graphics.graphs.graphproperties import GraphProperties
gp = GraphProperties()
pf = PlotFactory()
gp.plotly_location_mode = 'world'
gp.plotly_choropleth_field = 'Val'
gp.plotly_scope = 'world'
gp.plotly_projection = 'Mercator'
gp.plotly_world_readable = False
gp.plotly_url = str(country_group) + "-cpi"
gp.title = "World Liquid CPI YoY"
gp.units = '%'
pf.plot_generic_graph(cpi, type = 'choropleth', adapter = 'plotly', gp = gp)
示例5: LightTimeSeriesFactory
# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import plotly_world_readable [as 别名]
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.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.plotly_username = 'thalesians'
gp.plotly_world_readable = True
pf = PlotFactory()
pf.plot_generic_graph(df, type = 'line', adapter = 'pythalesians', gp = gp)
pf.plot_generic_graph(df, type = 'line', adapter = 'cufflinks', gp = gp)
# test simple Plotly bar charts - average differences in EURUSDV1M-1Y vol and USDJPYV1M-1Y slope over past sixth months
if True:
from datetime import timedelta
ltsf = LightTimeSeriesFactory()
end = datetime.datetime.utcnow()
start = end - timedelta(days=180)
tickers = ['EURUSDV1M', 'EURUSDV1Y', 'USDJPYV1M', 'USDJPYV1Y']
vendor_tickers = ['EURUSDV1M BGN Curncy', 'EURUSDV1Y BGN Curncy', 'USDJPYV1M BGN Curncy', 'USDJPYV1Y BGN Curncy']
示例6: GraphProperties
# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import plotly_world_readable [as 别名]
if yoy_ret is True: df = 100 * (df / df.shift(freq) - 1)
df = hist.grasp_coded_entry(df, -1)
from pythalesians.graphics.graphs.plotfactory import PlotFactory
from pythalesians.graphics.graphs.graphproperties import GraphProperties
gp = GraphProperties()
pf = PlotFactory()
gp.plotly_location_mode = 'USA-states'
gp.plotly_choropleth_field = 'Val'
gp.plotly_scope = 'usa'
gp.plotly_projection = 'albers usa'
gp.plotly_url = country_group + data_type.replace(' ', '-')
gp.plotly_world_readable = False
gp.title = title
gp.units = 'Value'
# do a map plot by US state
pf.plot_generic_graph(df, type = 'choropleth', adapter = 'cufflinks', gp = gp)
#### uses CommonEconDataFactory to get more common forms of economic data and plot
####
if True:
logger = LoggerManager.getLogger(__name__)
cedf = CommonEconDataFactory()
start_date = '01 Jan 2014'
finish_date = datetime.datetime.utcnow()