Skip to content

Commit

Permalink
STY: trailing comma, variable naming, imports
Browse files Browse the repository at this point in the history
  • Loading branch information
vikram-narayan committed Sep 13, 2017
1 parent a17f5b9 commit cd3a1df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 5 additions & 5 deletions pyfolio/perf_attrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def show_perf_attrib_stats(returns, positions, factor_returns,
positions,
factor_returns,
factor_loadings,
pos_in_dollars=pos_in_dollars
pos_in_dollars=pos_in_dollars,
)

perf_attrib_stats = create_perf_attrib_stats(perf_attrib_data)
Expand Down Expand Up @@ -270,8 +270,8 @@ def plot_factor_contribution_to_perf(perf_attrib_data, ax=None):
factors_and_specific = perf_attrib_data.drop(
['total_returns', 'common_returns'], axis='columns')

for s in factors_and_specific:
ax.plot(factors_and_specific[s])
for col in factors_and_specific:
ax.plot(factors_and_specific[col])

ax.axhline(0, color='k')
set_legend_location(ax)
Expand Down Expand Up @@ -304,8 +304,8 @@ def plot_risk_exposures(exposures, ax=None):
if ax is None:
ax = plt.gca()

for s in exposures:
ax.plot(exposures[s])
for col in exposures:
ax.plot(exposures[col])

set_legend_location(ax)
ax.set_ylabel('Factor exposures')
Expand Down
4 changes: 1 addition & 3 deletions pyfolio/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import warnings

from cycler import cycler
import numpy as np
import pandas as pd
from IPython.display import display
Expand Down Expand Up @@ -624,8 +623,7 @@ def set_legend_location(ax, autofmt_xdate=True):
ax.legend(frameon=True, framealpha=0.5, loc='upper left',
bbox_to_anchor=(1.05, 1))

color_cycle = cycler('color', COLORS)
ax.set_prop_cycle(color_cycle)
ax.set_prop_cycle('color', COLORS)

if autofmt_xdate:
ax.figure.autofmt_xdate()

0 comments on commit cd3a1df

Please sign in to comment.