<jupyter_start><jupyter_text>Matplotlib Tutorial: Bar Chart<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np<jupyter_output><empty_output><jupyter_text>Simple bar chart showing revenues of major US tech companies<jupyter_code>company=['GOOGL','AMZN','MSFT','FB']
revenue=[90,136,89,27]
xpos = np.arange(len(company))
xpos
plt.bar(xpos,revenue, label="Revenue")

plt.xticks(xpos,company)
plt.ylabel("Revenue(Bln)")
plt.title('US Technology Stocks')
plt.legend()<jupyter_output><empty_output><jupyter_text>Multiple Bars showing revenue and profit of major US tech companies<jupyter_code>profit=[40,2,34,12]
plt.bar(xpos-0.2,revenue, width=0.4, label="Revenue")
plt.bar(xpos+0.2,profit, width=0.4,label="Profit")

plt.xticks(xpos,company)
plt.ylabel("Revenue(Bln)")
plt.title('US Technology Stocks')
plt.legend()<jupyter_output><empty_output><jupyter_text>Horizontal bar chart using barh function<jupyter_code>plt.barh(xpos,revenue, label="Revenue")

plt.yticks(xpos,company)
plt.ylabel("Revenue(Bln)")
plt.title('US Technolog Stocks')
plt.legend()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.151487826871055, 'fraction_numerical': 0.02164111812443643, 'mean_word_length': 10.808510638297872, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '26739', 'license': 'MIT', 'n_tokens_mistral': 465, 'n_tokens_neox': 431, 'n_words': 67, 'path': "Program's_Contributed_By_Contributors/AI-Summer-Course/py-master/matpltlib/4_bar_chart/4_bar_chart.ipynb", 'repo_name': 'siddharthdeo99/Hacktoberfest2k21', 'size': '1109'}