import pandas as pd
import matplotlib.pyplot as plt
import random
%matplotlib inline
rand_Data_x = [random.randrange(4, 100, 1) for i in range(50)]
print(rand_Data_x)
rand_Data_y = [random.randrange(4, 100, 1) for i in range(50)]
print(rand_Data_y)
fig, ax = plt.subplots() # To return a figure and single axes
ax.scatter(rand_Data_x, rand_Data_y, alpha = .25, c = 'k') # Estblishing x and y axes, dot transparency, and dot color.
fig.set_size_inches(13,8) # Setting graph size
fig.suptitle('Demonstration of Scatterplot with Randomness') # Graph Title
ax.xaxis.set_label_text('x-axis Values') # X axis label
ax.yaxis.set_label_text('y-axis Values') # Y axis label
plt.savefig('Scatterplot with Randomness.png')
plt.show() # Displaying the graph in the Jupyter notebook
xTotal = [(rand_Data_x[i],rand_Data_y[i]) for i in range(len(rand_Data_x))]
xTotal.sort(key = lambda x:x[1], reverse=True)
xNumbers = [x[0] for x in xTotal[:6]] #[:6]
Plot = [x[1] for x in xTotal[:6]] #[:6]
fig,ax = plt.subplots()
ax.bar(xNumbers,Plot)
plt.show()