Advertisement
eliasdaler

Untitled

May 13th, 2015
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. function createData()
  2.     file = io.open("data.txt", "w")
  3.     for i=1,10 do
  4.         file:write(i .. " " .. (i * i) .. "\n")
  5.     end
  6.     file:close()
  7.     return
  8. end
  9.  
  10. function generatePlotScript()
  11.     file = io.open("test.gnuplot", "w")
  12.     file:write([[plot "data.txt" using 1:2 with points, x * x]])
  13.     file:close()
  14. end
  15.  
  16. function plot()
  17.     os.execute([[cmd /K "C:\Program Files (x86)\gnuplot\bin\gnuplot.exe" test.gnuplot --persist]])
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement