[Scilab-users] Batch to export a graph to PNG automatically
Hu, Ning (Virginia Beach)
NHu at ecpi.edu
Mon Oct 28 13:28:27 CET 2013
Eleo:
The following is my code for exporting the plot to different files. It works for me.
//plot two functions in one window
function f = myquadratic ( x )
f = x^2
endfunction
function f = myquadratic2 ( x )
f = 2 * x^2
endfunction
xdata = linspace ( 1 , 10 , 50 );
ydata = myquadratic ( xdata );
plot ( xdata , ydata , "v-r")
ydata2 = myquadratic2 ( xdata );
plot ( xdata , ydata2 , "o-m" )
xtitle ( "My title " , "X axis " , "Y axis " );
legend ( "x^2", "2x^2");
xs2png ( 0, "C:\Math Software\Scilab Scripts\Graph Plots\Plot2Functions.png" );
xs2jpg ( 0, "C:\Math Software\Scilab Scripts\Graph Plots\Plot2Functions.jpg" );
xs2pdf ( 0, "C:\Math Software\Scilab Scripts\Graph Plots\Plot2Functions");
Ning Hu, D.Sc.
EET Faculty
ECPI University | 5555 Greenwich Road | Virginia Beach, VA 23462
(Phone) 757-671-7171 x55499 | NHu at ecpi.edu | www.ecpi.edu
-----Original Message-----
From: users [mailto:users-bounces at lists.scilab.org] On Behalf Of eleo
Sent: Monday, October 28, 2013 8:21 AM
To: users at lists.scilab.org
Subject: Re: [Scilab-users] Batch to export a graph to PNG automatically
Hello,
I have written the program attached below in order to plot and export a simple graph (y=cos(x)) in the "PNG" Format.
current_driver = driver()
driver("PNG")
xinit(TMPDIR+"/file.png")
x=-10:0.25:10
y=cos(x)
plot2d(x,y,2)
xend();
driver(current_driver)
I have obtained the following message:
xend();
!--error 999
xend: An error occurred: Unable to create export file, permission denied.
at line 7 of exec file called by :
exec(%fileToExec); disp(msprintf(gettext("Execution
done.\n
while executing a callback
If I change the path where I want the file to be written (for instance I
want to write it in Document), I obtain the same message.
How can I modify this program in order to export the file in PNG Format ok ?
Thank you for your help.
Regards,
Eleo
--
View this message in context: http://mailinglists.scilab.org/Scilab-users-Batch-to-export-a-graph-to-PNG-automatically-tp4027719p4027738.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
_______________________________________________
users mailing list
users at lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
More information about the users
mailing list