pzivich / zEpid

Epidemiology analysis package
http://zepid.readthedocs.org
MIT License
141 stars 33 forks source link

improving _plotter function to use errorbars and kwargs better #50

Closed CamDavidsonPilon closed 5 years ago

CamDavidsonPilon commented 5 years ago

This PR refactors _plotter to use errorbars and sets defaults. I think this is the abstraction you want.

Using your test code:

import matplotlib.pyplot as plt
import zepid as ze

df = ze.load_sample_data(False)

rd = ze.RiskDifference()
rd.fit(df, exposure='art', outcome='dead')

rd.plot(marker='*', markersize=20, color='r')  # Custom markers
plt.show()

we get nice pictures: screen shot 2018-12-17 at 1 23 45 pm

I've also confirmed this works for >2 groups.