本文整理汇总了Python中pythalesians.graphics.graphs.graphproperties.GraphProperties.linewidth_2方法的典型用法代码示例。如果您正苦于以下问题:Python GraphProperties.linewidth_2方法的具体用法?Python GraphProperties.linewidth_2怎么用?Python GraphProperties.linewidth_2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pythalesians.graphics.graphs.graphproperties.GraphProperties
的用法示例。
在下文中一共展示了GraphProperties.linewidth_2方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_day_of_month_analysis
# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import linewidth_2 [as 别名]
def run_day_of_month_analysis(self, strat):
from pythalesians.economics.seasonality.seasonality import Seasonality
from pythalesians.timeseries.calcs.timeseriescalcs import TimeSeriesCalcs
tsc = TimeSeriesCalcs()
seas = Seasonality()
strat.construct_strategy()
pnl = strat.get_strategy_pnl()
# get seasonality by day of the month
pnl = pnl.resample('B').mean()
rets = tsc.calculate_returns(pnl)
bus_day = seas.bus_day_of_month_seasonality(rets, add_average = True)
# get seasonality by month
pnl = pnl.resample('BM').mean()
rets = tsc.calculate_returns(pnl)
month = seas.monthly_seasonality(rets)
self.logger.info("About to plot seasonality...")
gp = GraphProperties()
pf = PlotFactory()
# Plotting spot over day of month/month of year
gp.color = 'Blues'
gp.scale_factor = self.scale_factor
gp.file_output = self.DUMP_PATH + strat.FINAL_STRATEGY + ' seasonality day of month.png'
gp.title = strat.FINAL_STRATEGY + ' day of month seasonality'
gp.display_legend = False
gp.color_2_series = [bus_day.columns[-1]]
gp.color_2 = ['red'] # red, pink
gp.linewidth_2 = 4
gp.linewidth_2_series = [bus_day.columns[-1]]
gp.y_axis_2_series = [bus_day.columns[-1]]
pf.plot_line_graph(bus_day, adapter = 'pythalesians', gp = gp)
gp = GraphProperties()
gp.scale_factor = self.scale_factor
gp.file_output = self.DUMP_PATH + strat.FINAL_STRATEGY + ' seasonality month of year.png'
gp.title = strat.FINAL_STRATEGY + ' month of year seasonality'
pf.plot_line_graph(month, adapter = 'pythalesians', gp = gp)
return month
示例2: g10_line_plot_cpi
# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import linewidth_2 [as 别名]
def g10_line_plot_cpi(self, start_date, finish_date):
today_root = datetime.date.today().strftime("%Y%m%d") + " "
country_group = 'g10-ez'
cpi = self.get_CPI_YoY(start_date, finish_date, country_group)
from pythalesians.graphics.graphs.plotfactory import PlotFactory
from pythalesians.graphics.graphs.graphproperties import GraphProperties
gp = GraphProperties()
pf = PlotFactory()
gp.title = "G10 CPI YoY"
gp.units = '%'
gp.scale_factor = 3
gp.file_output = today_root + 'G10 CPI YoY ' + str(gp.scale_factor) + '.png'
cpi.columns = [x.split('-')[0] for x in cpi.columns]
gp.linewidth_2 = 3
gp.linewidth_2_series = ['United States']
pf.plot_generic_graph(cpi, type = 'line', adapter = 'pythalesians', gp = gp)
示例3: g10_line_plot_une
# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import linewidth_2 [as 别名]
def g10_line_plot_une(self, start_date, finish_date):
today_root = datetime.date.today().strftime("%Y%m%d") + " "
country_group = 'g10-ez'
une = self.get_UNE(start_date, finish_date, country_group)
from pythalesians.graphics.graphs.plotfactory import PlotFactory
from pythalesians.graphics.graphs.graphproperties import GraphProperties
gp = GraphProperties()
pf = PlotFactory()
gp.title = "G10 Unemployment Rate (%)"
gp.units = '%'
gp.scale_factor = Constants.plotfactory_scale_factor
gp.file_output = today_root + 'G10 UNE ' + str(gp.scale_factor) + '.png'
une.columns = [x.split('-')[0] for x in une.columns]
gp.linewidth_2 = 3
gp.linewidth_2_series = ['United States']
pf.plot_generic_graph(une, type = 'line', adapter = 'pythalesians', gp = gp)
示例4: g10_line_plot_gdp
# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import linewidth_2 [as 别名]
def g10_line_plot_gdp(self, start_date, finish_date):
today_root = datetime.date.today().strftime("%Y%m%d") + " "
country_group = 'g10-ez'
gdp = self.get_GDP_QoQ(start_date, finish_date, country_group)
from pythalesians.graphics.graphs.plotfactory import PlotFactory
from pythalesians.graphics.graphs.graphproperties import GraphProperties
gp = GraphProperties()
pf = PlotFactory()
gp.title = "G10 GDP"
gp.units = 'Rebased'
gp.scale_factor = Constants.plotfactory_scale_factor
gp.file_output = today_root + 'G10 UNE ' + str(gp.scale_factor) + '.png'
gdp.columns = [x.split('-')[0] for x in gdp.columns]
gp.linewidth_2 = 3
gp.linewidth_2_series = ['United Kingdom']
from pythalesians.timeseries.calcs.timeseriescalcs import TimeSeriesCalcs
tsc = TimeSeriesCalcs()
gdp = gdp / 100
gdp = tsc.create_mult_index_from_prices(gdp)
pf.plot_generic_graph(gdp, type = 'line', adapter = 'pythalesians', gp = gp)
示例5: EventStudy
# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import linewidth_2 [as 别名]
df_event_times.index = df_event_times.index.tz_localize(utc_time) # work in UTC time
from pythalesians.economics.events.eventstudy import EventStudy
es = EventStudy()
# work out cumulative asset price moves moves over the event
df_event = es.get_intraday_moves_over_custom_event(df, df_event_times)
# create an average move
df_event['Avg'] = df_event.mean(axis = 1)
# plotting spot over economic data event
gp = GraphProperties()
gp.scale_factor = 3
gp.title = 'USDJPY spot moves over recent NFP'
# plot in shades of blue (so earlier releases are lighter, later releases are darker)
gp.color = 'Blues'; gp.color_2 = []
gp.y_axis_2_series = []
gp.display_legend = False
# last release will be in red, average move in orange
gp.color_2_series = [df_event.columns[-2], df_event.columns[-1]]
gp.color_2 = ['red', 'orange'] # red, pink
gp.linewidth_2 = 2
gp.linewidth_2_series = gp.color_2_series
pf = PlotFactory()
pf.plot_line_graph(df_event * 100, adapter = 'pythalesians', gp = gp)