pyfolio
pyfolio copied to clipboard
Charts in tearsheet do not show the dateindex

Problem Description
Charts in tearsheet do not show the dateindex
Please provide a minimal, self-contained, and reproducible example:
pf.create_full_tear_sheet(ret, benchmark)
Please provide the full traceback:
no error thrown, screenshot attached
Please provide any additional information below:
Versions
- Pyfolio version: 0.9.2
- Python version: 3.8.2
- Pandas version: 1.0.3
- Matplotlib version: 3.1.3
I have encountered the same problem with the folllowing versions :
Versions
- Pyfolio version: 0.9.2
- Python version: 3.7.6
- Pandas version: 1.0.1
- Matplotlib version: 3.1.3
I have successed to make a workaround by transforming arguments sharex=ax_rolling_returns to sharex=None in all the method subplot() that compose the method create_returns_tear_sheet(). I'm not familiar with matplotlib but maybe it is a good start in order to solve the issue.
if benchmark_rets is not None:
returns = utils.clip_returns_to_benchmark(returns, benchmark_rets)
plotting.show_perf_stats(returns, benchmark_rets,
positions=positions,
transactions=transactions,
turnover_denom=turnover_denom,
bootstrap=bootstrap,
live_start_date=live_start_date,
header_rows=header_rows)
plotting.show_worst_drawdown_periods(returns)
vertical_sections = 11
if live_start_date is not None:
vertical_sections += 1
live_start_date = ep.utils.get_utc_timestamp(live_start_date)
if benchmark_rets is not None:
vertical_sections += 1
if bootstrap:
vertical_sections += 1
fig = plt.figure(figsize=(14, vertical_sections * 6))
gs = gridspec.GridSpec(vertical_sections, 3, wspace=0.5, hspace=0.5)
ax_rolling_returns = plt.subplot(gs[:2, :])
i = 2
ax_rolling_returns_vol_match = plt.subplot(gs[i, :],
sharex=None)
i += 1
ax_rolling_returns_log = plt.subplot(gs[i, :],
sharex=None)
i += 1
ax_returns = plt.subplot(gs[i, :],
sharex=None)
i += 1
if benchmark_rets is not None:
ax_rolling_beta = plt.subplot(gs[i, :], sharex=None)
i += 1
ax_rolling_volatility = plt.subplot(gs[i, :], sharex=None)
i += 1
ax_rolling_sharpe = plt.subplot(gs[i, :], sharex=None)
i += 1
ax_drawdown = plt.subplot(gs[i, :], sharex=None)
i += 1
ax_underwater = plt.subplot(gs[i, :], sharex=None)`