Skip to content

Instantly share code, notes, and snippets.

@brockmanmatt
Created October 13, 2019 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brockmanmatt/c4b7adff99faca390777154e48b2ddce to your computer and use it in GitHub Desktop.
Save brockmanmatt/c4b7adff99faca390777154e48b2ddce to your computer and use it in GitHub Desktop.
myCountries = ["dprk", "ukraine", "russia", "iran", "china"]
fig, axs = plt.subplots(1,5, sharey=True, gridspec_kw={'wspace': 0})
fig.set_facecolor("white")
fig.set_size_inches(24,6)
idx = 0
for country in myCountries:
tmp = time_series[[x for x in time_series.columns if (x.find(country) > -1) ]]
tmp.rename(columns={country:(country+" search")}).plot(style=[":" if not x.startswith(country) else "-" for x in tmp], title="{}".format(country), ylim=(0, 100), ax=axs[idx])
idx+=1
axs[0].set_ylabel("Articles/Day or % Greatest Search in Selection/Day")
fig.suptitle("Google Search and News Coverage on Countries\n(Search as percent of greatest amount of search for any country)", y=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment