graphing with matplotlib pyplot the polyfit(function performs least squares polynomial fit for the data it is given poly class is then created based on the array returned by polyfit(this class is one-dimensional polynomial class it is convenience classused to encapsulate "naturaloperations on polynomials the poly object is then used to generate set of values for use with the set of values for the function pyplot plot(import numpy as np import matplotlib pyplot as pyplot ( ( generate the scatter plot pyplot scatter(xygenerate the trend line np polyfit(xy np poly (zpyplot plot(xp( )' 'display the figure pyplot show( pie charts pie chart is type of graph in which circle is divided into sectors (or wedgesthat each represent proportion of the whole wedge of the circle represents category' contribution to the overall total as such the graph resembles pie that has been cut into different sized slices typicallythe different sectors of the pie chart are presented in different colours and are arranged clockwise around the chart in order of magnitude howeverif there is slice that does not contain unique category of data but summarises severalfor example "other typesor "other answers"then even if it is not the smallest categoryit is usual to display it last in order that it does not detract from the named categories of interest