Difference between revisions of "Gnuplot/C2/Example-scripts-and-demo-folder/English"
Line 1: | Line 1: | ||
{|border=1 | {|border=1 | ||
||'''Visual Cue''' | ||'''Visual Cue''' | ||
− | ||'''Narration''' | + | || '''Narration''' |
|- | |- | ||
− | | '''Slide Number 1''' | + | || '''Slide Number 1''' |
− | ''' | + | '''Title Slide ''' |
− | + | || Welcome to the tutorial on '''Example Scripts and Demo Folder.''' | |
− | | Welcome to the tutorial on '''Example Scripts and Demo Folder''' | + | |
|- | |- | ||
− | |'''Slide Number 2''' | + | || '''Slide Number 2''' |
'''Learning Objectives''' | '''Learning Objectives''' | ||
− | + | || In this tutorial, we will learn, | |
− | | In this tutorial, we will | + | * About''' gnuplot terminal '''and the''' graphics''' interface |
− | + | * About '''demo''' folder of '''gnuplot''' | |
− | * | + | * About''' example script '''files |
− | * | + | * To load the script file to generate a graph |
− | * | + | |
|- | |- | ||
− | | '''Slide Number 3''' | + | || '''Slide Number 3''' |
'''System and Software Requirement''' | '''System and Software Requirement''' | ||
− | + | || To record this tutorial, I am using | |
− | | To record this tutorial, I am using | + | * '''Debian Linux''' 9.3 |
− | + | * '''gnuplot''' 5.2.6 | |
− | * Debian Linux 9 | + | * '''gedit text editor''' 3.22 |
− | * gnuplot 5 | + | * '''Firefox web browser 52.5''' |
− | * | + | * Working Internet connection to access online '''script''' files |
− | * Firefox web browser 52 | + | |
− | + | ||
− | + | ||
|- | |- | ||
− | | '''Slide Number 4''' | + | || '''Slide Number 4''' |
− | + | ||
'''Pre-requisites''' | '''Pre-requisites''' | ||
− | + | || To follow this tutorial, | |
− | | To follow this tutorial, | + | learner must be familiar with high school level Mathematics. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
|| '''Slide Number 5''' | || '''Slide Number 5''' | ||
+ | '''Extract gnuplot-5.2.6 folder''' | ||
+ | || At the time of installation, we downloaded and extracted the '''gnuplot''' folder. | ||
+ | Generally, the folder''' gnuplot-5.2.6''' would be in the '''Downloads''' folder. | ||
− | ''' | + | |- |
− | || | + | || '''Slide Number 6''' |
− | + | '''Extract gnuplot-5.2.6 folder''' | |
− | + | || If you had saved it elsewhere, then use that location for the next steps. | |
− | + | ||
|- | |- | ||
− | || | + | || '''Slide Number 7''' |
− | || | + | '''Missing gnuplot folder''' |
+ | || What should you do in case the '''gnuplot''' folder is missing on your machine? | ||
+ | You have to follow the steps explained in the prerequisite tutorials in this series. | ||
|- | |- | ||
− | || ''' | + | || Open '''file manager''', go to '''Downloads, gnuplot-5.2.6''' and '''demo''' folder |
− | || | + | || Open file manager. |
− | + | Click on '''File Manager '''icon. | |
− | + | In my machine, this icon is located on the menu bar at the bottom. | |
− | + | Navigate to '''Downloads, gnuplot-5.2.6''' and then to '''demo''' folder. | |
|- | |- | ||
− | || | + | || Scroll/highlight |
− | || | + | || Notice the various files in the folder. |
|- | |- | ||
− | || | + | || Press '''Ctrl+Alt+T''' keys |
− | || | + | || We will now open a '''terminal''' by pressing '''Ctrl, Alt''' and''' T''' keys simultaneously. |
− | + | ||
|- | |- | ||
− | || | + | || '''cd Downloads/gnuplot-5.2.6/demo''' |
− | || | + | || Type '''cd space Downloads slash gnuplot-5.2.6 slash demo '''and press '''Enter.''' |
− | + | We are in the '''demo directory''', which contains the '''example''' files. | |
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
− | || | + | || Type '''ls '''and press '''enter''' |
− | || | + | || Type '''ls''' to list the files in the '''demo directory'''. |
− | + | ||
|- | |- | ||
− | || | + | || Hover mouse over the .dem extension files |
− | + | || Notice there are several files with '''dot''' '''dem''' extension. | |
− | + | ||
− | + | ||
− | || Notice | + | |
|- | |- | ||
|| Scroll up | || Scroll up | ||
− | || They are simple text scripts, which are used to generate | + | || They are simple text '''scripts''', which are used to generate plots. |
+ | |||
|- | |- | ||
− | || '''Ctrl | + | || '''Ctrl shift k''' on rdp machine |
− | || | + | || Let me clear the screen. |
+ | |||
|- | |- | ||
|| | || | ||
− | || | + | || Now let's look at the structure of '''demonstration '''an '''example script''' using a '''text editor.''' |
− | + | I will use '''gedit text editor. '''You can use any other '''editor''' of your choice. | |
+ | '''Windows''' users may open the file in '''Notepad.''' | ||
|- | |- | ||
− | || Type '''gedit simple.dem''' and press enter | + | || Type '''gedit simple.dem''' and press '''enter''' |
− | || Type '''gedit space simple dot dem''' and press | + | || Type '''gedit space simple dot dem''' and press '''Enter'''. |
|- | |- | ||
|| | || | ||
− | || The script file opens in | + | || The '''script''' file opens in the '''text editor '''window. |
− | + | ||
|- | |- | ||
− | || Hover mouse near required files in header. | + | || Hover mouse near required files in header. |
− | || Details about this plot are mentioned in the header. | + | Hover mouse next to the three functions in plot command |
+ | || Details about this plot are mentioned in the '''header'''. | ||
The required data files are also mentioned. | The required data files are also mentioned. | ||
− | This script plots three functions together. | + | This '''script''' plots three '''functions''' together. |
|- | |- | ||
− | || | + | || Hover mouse next to left and right key in script |
− | || Scroll down to view the file. | + | || Scroll down to view the entire file. |
− | + | This is the structure of a '''script file.''' | |
|- | |- | ||
|| Close '''gedit''' | || Close '''gedit''' | ||
− | || | + | || Now, close the '''text editor''' window. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
− | || | + | || Clear screen. |
− | || Next, let's run | + | || I will clear the terminal. |
+ | Next, let's run this '''script''' in '''gnuplot''' and generate the plot. | ||
|- | |- | ||
|| '''>gnuplot''' | || '''>gnuplot''' | ||
Press enter | Press enter | ||
− | || In terminal | + | || In the '''terminal''', type '''gnuplot''' and press '''Enter'''. |
|- | |- | ||
|| Hover mouse near gnuplot prompt | || Hover mouse near gnuplot prompt | ||
− | || The | + | || The '''prompt''' changes to '''gnuplot prompt.''' |
+ | To execute a '''command''' in the '''terminal''', press '''Enter''' after typing it. | ||
+ | I will not mention this separately. | ||
− | + | |- | |
− | I will | + | || '''Ctrl shift k''' on rdp machine |
+ | || I will clear the '''terminal''' and bring the '''prompt''' back to the top of the '''terminal'''. | ||
|- | |- | ||
− | || | + | || '''>load '''''''simple.dem'''' |
− | || | + | || To load the '''script''', type '''load space''' within single quotes '''simple dot dem''' |
|- | |- | ||
− | || ''' | + | || Click on '''graphics''' window. |
− | || | + | || A graphical window opens. |
+ | Click on this graphics window. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | || Hover mouse next to ''' | + | || Hover mouse next to s'''in(x), atan(x) and cos(atan(x)) ''' |
− | || Three | + | || Three '''functions, sin x, atan x '''and''' cos atan x''' are plotted. |
|- | |- | ||
|| Scroll further in axis limits | || Scroll further in axis limits | ||
− | || Using arrow keys, scroll, left, right, up and down | + | || Using arrow keys, scroll, left, right, up and down within the plot. |
− | + | Doing this allows us to scroll further in the axis limits. | |
− | + | This feature is enabled in the '''script''' file. | |
− | + | ||
− | This feature is enabled in the script file. | + | |
|- | |- | ||
|| Hover mouse next to “'''press enter to continue'''” and press enter | || Hover mouse next to “'''press enter to continue'''” and press enter | ||
− | || | + | || '''simple dot dem''' can plot many graphs. |
− | + | Go through the script file again, at this stage. | |
− | + | ||
− | + | ||
+ | |- | ||
+ | || Go to '''terminal''' | ||
+ | || To see the next plot, go to the '''terminal''' by clicking on it. | ||
+ | We can read a message “'''Hit return to continue'''”. | ||
− | Hit return to continue | + | |- |
+ | || Hit '''return''' | ||
+ | || Press the '''Enter '''key to continue. | ||
From now on, you have to do this every time to get the next plot. | From now on, you have to do this every time to get the next plot. | ||
|- | |- | ||
|| Show the change in graphics window | || Show the change in graphics window | ||
− | || | + | || Immediately, the next '''script''' and it's '''function''' gets plotted. |
|- | |- | ||
− | || Press enter | + | || Press '''enter''' in '''terminal''' |
− | || Press | + | || Press '''Enter''' again, as shown in the '''prompt''' to plot other '''functions''' from the '''script'''. |
|- | |- | ||
− | || | + | || Show graphics window. |
− | || | + | || Likewise, you can scroll through some more '''example '''files in the '''demo directory'''. |
|- | |- | ||
|| Close graphical window | || Close graphical window | ||
− | || I will | + | || Now I will close this graphical window. |
|- | |- | ||
− | || Press ''' | + | || Press''' Ctrl + C''' |
− | || | + | || Press '''Ctrl '''and '''C''' keys in the '''terminal''', to come back to the '''gnuplot prompt.''' |
+ | |- | ||
+ | || | ||
+ | || Now, I will open a '''3D plot demo''' '''example '''file. | ||
− | + | |- | |
+ | || '''load ‘hidden2.dem’''' and '''enter''' | ||
+ | || Load the '''hidden2 dot dem''' file on the '''terminal'''. | ||
+ | Use the '''command''' as shown before to load the '''script''' file. | ||
− | + | |- | |
+ | || Show the graph | ||
+ | || A graphics window opens. | ||
|- | |- | ||
− | || | + | || Go terminal press enter, view graph , repeat for 3 graphs |
− | || | + | || Go through the 3 examples of the '''3D plots''' this '''script''' can generate. |
+ | |||
+ | |- | ||
+ | || Close the '''graphics terminal'''. | ||
+ | || Then close the '''graphics '''window. | ||
|- | |- | ||
|| | || | ||
− | || | + | || I encourage you to try other '''example''' files in this folder, likewise. |
+ | |- | ||
+ | || Press '''q''' | ||
+ | || Type '''q''' to exit '''gnuplot.''' | ||
− | |||
|- | |- | ||
|| Open web browser. | || Open web browser. | ||
− | || I will show how to access the | + | || Many '''example scripts''' are available online for '''gnuplot''', as well. |
+ | |||
+ | |- | ||
+ | || | ||
+ | || I will show how to access the '''example''' files online in the next step. | ||
|- | |- | ||
|| Go to, '''gnuplot.sourceforge.net/demo''' | || Go to, '''gnuplot.sourceforge.net/demo''' | ||
− | || | + | || In the''' web browser''', go to the '''URL''' as shown here. |
− | + | ||
− | + | ||
|- | |- | ||
− | || Scroll down and show | + | || Scroll down and show |
− | || Notice | + | || Notice that there are several '''example''' '''scripts''' available for users to learn from. |
|- | |- | ||
− | || Hover mouse over | + | || Hover mouse over the routines |
− | || 2D and 3D graphs, histograms and curve fitting are few capabilities of software. | + | || '''2D''' and '''3D''' graphs, histograms and curve fitting are few capabilities of the software. |
|- | |- | ||
|| Click on '''Simple functions''' | || Click on '''Simple functions''' | ||
− | || | + | || Under''' Basic 2D plot styles''', click on the '''simple functions''' link. |
|- | |- | ||
− | || Hover mouse over graph, pan right | + | || Hover mouse over graph, pan right |
− | || | + | || The left side shows the graphical plots. |
− | + | The simple '''scripts''' on the right side generate the plots. | |
− | + | ||
− | The simple scripts on the right side | + | |
|- | |- | ||
− | || Scroll down pan left | + | || Scroll down pan left |
− | || Scroll down the page and notice the various styles in plots on the left side. | + | || Scroll down the page and notice the various '''styles''' seen in the plots on the left side. |
− | + | ||
− | || Hover mouse over graph | + | |- |
+ | || Hover mouse over graph | ||
|| Notice the variations in symbols, color, legends, line style and filling area. | || Notice the variations in symbols, color, legends, line style and filling area. | ||
|- | |- | ||
|| | || | ||
− | || Learners may use this page to learn the various commands and options | + | || Learners may use this page to learn the various '''commands''' and '''options.''' |
|- | |- | ||
− | || '''Slide Number | + | || '''Slide Number 8''' |
− | ''' | + | '''Help Forum''' |
− | || | + | || If we need help at any time, we can go to this URL |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | https://sourceforge.net/p/gnuplot/discussion/ | ||
|- | |- | ||
− | || ''' | + | || '''Browser >> '''https://sourceforge.net/p/gnuplot/discussion/ |
+ | Point to the '''Register''' link at the top left. | ||
+ | || Here we can see previously asked questions and the corresponding replies. | ||
− | + | We can also post our questions and doubts after we register. | |
− | || | + | |- |
+ | || '''Slide Number 9''' | ||
+ | '''Summary''' | ||
+ | || Now let's summarize. | ||
+ | In this tutorial, we learned | ||
+ | * About '''gnuplot terminal''' and the '''graphics''' interface | ||
+ | * About the '''demo''' folder of '''gnuplot''' | ||
+ | * About '''example script '''files and | ||
+ | * Loaded the script file to generate a graph | ||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | || '''Slide Number | + | || '''Slide Number 10''' |
− | + | ||
'''Assignment''' | '''Assignment''' | ||
+ | || For assignment activity, please do the following: | ||
+ | * Open some more '''example '''files of your choice, in '''gnuplot''' | ||
+ | * Observe the graphic output and the variations in plot styles. | ||
− | |||
|- | |- | ||
− | || '''Slide Number | + | || '''Slide Number 11''' |
'''Spoken Tutorial Project''' | '''Spoken Tutorial Project''' | ||
+ | || This video summarises the Spoken Tutorial Project | ||
+ | Please download and watch it. | ||
− | |||
− | |||
|- | |- | ||
− | || '''Slide Number | + | || '''Slide Number 12''' |
− | + | ||
'''Spoken Tutorial workshops''' | '''Spoken Tutorial workshops''' | ||
− | + | || The Spoken Tutorial Project Team conducts workshops and gives certificates. | |
− | || The Spoken Tutorial Project Team | + | |
− | + | ||
− | + | ||
− | + | ||
For more details, please write to us. | For more details, please write to us. | ||
|- | |- | ||
− | || '''Slide Number | + | || '''Slide Number 13''' |
'''Forum for specific questions:''' | '''Forum for specific questions:''' | ||
|| Post your timed queries in the forum. | || Post your timed queries in the forum. | ||
|- | |- | ||
− | || '''Slide Number | + | || '''Slide Number 14''' |
'''Acknowledgement''' | '''Acknowledgement''' | ||
|| Spoken Tutorial Project is funded by NMEICT, MHRD, Government of India. | || Spoken Tutorial Project is funded by NMEICT, MHRD, Government of India. | ||
Line 320: | Line 315: | ||
|- | |- | ||
|| | || | ||
− | || This is Rani from IIT | + | || This is Rani from IIT Bombay. Thank you for joining. |
+ | |||
|- | |- | ||
|} | |} |
Revision as of 14:46, 23 August 2019
Visual Cue | Narration |
Slide Number 1
Title Slide |
Welcome to the tutorial on Example Scripts and Demo Folder. |
Slide Number 2
Learning Objectives |
In this tutorial, we will learn,
|
Slide Number 3
System and Software Requirement |
To record this tutorial, I am using
|
Slide Number 4
Pre-requisites |
To follow this tutorial,
learner must be familiar with high school level Mathematics. |
Slide Number 5
Extract gnuplot-5.2.6 folder |
At the time of installation, we downloaded and extracted the gnuplot folder.
Generally, the folder gnuplot-5.2.6 would be in the Downloads folder. |
Slide Number 6
Extract gnuplot-5.2.6 folder |
If you had saved it elsewhere, then use that location for the next steps. |
Slide Number 7
Missing gnuplot folder |
What should you do in case the gnuplot folder is missing on your machine?
You have to follow the steps explained in the prerequisite tutorials in this series. |
Open file manager, go to Downloads, gnuplot-5.2.6 and demo folder | Open file manager.
Click on File Manager icon. In my machine, this icon is located on the menu bar at the bottom. Navigate to Downloads, gnuplot-5.2.6 and then to demo folder. |
Scroll/highlight | Notice the various files in the folder. |
Press Ctrl+Alt+T keys | We will now open a terminal by pressing Ctrl, Alt and T keys simultaneously. |
cd Downloads/gnuplot-5.2.6/demo | Type cd space Downloads slash gnuplot-5.2.6 slash demo and press Enter.
We are in the demo directory, which contains the example files. |
Type ls and press enter | Type ls to list the files in the demo directory. |
Hover mouse over the .dem extension files | Notice there are several files with dot dem extension. |
Scroll up | They are simple text scripts, which are used to generate plots. |
Ctrl shift k on rdp machine | Let me clear the screen. |
Now let's look at the structure of demonstration an example script using a text editor.
I will use gedit text editor. You can use any other editor of your choice. Windows users may open the file in Notepad. | |
Type gedit simple.dem and press enter | Type gedit space simple dot dem and press Enter. |
The script file opens in the text editor window. | |
Hover mouse near required files in header.
Hover mouse next to the three functions in plot command |
Details about this plot are mentioned in the header.
The required data files are also mentioned. This script plots three functions together. |
Hover mouse next to left and right key in script | Scroll down to view the entire file.
This is the structure of a script file. |
Close gedit | Now, close the text editor window. |
Clear screen. | I will clear the terminal.
Next, let's run this script in gnuplot and generate the plot. |
>gnuplot
Press enter |
In the terminal, type gnuplot and press Enter. |
Hover mouse near gnuplot prompt | The prompt changes to gnuplot prompt.
To execute a command in the terminal, press Enter after typing it. I will not mention this separately. |
Ctrl shift k on rdp machine | I will clear the terminal and bring the prompt back to the top of the terminal. |
>load ''simple.dem'' | To load the script, type load space within single quotes simple dot dem |
Click on graphics window. | A graphical window opens.
Click on this graphics window. |
Hover mouse next to sin(x), atan(x) and cos(atan(x)) | Three functions, sin x, atan x and cos atan x are plotted. |
Scroll further in axis limits | Using arrow keys, scroll, left, right, up and down within the plot.
Doing this allows us to scroll further in the axis limits. This feature is enabled in the script file. |
Hover mouse next to “press enter to continue” and press enter | simple dot dem can plot many graphs.
Go through the script file again, at this stage. |
Go to terminal | To see the next plot, go to the terminal by clicking on it.
We can read a message “Hit return to continue”. |
Hit return | Press the Enter key to continue.
From now on, you have to do this every time to get the next plot. |
Show the change in graphics window | Immediately, the next script and it's function gets plotted. |
Press enter in terminal | Press Enter again, as shown in the prompt to plot other functions from the script. |
Show graphics window. | Likewise, you can scroll through some more example files in the demo directory. |
Close graphical window | Now I will close this graphical window. |
Press Ctrl + C | Press Ctrl and C keys in the terminal, to come back to the gnuplot prompt. |
Now, I will open a 3D plot demo example file. | |
load ‘hidden2.dem’ and enter | Load the hidden2 dot dem file on the terminal.
Use the command as shown before to load the script file. |
Show the graph | A graphics window opens. |
Go terminal press enter, view graph , repeat for 3 graphs | Go through the 3 examples of the 3D plots this script can generate. |
Close the graphics terminal. | Then close the graphics window. |
I encourage you to try other example files in this folder, likewise. | |
Press q | Type q to exit gnuplot. |
Open web browser. | Many example scripts are available online for gnuplot, as well. |
I will show how to access the example files online in the next step. | |
Go to, gnuplot.sourceforge.net/demo | In the web browser, go to the URL as shown here. |
Scroll down and show | Notice that there are several example scripts available for users to learn from. |
Hover mouse over the routines | 2D and 3D graphs, histograms and curve fitting are few capabilities of the software. |
Click on Simple functions | Under Basic 2D plot styles, click on the simple functions link. |
Hover mouse over graph, pan right | The left side shows the graphical plots.
The simple scripts on the right side generate the plots. |
Scroll down pan left | Scroll down the page and notice the various styles seen in the plots on the left side. |
Hover mouse over graph | Notice the variations in symbols, color, legends, line style and filling area. |
Learners may use this page to learn the various commands and options. | |
Slide Number 8
Help Forum |
If we need help at any time, we can go to this URL |
Browser >> https://sourceforge.net/p/gnuplot/discussion/
Point to the Register link at the top left. |
Here we can see previously asked questions and the corresponding replies.
We can also post our questions and doubts after we register. |
Slide Number 9
Summary |
Now let's summarize.
In this tutorial, we learned
|
Slide Number 10
Assignment |
For assignment activity, please do the following:
|
Slide Number 11
Spoken Tutorial Project |
This video summarises the Spoken Tutorial Project
Please download and watch it. |
Slide Number 12
Spoken Tutorial workshops |
The Spoken Tutorial Project Team conducts workshops and gives certificates.
For more details, please write to us. |
Slide Number 13
Forum for specific questions: |
Post your timed queries in the forum. |
Slide Number 14
Acknowledgement |
Spoken Tutorial Project is funded by NMEICT, MHRD, Government of India. |
This is Rani from IIT Bombay. Thank you for joining. |