Scatter(year,profit,color='r',marker='d')Ĭlear the plot window by typing clf parentheses and press Enter Plot a scatter plot of same data in company hyphen a hyphen data dot txt with red diamond markers. Pause the video here, try out the following exercise and resume the video. Second, the values in y-coordinate, the profit percentages. Notice that we passed two arguments to scatter() function.įirst one being the values in x-coordinate that is year. Type scatter within parentheses year comma profit and press Enter. Let us use scatter function to plot scatter graph for data stored in year and profit. y is a sequence of data having the same length of x.Syntax: scatter within parentheses x comma y Scatter() function is used to generate the scatter graph
Unpack equal to True returns the transposed array of data Year comma profit equal to loadtxt within parentheses within single quotes company hyphen a hyphen data dot txt after single quotes comma unpack equal to True and Press Enter We first need to load the data from the file using loadtxt command. Year, profit = loadtxt('company-a-data.txt', unpack = True) And the second column represents the profit percentage. The data file has two columns with a set of values in each column. Let us see the content of the file company hyphen a hyphen data dot txt.Ĭat company hyphen a hyphen data dot txt.
#PYLAB DOWNLOAD PYTHON 3.4 CODE#
#PYLAB DOWNLOAD PYTHON 3.4 HOW TO#
To practice this tutorial, you should know how to If not, see the relevant Python tutorials on