Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function readFromFile(fileName)
- x = []
- y = []
- println(fileName)
- open(fileName) do f
- for line = eachline(f)
- if line != ""
- ln = split(line, ";")
- ln[1] = replace(ln[1], "," => ".")
- ln[2] = replace(ln[2], "," => ".")
- push!(x, parse(Float64,ln[1]))
- push!(y, log(parse(Float64,ln[2]) - 35.0))
- end
- end
- end
- return x, y
- end
- function drawToPNG(fileName)
- file = "/home/kacper/Desktop/JUSTYNA/"
- file = file * fileName
- x1, y1 = readFromFile(file)
- plotName = replace(fileName, ".txt" => "")
- myplot = plot(x=x1, y=y1, Geom.point, Guide.title(plotName), Guide.xlabel("t[s]"), Guide.ylabel("Log(T-35)"))
- pngName = plotName * ".png"
- draw(PNG(string(pngName)), myplot)
- end
- using Gadfly
- using Cairo
- using Fontconfig
- function main()
- drawToPNG("c1.txt")
- drawToPNG("c2.txt")
- drawToPNG("d1.txt")
- drawToPNG("d2.txt")
- drawToPNG("cyna.txt")
- drawToPNG("olow.txt")
- drawToPNG("eutektyk-9.txt")
- drawToPNG("eutektyk-10.txt")
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement