科技美学

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
  90 随笔 :: 0 文章 :: 1 评论 :: 69570 阅读

1.0 edit fontsize

{root}\venv\Lib\site-packages\pyfolio\plotting.py

1
def plotting_context(context='notebook', font_scale=1.0, rc=None):

  line 58, scale the fontsize

 

2.0 edit sheet layout

{root}\venv\Lib\site-packages\pyfolio\tears.py

1
2
3
4
5
6
7
8
9
plt.style.use('classic')
plt.rcParams['font.sans-serif'] = ['Microsoft YaHei']
plt.rcParams.update({'font.size': 8})
fig = plt.figure(figsize=(14, vertical_sections * 6))
gs = gridspec.GridSpec(vertical_sections, 3, wspace=0.5, hspace=0.5)
gs.update(left=0.05, right=0.99, top=0.98, bottom=0.02)
ax_rolling_returns = plt.subplot(gs[:1, :])
 
i = 1

  line 518, change plot layout

 

3.0 change subplot order

1
2
3
4
5
6
ax_return_quantiles = plt.subplot(gs[i, :])
i += 1
ax_monthly_heatmap = plt.subplot(gs[-2:, 0])
ax_annual_returns = plt.subplot(gs[-2:, 1])
ax_monthly_dist = plt.subplot(gs[-2:, 2])
i += 1

  line 541, change order

 

4.0 change heatmap y_label rotation

{root}\venv\Lib\site-packages\pyfolio\plotting.py

1
g.set_yticklabels(g.get_yticklabels(), rotation = 0)

  line 182, add rotation

 

5.0 Complete

 

posted on   chankuang  阅读(50)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
点击右上角即可分享
微信分享提示