top of page

Portfolio 1 Week 4: Plotting graphs using Jupyter notebook

  • Writer: J J
    J J
  • Nov 10, 2019
  • 2 min read

Updated: Nov 29, 2019

While doing this week's practical, I tried to understand how to plot graphs using the normal python idle, and I face the issue of not having the libraries needed, which made me realised that I need to use the pip install command to get the libraries needed before I can import them into my python file. in the beginning, I tried to just use the 'pip install (library)' but it did not work on the command prompt. but after some research, I realised that my issue was that I did not change the directory of the command prompt before trying to use 'pip'.

As for the plotting of graphs using the Jupyter notebook using the matplotlib, I have learnt how to use various functions such as plt.plot(), as well as the values which are placed into the parameters to change the graph. I have also learnt to use the library numpy which is useful for calculating values in python. As for the plotting, information such as the x and y-axis names can be set, along with the graph format, and that by using plt.' type of graph'() function where the type of graph can be changed to things like a bar or a scattered graph.' different lines can also be combined into one graph, such as having 2 straight lines plotted on the same graph, colours of the lines as well as thickness along with a legend can be added.









The axis of the graph can also be set by putting values into the parameters for plt.axis(), and other things can also be modified, such as adding grids to the graph.

there are somethings that I did not understand in this practical, such as the formula used for making the best fit line using beta and alpha values. but I did learn of how numpy.arange() is used, and how it returns a list of numbers which are evenly spaced out within a specific range. But from the best fit line, we can get predictions for the Y value given the X value, and this can be used for further projects which require linear regression.

Recent Posts

See All

Comments


Post: Blog2_Post

©2019 by JiongJie. Proudly created with Wix.com

bottom of page