diff options
author | Chayan Bhawal | 2018-09-27 17:25:55 +0530 |
---|---|---|
committer | Chayan Bhawal | 2018-09-27 17:25:55 +0530 |
commit | 7a29e5fb81d9f0bb5f3c548c76a3ebacb1ce94ec (patch) | |
tree | bf50691575cf8b22abfad2cccdf2d8e849da1baa /Tutorial2_Plot | |
parent | 168f3114992f59d8782730ce47cb6911c62038ec (diff) | |
download | scilab-tutorials-7a29e5fb81d9f0bb5f3c548c76a3ebacb1ce94ec.tar.gz scilab-tutorials-7a29e5fb81d9f0bb5f3c548c76a3ebacb1ce94ec.tar.bz2 scilab-tutorials-7a29e5fb81d9f0bb5f3c548c76a3ebacb1ce94ec.zip |
Tutorial5_nonlinear_update
Diffstat (limited to 'Tutorial2_Plot')
-rw-r--r-- | Tutorial2_Plot/Data/README.md | 1 | ||||
-rw-r--r-- | Tutorial2_Plot/Data/Tut2_data1.csv | 15 | ||||
-rw-r--r-- | Tutorial2_Plot/Problems/README.md | 1 | ||||
-rw-r--r-- | Tutorial2_Plot/README.md | 1 | ||||
-rw-r--r-- | Tutorial2_Plot/Scilab_code/README.md | 1 | ||||
-rw-r--r-- | Tutorial2_Plot/Scilab_code/Tutorial2_semilog.sce | 22 | ||||
-rw-r--r-- | Tutorial2_Plot/Scilab_code/Tutotial2_multi_plotting.sce | 35 | ||||
-rw-r--r-- | Tutorial2_Plot/Scilab_code/Tutotial2_plot_save.sce | 20 | ||||
-rw-r--r-- | Tutorial2_Plot/Scilab_code/Tutotial2_plotting.sce | 20 |
9 files changed, 116 insertions, 0 deletions
diff --git a/Tutorial2_Plot/Data/README.md b/Tutorial2_Plot/Data/README.md new file mode 100644 index 0000000..a8e89e2 --- /dev/null +++ b/Tutorial2_Plot/Data/README.md @@ -0,0 +1 @@ +# Data for scientific plotting diff --git a/Tutorial2_Plot/Data/Tut2_data1.csv b/Tutorial2_Plot/Data/Tut2_data1.csv new file mode 100644 index 0000000..974af87 --- /dev/null +++ b/Tutorial2_Plot/Data/Tut2_data1.csv @@ -0,0 +1,15 @@ +1,3.33333333333333E-05,3.33333333333333E-06,3.33333333333333E-06,0.0036866667 +2,7.33333333333333E-05,0,3.33333333333333E-06,0.0038966667 +3,2.33333333333333E-05,0,3.33333333333333E-06,0.00365 +4,0.00003,0,6.66666666666667E-06,0.0036866667 +5,3.33333333333333E-05,0,3.33333333333333E-06,0.0037333333 +6,3.33333333333333E-05,0,3.33333333333333E-06,0.0037933333 +7,0.00004,0,3.33333333333333E-06,0.00385 +8,0.00004,3.33333333333333E-06,0.00001,0.0038766667 +9,0.00005,3.33333333333333E-06,3.33333333333333E-06,0.0041033333 +10,4.66666666666667E-05,0.00001,6.66666666666667E-06,0.0039433333 +11,0.00004,3.33333333333333E-06,6.66666666666667E-06,0.00392 +12,0.00005,0.00001,0.00001,0.0040733333 +13,5.66666666666667E-05,0.00001,0.00001,0.0040966667 +14,6.33333333333333E-05,6.66666666666667E-06,1.66666666666667E-05,0.0042166667 +15,5.66666666666667E-05,6.66666666666667E-06,0.00001,0.00409 diff --git a/Tutorial2_Plot/Problems/README.md b/Tutorial2_Plot/Problems/README.md new file mode 100644 index 0000000..5a77a1e --- /dev/null +++ b/Tutorial2_Plot/Problems/README.md @@ -0,0 +1 @@ +# Problems for scientific plotting diff --git a/Tutorial2_Plot/README.md b/Tutorial2_Plot/README.md new file mode 100644 index 0000000..f99bc98 --- /dev/null +++ b/Tutorial2_Plot/README.md @@ -0,0 +1 @@ +# Scientific plotting diff --git a/Tutorial2_Plot/Scilab_code/README.md b/Tutorial2_Plot/Scilab_code/README.md new file mode 100644 index 0000000..150fc44 --- /dev/null +++ b/Tutorial2_Plot/Scilab_code/README.md @@ -0,0 +1 @@ +# Scilab code for scientific plotting diff --git a/Tutorial2_Plot/Scilab_code/Tutorial2_semilog.sce b/Tutorial2_Plot/Scilab_code/Tutorial2_semilog.sce new file mode 100644 index 0000000..070290c --- /dev/null +++ b/Tutorial2_Plot/Scilab_code/Tutorial2_semilog.sce @@ -0,0 +1,22 @@ +//This script demonstrate multi-plotting in Scilab +clear +clc + +//Import data from file +Data = csvRead('/home/chayan/Documents/scilab-tutorials/Tutorial2/Data/Tut2_data1.csv'); + +//Segregate the data into variables +y = Data(:,1); +x = [Data(:,4) Data(:,5)] + + +//Figure 1 is a semilog plot +fig1 = figure(); +plot2d(y,x,[1,2],logflag="nl") +legends(['Length of x1','Length of x3'],[1,2],opt="ur",font_size=1,font); + + +//Figure 2 is a loglog plot +fig2 = figure(); +plot2d(y,x,[3,-1],logflag="ll") +legends(['Length of x1','Length of x3'],[3,-1],opt="ur",font_size=1); diff --git a/Tutorial2_Plot/Scilab_code/Tutotial2_multi_plotting.sce b/Tutorial2_Plot/Scilab_code/Tutotial2_multi_plotting.sce new file mode 100644 index 0000000..91e4f20 --- /dev/null +++ b/Tutorial2_Plot/Scilab_code/Tutotial2_multi_plotting.sce @@ -0,0 +1,35 @@ +//This script demonstrate multi-plotting in Scilab +clear +clc + +//Import data from file +Data = csvRead('/home/chayan/Documents/scilab-tutorials/Tutorial2/Data/Tut2_data1.csv'); + +//Segregate the data into variables +y = Data(:,1); +x = [Data(:,2) Data(:,4)] + +//Fixing the range of plot +//Range is defined by [xmin,xmax,ymin,ymax] +range_of_plot = [-10,1e-05,20,10e-05] + +//Style of plot +//Stricly positive value represent the color +//Negative or zero value means given curve points are drawn using marks +//For color of marks use polyline property +style_plot = [-1,2] + +//Plotting y versus two data sets +plot2d(y,x,style_plot,rect=range_of_plot); + + +//For labelling axes and adding a title to the plot +xtitle('Plot of Time versus Length_x1 and Length_x3','Time','Length'); + + +//For legends "ur" for upper right +//legends(['Length of x1','Length of x3'],[-1,2]); //Default case +//legends(['Length of x1','Length of x3'],[-1,2],opt="ur"); //Position of the legend box +legends(['Length of x1','Length of x3'],[-1,2],opt="ur",font_size=2); //Font size of the legends + + diff --git a/Tutorial2_Plot/Scilab_code/Tutotial2_plot_save.sce b/Tutorial2_Plot/Scilab_code/Tutotial2_plot_save.sce new file mode 100644 index 0000000..1cf2566 --- /dev/null +++ b/Tutorial2_Plot/Scilab_code/Tutotial2_plot_save.sce @@ -0,0 +1,20 @@ +//This script demonstrate exporting plots to svg/pdf files +clear +clc + +//Import data from file +Data = csvRead('/home/chayan/Documents/scilab-tutorials/Tutorial2/Data/Tut2_data1.csv'); + +//Segregate the data into variables +y = Data(:,1); +x1 = Data(:,2) + +//Figure 1 is y versus x1 +fig1 = figure(); +plot(y,x1); + +//Export Figure 1 as svg file +xs2svg(fig1,'plot_y_versus_x1') + +//Export Figure 2 as pdf file +xs2pdf(fig1,'plot_y_versus_x1') diff --git a/Tutorial2_Plot/Scilab_code/Tutotial2_plotting.sce b/Tutorial2_Plot/Scilab_code/Tutotial2_plotting.sce new file mode 100644 index 0000000..b191b80 --- /dev/null +++ b/Tutorial2_Plot/Scilab_code/Tutotial2_plotting.sce @@ -0,0 +1,20 @@ +//This script demonstrate plotting in Scilab +clear +clc + +//Import data from file +Data = csvRead('/home/chayan/Documents/scilab-tutorials/Tutorial2/Data/Tut2_data1.csv'); + +//Segregate the data into variables +y = Data(:,1); +x1 = Data(:,2); +x2 = Data(:,3); +x3 = Data(:,4); +x4 = Data(:,5); + +//Plotting y versus x1 +plot(y,x1); + + + + |