Last active
December 22, 2015 00:49
-
-
Save astrieanna/6392487 to your computer and use it in GitHub Desktop.
Making Vega.jl plot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Pkg.add for JSON | |
#Pkg.clone for Vega.jl, JSTypes | |
xs = open("xs.txt","r") | |
ys = open("ys.txt","r") | |
xarr = readdlm(xs) | |
yarr = readdlm(ys) | |
x2 = Float64[x for x in xarr] | |
y2 = Float64[y for y in yarr] | |
using Vega | |
plot(x = x2, | |
y = y2, | |
kind = :bar) | |
plot(x = x2, | |
y = y2, | |
kind = :line) | |
#you can enter this line by line in the REPL | |
# or put it in a file | |
# and include("filename") in the repl | |
# you'll only get the last plot command to actually run that way tho |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Pkg.add for JSON | |
#Pkg.clone for Vega.jl, JSTypes | |
# Run Vega.install() | |
#read in data | |
xs = readdlm(open("xs.txt","r")) | |
ys = readdlm(open("ys.txt","r")) | |
#Convert to Array{Float64,1} | |
x2 = Float64[x for x in xarr] | |
y2 = Float64[y for y in yarr] | |
#Plot! :) | |
using Vega | |
plot(x = x2, | |
y = y2, | |
kind = :bar) | |
plot(x = x2, | |
y = y2, | |
kind = :line) | |
#you can enter this line by line in the REPL | |
# or put it in a file | |
# and include("filename") in the repl | |
# you'll only get the last plot command to actually run that way tho |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment