summaryrefslogtreecommitdiff
path: root/Tutorial02-Plots/Scilab_code/Tutorial2_plot_save_func.sce
blob: c6a2883605864afdaecadeddb5a705c6df27a9ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//This script demonstrate exporting plots to svg/pdf files
clear 
clc

exec change_plot_attribs.sci;

//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);

//Call function to change plot attributes
//Arguments (x_label,y_label,title,label_size,title_size,fontsize)
change_plot_attribs('Time','Data','x versus t',7,6,3) 

//Export Figure 1 as svg file
xs2svg(fig1,'plot_y_versus_x1');

//Export Figure 2 as pdf file
xs2pdf(fig1,'plot_y_versus_x1');