Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create subplot before plot #5

Open
sen1 opened this issue Apr 30, 2018 · 0 comments
Open

Create subplot before plot #5

sen1 opened this issue Apr 30, 2018 · 0 comments

Comments

@sen1
Copy link

sen1 commented Apr 30, 2018

Capstone/musclehub.py

Lines 377 to 381 in 808f4ed

from matplotlib import pyplot as plt
plt.bar(range(len(app_pivot.ab_test_group)), app_pivot['Percent with Application']*100)
#creating ax object here
ax = plt.subplot()

Wrong order. You should create a subplot first before calling plt.bar. plt.bar creates a subplot by default. If you want it to use your specified one, you should create the subplot and then plot. Since you only have one plot here, you didnt notice any difference. If you had a figure with multiple plots, then you would see plots got misplaced.

ax = plt.subplot() 
plt.bar(range(len(app_pivot.ab_test_group)), app_pivot['Percent with Application']*100) 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant