diff options
author | Chayan Bhawal | 2018-10-02 10:19:33 +0530 |
---|---|---|
committer | Chayan Bhawal | 2018-10-02 10:19:33 +0530 |
commit | 3d0c890de4ac7d9afd576e889bd2624437d79c70 (patch) | |
tree | 10bf164ddb34ffcc5c4b059e2968990b4e472d2f /Tutorial02-Plots/Scilab_code/Tutorial2_plot_save.sce | |
parent | 6d39446c434cfcca02ae7a4551e2d66edf9def7f (diff) | |
download | scilab-tutorials-3d0c890de4ac7d9afd576e889bd2624437d79c70.tar.gz scilab-tutorials-3d0c890de4ac7d9afd576e889bd2624437d79c70.tar.bz2 scilab-tutorials-3d0c890de4ac7d9afd576e889bd2624437d79c70.zip |
Renamed_files_relative_path
Diffstat (limited to 'Tutorial02-Plots/Scilab_code/Tutorial2_plot_save.sce')
-rw-r--r-- | Tutorial02-Plots/Scilab_code/Tutorial2_plot_save.sce | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Tutorial02-Plots/Scilab_code/Tutorial2_plot_save.sce b/Tutorial02-Plots/Scilab_code/Tutorial2_plot_save.sce new file mode 100644 index 0000000..40f02cd --- /dev/null +++ b/Tutorial02-Plots/Scilab_code/Tutorial2_plot_save.sce @@ -0,0 +1,32 @@ +//This script demonstrate exporting plots to svg/pdf files +clear +clc + +//Import data from file +Data = csvRead('../Data/Tut2_data1.csv'); + +//Segregate the data into variables +t = Data(:,1); +x = Data(:,2) + +//Ploting the figure. Name of the figure is fig1; +//Use the field Linewidth to specify thickness of the plot +fig1 = scf(1); +plot(t,x,'Linewidth',3); + +//Adding title, xlabels and ylabels +//Changing thickness and textsize in plot +attrib_axes = gca(); //Attributes of axes of active handle +attrib_axes.x_label.text = 'Time'; //X-label +attrib_axes.y_label.text = 'Data'; //Y-label +attrib_axes.title.text = 'x versus t'; //Title of the plot +attrib_axes.x_label.font_size = 5; //X_label font size +attrib_axes.y_label.font_size = 5; //Y_label font size +attrib_axes.title.font_size = 5; //Title font size +attrib_axes.font_size = 4; //Font size of x-axis and y-axis + +//Export Figure 1 as svg file +xs2svg(fig1,'plot_y_versus_x1'); + +//Export Figure 2 as pdf file +xs2pdf(fig1,'plot_y_versus_x1'); |