<jupyter_start><jupyter_text>_Lambda School Data Science_ Choose appropriate visualizationsRecreate this [example by FiveThirtyEight:](https://fivethirtyeight.com/features/al-gores-new-movie-exposes-the-big-flaw-in-online-movie-ratings/)<jupyter_code>!pip install --upgrade seaborn
from IPython.display import display, Image

url = 'https://fivethirtyeight.com/wp-content/uploads/2017/09/mehtahickey-inconvenient-0830-1.png'
example = Image(url=url, width=400)

display(example)<jupyter_output><empty_output><jupyter_text>Using this data:https://github.com/fivethirtyeight/data/tree/master/inconvenient-sequel Stretch goalsRecreate more examples from [FiveThityEight's shared data repository](https://data.fivethirtyeight.com/).For example:- [thanksgiving-2015](https://fivethirtyeight.com/features/heres-what-your-part-of-america-eats-on-thanksgiving/) ([`altair`](https://altair-viz.github.io/gallery/index.htmlmaps))- [candy-power-ranking](https://fivethirtyeight.com/features/the-ultimate-halloween-candy-power-ranking/) ([`statsmodels`](https://www.statsmodels.org/stable/index.html))<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd


plt.style.use('fivethirtyeight')

fake = pd.Series([38, 3, 2, 1, 2, 4, 6, 5, 5, 33], 
                 index=range(1,11))

fake.plot.bar(color='#EC713B', width=0.9);
plt.style.use('fivethirtyeight')

fake = pd.Series([38, 3, 2, 1, 2, 4, 6, 5, 5, 33], 
                 index=range(1,11))

ax = fake.plot.bar(color='#EC713B', width=0.9)

ax.set(xlabel='Rating', 
       ylabel='Percent of total votes', 
       yticks=range(0,50,10))

ax.text(x=-2, y=50, s="'An Inconvenient Sequel: Truth to Power' is divisive", 
        fontsize=16, fontweight='bold')

ax.text(x=-2, y=46, s="IMDb ratings for the film as of Aug. 29")

ax.tick_params(labelrotation=0)
display(example)
df = pd.read_csv('https://raw.githubusercontent.com/fivethirtyeight/data/master/inconvenient-sequel/ratings.csv')
df.shape
width, height = df.shape
width * height
df.head()
pd.options.display.max_columns = None
df.sample(1).T
df.timestamp = pd.to_datetime(df.timestamp)
df.timestamp.describe()
df.set_index('timestamp', inplace=True)
df['2017-08-29']
df.category.value_counts()
df.link.value_counts()
df[df.category=='IMDb users']
lastday = df['2017-08-29']
lastday[lastday.category=='IMDb users'].respondents.plot();
final = df.tail(1)
columns = ['1_pct', '2_pct', '3_pct', '4_pct', '5_pct', 
           '6_pct', '7_pct', '8_pct', '9_pct', '10_pct']

final[columns]
data = final[columns].T
data.index = range(1, 11)
data
colors = ['#333333'] * 10
colors[0] = '#EC713B'
colors[-1] = '#EC713B'

colors

plt.style.use('fivethirtyeight')

ax = data.plot(kind = 'bar', color=colors, width=0.9, legend=False)
ax.set_facecolor('white')
xlabel = plt.xlabel('Rating', fontsize = 10.25, fontweight = 'bold')
ylabel = plt.ylabel('Percent of total votes', fontsize = 10.25, fontweight = 'bold') 
ax.set(yticks = range(0, 50, 10))
ax.set(yticklabels = (' 0 ', ' 10 ', ' 20 ', ' 30 ', '40%'))

ax.text(x=-1.75, y=49, s="'An Inconvenient Sequel: Truth to Power' is divisive", 
        fontsize=13.3, fontweight='bold')

ax.text(x=-1.75, y=46, s="IMDb ratings for the film as of Aug. 29",
       fontsize = 11.5)

ax.text(x = -1.75, y = -7, s = "________________________________________________________________________________",
       fontsize = 10, color = 'blue')

ax.text(x=-1.75, y=-9, s="FiveThirtyEight", fontsize = 8.5, color = 'blue', fontweight = 'light')

ax.text(x = 8, y=-9, s="SOURCE:IMDB", fontsize = 7, color = 'blue', fontweight = 'light')

coord_x1 = 0
coord_y1 = 40

coord_x2 = 10
coord_y2 = 40

plt.plot([coord_x1, coord_x2], [coord_y1, coord_y1], linewidth = .1, color ='grey')

ax.tick_params(labelrotation=0, colors = 'grey')
#how do you change this background color??  Nothing i tried worked :/
display(example)
ex2 = 'https://fivethirtyeight.com/wp-content/uploads/2017/09/methahickey-inconvenient-0830-6.png?w=575'
example2 = Image(url =ex2, width=400)
display(example2)
df.head()
import seaborn as sns
sns.__version__
display(example2)
df.<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1715319662243667, 'fraction_numerical': 0.052593486127864894, 'mean_word_length': 5.0, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 10, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '483894', 'license': 'MIT', 'n_tokens_mistral': 1722, 'n_tokens_neox': 1558, 'n_words': 302, 'path': 'Copy_of_LS_DS_123_Make_explanatory_visualizations_LESSON.ipynb', 'repo_name': 'veritaem/DS-Sprint-01-Dealing-With-Data', 'size': '4145'}