本文整理汇总了Python中pythalesians.graphics.graphs.graphproperties.GraphProperties.date_formatter方法的典型用法代码示例。如果您正苦于以下问题:Python GraphProperties.date_formatter方法的具体用法?Python GraphProperties.date_formatter怎么用?Python GraphProperties.date_formatter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pythalesians.graphics.graphs.graphproperties.GraphProperties
的用法示例。
在下文中一共展示了GraphProperties.date_formatter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TimeSeriesRequest
# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import date_formatter [as 别名]
###### calculate seasonal moves in EUR/USD and GBP/USD (using Quandl data)
if True:
time_series_request = TimeSeriesRequest(
start_date = "01 Jan 1970", # start date
finish_date = datetime.date.today(), # finish date
freq = 'daily', # daily data
data_source = 'quandl', # use Quandl as data source
tickers = ['EURUSD', # ticker (Thalesians)
'GBPUSD'],
fields = ['close'], # which fields to download
vendor_tickers = ['FRED/DEXUSEU', 'FRED/DEXUSUK'], # ticker (Quandl)
vendor_fields = ['close'], # which Bloomberg fields to download
cache_algo = 'internet_load_return') # how to return data
ltsf = LightTimeSeriesFactory()
df = ltsf.harvest_time_series(time_series_request)
df_ret = tsc.calculate_returns(df)
day_of_month_seasonality = seasonality.bus_day_of_month_seasonality(df_ret, partition_by_month = False)
day_of_month_seasonality = tsc.convert_month_day_to_date_time(day_of_month_seasonality)
gp = GraphProperties()
gp.date_formatter = '%b'
gp.title = 'FX spot moves by time of year'
gp.scale_factor = 3
gp.file_output = "output_data/20150724 FX spot seas.png"
pf.plot_line_graph(day_of_month_seasonality, adapter='pythalesians', gp = gp)