Advertisement
Guest User

Untitled

a guest
May 21st, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. fig, axes = plt.subplots(nrows=2, ncols=2)
  2. ax0, ax1, ax2, ax3 = axes.flat
  3.  
  4. ax0.hist(tweets["red"])
  5. ax0.set_title('Red in backgrounds')
  6.  
  7. ax1.hist(tweets["red"][tweets["candidate"] == "trump"].values)
  8. ax1.set_title('Red in Trump tweeters')
  9.  
  10. ax2.hist(tweets["blue"])
  11. ax2.set_title('Blue in backgrounds')
  12.  
  13. ax3.hist(tweets["blue"][tweets["candidate"] == "trump"].values)
  14. ax3.set_title('Blue in Trump tweeters')
  15. plt.tight_layout()
  16. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement