Difference between revisions of "Python-3.4.3/C2/Other-Types-Of-Plots/English"
Pratham920 (Talk | contribs) (Created page with "'''lPython/C2/Other-types-of-plots/English''''''Title of script''': '''Other types of plots. ''' '''Author: Anoop Jacob Thomas, Thirumalesh H S''' '''Keywords: Python, IPyth...") |
Nancyvarkey (Talk | contribs) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | '''lPython/C2/Other-types-of-plots/English''''''Title of script''': '''Other types of plots. ''' | + | '''lPython/C2/Other-types-of-plots/English''' |
+ | |||
+ | |||
+ | '''Title of script''': '''Other types of plots. ''' | ||
'''Author: Anoop Jacob Thomas, Thirumalesh H S''' | '''Author: Anoop Jacob Thomas, Thirumalesh H S''' | ||
'''Keywords: Python, IPython, pylab, scatter plot, loglog plot, video tutorial''' | '''Keywords: Python, IPython, pylab, scatter plot, loglog plot, video tutorial''' | ||
− | |||
Line 13: | Line 15: | ||
|- | |- | ||
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show slide | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show slide | ||
− | |||
− | |||
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Hello friends. Welcome to the tutorial on '''Other types of plots''' | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Hello friends. Welcome to the tutorial on '''Other types of plots''' | ||
Line 25: | Line 25: | ||
* Create '''scatter plot''' | * Create '''scatter plot''' | ||
* Create''' log-log plots''' | * Create''' log-log plots''' | ||
− | |||
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| At the end of this tutorial, you will be able to - | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| At the end of this tutorial, you will be able to - | ||
Line 31: | Line 30: | ||
* Create '''scatter plot''' | * Create '''scatter plot''' | ||
* Create''' log-log plots''' | * Create''' log-log plots''' | ||
− | |||
− | |||
|- | |- | ||
Line 43: | Line 40: | ||
* '''Python 3.4.3''' | * '''Python 3.4.3''' | ||
* '''IPython 5.1.0''' | * '''IPython 5.1.0''' | ||
− | |||
− | |||
|- | |- | ||
Line 56: | Line 51: | ||
If not, see the relevant '''Python''' tutorials on http://spoken-tutorial.org | If not, see the relevant '''Python''' tutorials on http://spoken-tutorial.org | ||
− | |||
− | |||
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| To practice this tutorial, you should know how to | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| To practice this tutorial, you should know how to | ||
Line 71: | Line 64: | ||
'''ipython3''' | '''ipython3''' | ||
− | |||
− | |||
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us first open the '''Terminal '''by pressing '''Ctrl+Alt+T '''keys simultaneously. | | style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us first open the '''Terminal '''by pressing '''Ctrl+Alt+T '''keys simultaneously. | ||
− | |||
Now, type '''ipython3''' and press '''Enter'''. | Now, type '''ipython3''' and press '''Enter'''. | ||
Line 85: | Line 75: | ||
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us initialise the '''pylab''' package. | | style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us initialise the '''pylab''' package. | ||
− | + | Type ''percent '''''pylab '''and press''' Enter.''' | |
− | Type ''' | + | |
|- | |- | ||
Line 93: | Line 82: | ||
'''Scatter plot''' | '''Scatter plot''' | ||
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| In a '''scatter''' '''plot''', the data is displayed as a collection of points. | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| In a '''scatter''' '''plot''', the data is displayed as a collection of points. | ||
− | |||
Each point determines its position on the x and y axes | Each point determines its position on the x and y axes | ||
− | |||
− | |||
− | |||
|- | |- | ||
Line 104: | Line 89: | ||
Exercise 1 | Exercise 1 | ||
− | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| * Plot a '''scatter''' '''plot''' showing the percentage profit of a company A from the year 2000 | + | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| |
+ | * Plot a '''scatter''' '''plot''' showing the percentage profit of a company A from the year 2000 to 2010. | ||
− | * The data for the same is available in the '''file''' '''company | + | * The data for the same is available in the '''file''' '''company '''''hyphen '''''a '''''hyphen '''''data '''''dot '''''txt'''. |
− | * '''company | + | * '''company '''''hyphen '''''a '''''hyphen '''''data '''''dot '''''txt''' file is available in the code file link of this tutorial. |
* Please download and use it. | * Please download and use it. | ||
− | |||
− | |||
|- | |- | ||
Line 118: | Line 102: | ||
cat '''company-a-data.txt''' | cat '''company-a-data.txt''' | ||
− | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Let us see the content of the file '''company | + | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Let us see the content of the file '''company '''''hyphen '''''a '''''hyphen '''''data '''''dot '''''txt'''. |
+ | So type, | ||
− | '''cat company | + | '''cat company '''''hyphen '''''a '''''hyphen '''''data '''''dot '''''txt'''.''' '''and''' press Enter''' |
|- | |- | ||
Line 127: | Line 112: | ||
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| The data file has two columns with a set of values in each column. | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| The data file has two columns with a set of values in each column. | ||
− | + | The first column represents the years. And the second column represents the profit percentage. | |
− | The column | + | |
|- | |- | ||
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [IPython Terminal] | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [IPython Terminal] | ||
− | |||
'''year, profit = loadtxt('company-a-data.txt', unpack = True)''' | '''year, profit = loadtxt('company-a-data.txt', unpack = True)''' | ||
− | |||
− | |||
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| To produce the scatter plot, | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| To produce the scatter plot, | ||
− | |||
we first need to load the data from the file using '''loadtxt''' command. | we first need to load the data from the file using '''loadtxt''' command. | ||
Line 145: | Line 125: | ||
Type | Type | ||
− | + | '''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''' | |
− | '''year '''''comma''''' profit '''''equal to''''' loadtxt '''''within parentheses within single quotes '''''company | + | |
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
Line 159: | Line 135: | ||
'''scatter()''' function | '''scatter()''' function | ||
− | |||
− | |||
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| '''scatter() function''' is used to generate the '''scatter''' '''graph''' | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| '''scatter() function''' is used to generate the '''scatter''' '''graph''' | ||
− | |||
Syntax: '''scatter '''''within parentheses '''''x '''''comma '''''y''' | Syntax: '''scatter '''''within parentheses '''''x '''''comma '''''y''' | ||
* '''x '''is''' '''a sequence of data | * '''x '''is''' '''a sequence of data | ||
− | * '''y '''is''' '''a sequence of data having same length of '''x''' | + | * '''y '''is''' '''a sequence of data having the same length of '''x''' |
− | + | ||
− | + | ||
|- | |- | ||
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [IPython Terminal] | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [IPython Terminal] | ||
− | |||
'''scatter(year, profit)''' | '''scatter(year, profit)''' | ||
− | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Let us use '''scatter | + | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Let us use '''scatter function '''to '''plot scatter graph '''for data stored in '''year '''and''' profit. ''' |
− | + | ||
Type '''scatter '''''within parentheses''''' year '''''comma''''' profit''' and press '''Enter.''' | Type '''scatter '''''within parentheses''''' year '''''comma''''' profit''' and press '''Enter.''' | ||
− | |||
Notice that we passed two arguments to '''scatter() '''function. | Notice that we passed two arguments to '''scatter() '''function. | ||
− | First one being the values in x-coordinate | + | First one being the values in x-coordinate that is '''year.''' |
− | + | ||
Second, the values in y-coordinate, the '''profit''' '''percentages'''. | Second, the values in y-coordinate, the '''profit''' '''percentages'''. | ||
Line 195: | Line 162: | ||
Exercise | Exercise | ||
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Pause the video here, try out the following exercise and resume the video. | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Pause the video here, try out the following exercise and resume the video. | ||
− | |||
Read the documentation of scatter. | Read the documentation of scatter. | ||
− | '''Plot''' a scatter plot of same data in '''company | + | '''Plot''' a scatter plot of same data in '''company '''''hyphen '''''a '''''hyphen '''''data '''''dot '''''txt''' with red diamond markers. |
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
Line 212: | Line 175: | ||
'''scatter(year,profit,color='r',marker='d')''' | '''scatter(year,profit,color='r',marker='d')''' | ||
− | |||
− | |||
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Solution to Exercise | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Solution to Exercise | ||
− | |||
Clear the '''plot window '''by typing '''clf parentheses '''and press '''Enter''' | Clear the '''plot window '''by typing '''clf parentheses '''and press '''Enter''' | ||
− | |||
Now type | Now type | ||
Line 228: | Line 187: | ||
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show plot window | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show plot window | ||
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Thus, we got our scatter plot. | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Thus, we got our scatter plot. | ||
− | |||
Now let us see another kind of plot. | Now let us see another kind of plot. | ||
Line 237: | Line 195: | ||
'''log-log '''graph | '''log-log '''graph | ||
− | + | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| | |
− | + | * A '''log-log plot''' is a two-dimensional graph of numerical data. | |
− | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| * A '''log-log plot''' is a two-dimensional graph of numerical data. | + | |
* It uses '''logarithmic''' '''scales''' on both '''axes'''. | * It uses '''logarithmic''' '''scales''' on both '''axes'''. | ||
* Graph appears as straight line due to non-linear scaling | * Graph appears as straight line due to non-linear scaling | ||
− | |||
− | |||
|- | |- | ||
Line 249: | Line 204: | ||
'''loglog() function''' | '''loglog() function''' | ||
− | |||
− | |||
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| '''Syntax''' | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| '''Syntax''' | ||
Line 258: | Line 211: | ||
* '''x '''is''' '''a sequence of data | * '''x '''is''' '''a sequence of data | ||
* '''y '''is''' '''a sequence of data, having the same length of '''x''' | * '''y '''is''' '''a sequence of data, having the same length of '''x''' | ||
− | |||
− | |||
|- | |- | ||
Line 265: | Line 216: | ||
Exercise 3 | Exercise 3 | ||
− | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Plot a '''log-log''''' '''''chart''' of '''y '''''equal to''''' 5 times x | + | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Plot a '''log-log''''' '''''chart''' of '''y '''''equal to''''' 5 times x cube''' for '''x''' from 1 to 20. |
|- | |- | ||
Line 274: | Line 225: | ||
'''y = 5*x**3''' | '''y = 5*x**3''' | ||
− | |||
− | |||
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Before we actually plot, let us calculate the points needed for that. | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Before we actually plot, let us calculate the points needed for that. | ||
− | |||
Type''' ''' | Type''' ''' | ||
− | '''x | + | '''x '''''equalto '''''linspace '''''within parentheses''''' 1 '''''comma '''''20 '''''comma '''''100 '''and''' press Enter''' |
− | '''y '''''equal to '''''5 '''''into''''' x '''''raised to''''' 3''' and''' press Enter''' | + | Then''', y '''''equal to '''''5 '''''into''''' x '''''raised to''''' 3''' and''' press Enter''' |
|- | |- | ||
Line 292: | Line 240: | ||
'''loglog(x,y)''' | '''loglog(x,y)''' | ||
− | |||
− | |||
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Clear the '''plot window '''by typing '''clf '''parentheses and '''press Enter''' | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Clear the '''plot window '''by typing '''clf '''parentheses and '''press Enter''' | ||
− | |||
Type '''loglog '''''within parentheses '''''x '''''comma '''''y '''and '''press Enter''' | Type '''loglog '''''within parentheses '''''x '''''comma '''''y '''and '''press Enter''' | ||
Line 308: | Line 253: | ||
Summary | Summary | ||
− | |||
− | |||
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| This brings us to the end of this tutorial. In this tutorial we learnt to, | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| This brings us to the end of this tutorial. In this tutorial we learnt to, | ||
Line 317: | Line 260: | ||
# Plot a '''log-log graph''' using '''loglog()''' function | # Plot a '''log-log graph''' using '''loglog()''' function | ||
− | |||
− | |||
|- | |- | ||
Line 330: | Line 271: | ||
# '''scatter '''''within parentheses '''''x '''''comma''''' y '''''comma''''' color '''''equal to within single quotes '''''blue '''''comma''''' marker '''''equal to within single quotes '''''d''' | # '''scatter '''''within parentheses '''''x '''''comma''''' y '''''comma''''' color '''''equal to within single quotes '''''blue '''''comma''''' marker '''''equal to within single quotes '''''d''' | ||
+ | #and '''plot '''''within parentheses '''''x '''''comma''''' y '''''comma''''' color '''''equal to within single quotes '''''b '''''comma''''' marker '''''equal to within single quotes '''''d''' | ||
− | + | does exactly the same? | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | * True or False | ||
|- | |- | ||
Line 343: | Line 282: | ||
Solution to assignment | Solution to assignment | ||
− | + | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| And the answer, | |
− | + | ||
− | | style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| And the | + | |
# '''False'''. Both functions do not produce the same kind of plot. | # '''False'''. Both functions do not produce the same kind of plot. | ||
− | |||
− | |||
|- | |- |
Latest revision as of 22:03, 7 September 2017
lPython/C2/Other-types-of-plots/English
Title of script: Other types of plots.
Author: Anoop Jacob Thomas, Thirumalesh H S
Keywords: Python, IPython, pylab, scatter plot, loglog plot, video tutorial
Visual Cue | Narration |
Show slide | Hello friends. Welcome to the tutorial on Other types of plots |
Show slide
Learning Objectives
|
At the end of this tutorial, you will be able to -
|
Show slide
System Specifications |
To record this tutorial, I am using
|
Show slide
Pre-requisites
If not, see the relevant Python tutorials on http://spoken-tutorial.org |
To practice this tutorial, you should know how to
If not, see the relevant Python tutorials on this website. |
[Terminal]
ipython3 |
Let us first open the Terminal by pressing Ctrl+Alt+T keys simultaneously.
Now, type ipython3 and press Enter. |
[IPython console]
%pylab and press Enter. |
Let us initialise the pylab package.
Type percent pylab and press Enter. |
Show Slide
Scatter plot |
In a scatter plot, the data is displayed as a collection of points.
Each point determines its position on the x and y axes |
Show Slide
Exercise 1 |
|
In terminal type:
cat company-a-data.txt |
Let us see the content of the file company hyphen a hyphen data dot txt.
So type, cat company hyphen a hyphen data dot txt. and press Enter |
Show cat company-a-data.txt output | The data file has two columns with a set of values in each column.
The first column represents the years. And the second column represents the profit percentage. |
[IPython Terminal]
year, profit = loadtxt('company-a-data.txt', unpack = True) |
To produce the scatter plot,
we first need to load the data from the file using loadtxt command. Type 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 |
Highlight unpack = True | unpack equal to True returns the transposed array of data |
Show Slide
scatter() function |
scatter() function is used to generate the scatter graph
Syntax: scatter within parentheses x comma y
|
[IPython Terminal]
scatter(year, profit) |
Let us use scatter function to plot scatter graph for data stored in year and profit.
Type scatter within parentheses year comma profit and press Enter. Notice that we passed two arguments to scatter() function. First one being the values in x-coordinate that is year. Second, the values in y-coordinate, the profit percentages. |
Show Slide
Exercise |
Pause the video here, try out the following exercise and resume the video.
Read the documentation of scatter.
|
[IPython Terminal]
scatter(year,profit,color='r',marker='d') |
Solution to Exercise
Clear the plot window by typing clf parentheses and press Enter Now type scatter within parentheses year comma profit comma color equal to within single quotes r comma marker equal to within single quotes d and press Enter |
Show plot window | Thus, we got our scatter plot.
Now let us see another kind of plot. |
Show Slide
log-log graph |
|
Show Slide
loglog() function |
Syntax
loglog within parentheses x comma y
|
Show Slide
Exercise 3 |
Plot a log-log chart of y equal to 5 times x cube for x from 1 to 20. |
[IPython Terminal]
y = 5*x**3 |
Before we actually plot, let us calculate the points needed for that.
Type x equalto linspace within parentheses 1 comma 20 comma 100 and press Enter Then, y equal to 5 into x raised to 3 and press Enter |
[IPython Terminal]
clf() loglog(x,y) |
Clear the plot window by typing clf parentheses and press Enter
Type loglog within parentheses x comma y and press Enter |
Show plot window | We see the required plot |
Show Slide
Summary |
This brings us to the end of this tutorial. In this tutorial we learnt to,
|
Show Slide
Assignment
|
Here are some self assessment questions for you to solve.
does exactly the same?
|
Show Slide
Solution to assignment |
And the answer,
|
Show Slide
Forum |
Please post your timed queries in this forum. |
Show Slide
Fossee Forum |
Please post your general queries on Python in this forum. |
Show Slide
Textbook Companion |
FOSSEE team coordinates the TBC project. |
Show Slide
Acknowledgment |
Spoken Tutorial Project is funded by NMEICT, MHRD, Govt. of India.
For more details, visit this website. |
Previous slide | This is _________ from IIT Bombay (or FOSSEE, if you wish) signing off.
Thank you. |