text: # -*- coding: utf-8 -*-
  """Matplotlib.ipynb
  
  Automatically generated by Colaboratory.
  
  Original file is located at
      https://colab.research.google.com/drive/11NQ8suDlDo6DZIJ5GLtbQy1p_Znpggqt
  
  #Matplotlib
  
  Sources of inspiration: W3Schools, check them out :)
  
  Just a basic tutorial for whoever needs it or future me if I need yet another refresher
  """
  
  #import the neccessary modules
  import numpy as np
  import matplotlib.pyplot as plt
  import random
  
  """##Drawing a Line
  
  plot(x, y, color='green', marker='o', linestyle='dashed',
  ...      linewidth=2, markersize=12)
  """
  
  x_axis = np.array([0,6])
  y_axis = np.array([0,250])
  
  #now that we have the x and y axis range
  #we need to actually make the plot
  
  plt.plot(x_axis,y_axis,color='green',marker="*",linestyle="dashed")
  plt.show()
  
  #what if we just want the endpoints?
  
  #we use a secret parameter called: 'o'
  plt.plot(x_axis,y_axis,'o')
  plt.show()
  
  """What if we want to plot a group of points?
  
  (1,1)--(3,4)--(6,7)--(2,5)--(10,8)
  """
  
  x_axis = np.array([1,3,6,8,10]) #we plot the x coordinates
  y_axis = np.array([1,4,7,5,8])  #now we plug in our y coordinates
  plt.plot(x_axis,y_axis,'o') #for the points
  plt.show()
  
  plt.plot(x_axis,y_axis,color='orange')
  plt.show()
  
  """##Parameters
  You can even plot just the y coordinates and plt will know that it will use default x coordinates
  
  Default coordinates start at 0,1,...
  
  Marker = '?' - Used to mark all points
  
  
  ms = an int  - Used to mark the thickness of the point
  
  linestyle = 'dotted'  - used to mark the entire line of a certain type or...
  
  ls = ':' -> which is dotted or ls = '--' -> means dashed
  
  ##Labels and Titles
  
  Label x and y axes in the following manner:
  
  plt.xlabel("x-axis")
  
  plt.ylabel("y-axis")
  
  Give your graph a title in this manner:
  
  plt.title("My title")
  
  Parameters: loc = 'left' -> makes the title left-centered
  
  ##Grid Lines
  
  You can also make grid lines appear right before you show the grpah using the plt.grid(), then use plt.show()
  
  We can only make the horizontal lines appear using the 
  
  plt.grid(axis = 'y')
  
  We can also make the vertical lines only using the:
  
  plt.grid(axis = 'x')
  
  Grid Parameters:
  
  - color: 'some color'
  
  -linestyle = '--'
  
  -line width = 0.5
  """
  
  y = np.array([2,4,6,8,10,12,14,16,18,20])
  
  plt.plot(y,color = 'purple',marker='x',linestyle = 'dashed')
  plt.grid(axis='y',color = 'orange')
  plt.show()
  
  """##SubPlots
  
  What if we want multiple graphs plotted separately??
  
  We can have rows of subplots with respective columns so if we wanted 4 plots, with 2 a row the first subplot would have coordinates 2,2,1
  
  2,2 is the dimensions of the 4 plots and 1 tells me its the first plot
  
  We can use:
  
  plt.subplot(2,2,1)
  
  
  plt.plot(x,y)
  
  
  plt.title("First graph")
  
  So now we have plotted the first of 4 subplots and we can give this subplot a title, color, x and y label like any other plot
  
  We can give all the plots one big title called a super title:
  
  plt.suptitle("All plots")
  """
  
  #plot 1:
  
  x = np.array([0, 1, 2, 3])
  y = np.array([3, 8, 1, 10])
  
  plt.subplot(2, 2, 1)
  plt.plot(x,y)
  plt.xlabel('X axis')
  plt.ylabel('y-axis')
  plt.title("first title")
  
  #plot 2:
  x = np.array([0, 1, 2, 3])
  y = np.array([10, 20, 30, 40])
  
  plt.subplot(2, 2, 2)
  plt.plot(x,y)
  
  #plot3
  x = np.array([1,4,7,10])
  y = np.array([2,5,9,11])
  plt.subplot(2,2,3)
  plt.plot(x,y)
  
  #plot4
  x = np.array([1,4,7,10])
  y = np.array([12,7,3,11])
  plt.subplot(2,2,4)
  plt.plot(x,y)
  
  plt.suptitle("All plots") #the big title
  plt.show() #finish it off
  
  """##Scatterplots
  
  They are like normal lined graphs but they only show the points and not the line
  
  plt.scatter(x,y)
  
  In this case, however, we actually need the x and y arrays
  """
  
  y = np.array([2,4,6,8,10,12,14,16,18,20])
  x = np.array([1,2,3,4,5,6,7,8,9,10])
  
  plt.scatter(x,y,color='green')
  plt.show
  
  """###Parameters in plt.scatter
  
  x - The x axis numpy array
  
  y - The y axis numpy array
  
  
  linewidth - how thick is the line
  
  marker - the way points are shown
  
  color = color of the points
  
  There are many more, but we are looking for the basics
  
  ###Many Graphs in One
  
  We can make multiple scatterplots appear in one single graph by using
  plt.scatter as many times as needed and then apply plt.show to finish it off.
  
  Check out this code courtesy of **W3Schools**
  """
  
  x = np.array([5,7,8,7,2,17,2,9,4,11,12,9,6])
  y = np.array([99,86,87,88,111,86,103,87,94,78,77,85,86])
  plt.scatter(x, y, color = 'hotpink')
  
  x = np.array([2,2,8,1,15,8,12,9,7,3,11,4,7,14,12])
  y = np.array([100,105,84,105,90,99,90,95,94,100,79,112,91,80,85])
  plt.scatter(x, y, color = '#88c999')
  
  plt.show()
  
  """##Bar charts
  
  Just like with scatterplots we can use bar charts which mainly used when working with numeric and qualititative data:
  
  plt.bar(x,y)
  
  ###Vertical Bars
  """
  
  x = np.array(['A','B','C','D'])
  y = np.array([1,5,3,7])
  
  #We actually need the x and y axis 
  plt.bar(x,y)
  plt.show()
  
  """###Horizontal Bars"""
  
  x = np.array(['A','B','C','D'])
  y = np.array([1,5,3,7])
  
  #We actually need the x and y axis 
  plt.barh(x,y)
  plt.show()
  
  """###Parameters
  
  color = 'some color'
  
  
  width = 0.2 - how thick each bar is in vertical mode bar charts
  
  
  height = 0.2 - thickness but for horizontal bar charts
  
  ##Pie charts
  
  Just like the bar charts, we are working with qualititative and quantitative data
  
  Also, just like last time we need to provide the x and y data but instead of calling it x we need to call them labels which  the y values are presenting ans we use the label = argument 
  
  plt.pie(y,labels = [some list])
  """
  
  y = np.array([10,20,25,35,10])
  label = ['apples','peach','bananas','oranges','dragonfruits']
  
  plt.pie(y,labels=label)
  plt.show()
  
  """###Parameters
  
  labels - list of strings
  
  colors = list of colors
  
  shadow = false - draws a shadow, default is false
  
  radius = 2, size of the pie chart and default is 1
  
  center = (x,y) - coordinates of center
  
  counterclock = boolean - true by default and the circle starts  from the x - axis and goes counterclockwise
  """
  
  y = np.array([10,20,25,35,10])
  label = ['pear','peach','bananas','papaya','dragonfruits']
  
  plt.pie(y,labels=label,shadow=True, radius = 2.5)
  plt.show()
  
  """##Histograms
  
  So remember that histograms are like bar charts but the rectangles are stuck together. Histograms are used to show distributions of variable/s. Bar charts are used to compare variables
  
  Histograms are seen as:
  
  plt.hist(x) where x is a distribution of some type like the normal distributuon
  """
  
  x = np.random.normal(loc = 100,scale=10,size = 200)
  #SO we invoke a normal distribution with:
  
  #loc = some mean
  #scale = the st.deviation
  #size = size of array
  
  plt.hist(x,)
  plt.show()
  
  #range  = (min, max) - in x axis range