Skip to content

Commit

Permalink
removing axes from errorbar_kwargs if provided (#708)
Browse files Browse the repository at this point in the history
* removing axes from errorbar_kwargs if provided

* removing pyplot calls if axes is present
  • Loading branch information
j-i-l authored and CamDavidsonPilon committed Apr 13, 2019
1 parent 059b49b commit 225962e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lifelines/fitters/cox_time_varying_fitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ def plot(self, columns=None, **errorbar_kwargs):
"""
from matplotlib import pyplot as plt

ax = errorbar_kwargs.get("ax", None) or plt.figure().add_subplot(111)
ax = errorbar_kwargs.pop("ax", None) or plt.figure().add_subplot(111)

errorbar_kwargs.setdefault("c", "k")
errorbar_kwargs.setdefault("fmt", "s")
Expand All @@ -750,8 +750,9 @@ def plot(self, columns=None, **errorbar_kwargs):

tick_labels = [columns[i] for i in order]

plt.yticks(yaxis_locations, tick_labels)
plt.xlabel("log(HR) (%g%% CI)" % ((1 - self.alpha) * 100))
ax.set_yticks(yaxis_locations)
ax.set_yticklabels(tick_labels)
ax.set_xlabel("log(HR) (%g%% CI)" % ((1 - self.alpha) * 100))

return ax

Expand Down

0 comments on commit 225962e

Please sign in to comment.