Skip to content

Commit 712716a

Browse files
committed
BUG Get axis instead of figure.
1 parent c939ceb commit 712716a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyfolio/plotting.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ def plot_max_median_position_concentration(positions, ax=None, **kwargs):
12131213
"""
12141214

12151215
if ax is None:
1216-
ax = plt.gcf()
1216+
ax = plt.gca()
12171217

12181218
alloc_summary = pos.get_max_median_position_concentration(positions)
12191219
colors = ['mediumblue', 'steelblue', 'tomato', 'firebrick']
@@ -1249,7 +1249,7 @@ def plot_sector_allocations(returns, sector_alloc, ax=None, **kwargs):
12491249
"""
12501250

12511251
if ax is None:
1252-
ax = plt.gcf()
1252+
ax = plt.gca()
12531253

12541254
sector_alloc.plot(title='Sector allocation over time',
12551255
alpha=0.5, ax=ax, **kwargs)

0 commit comments

Comments
 (0)