It's not clear to me from your post what you are trying to do - do you want 
to plot each of the 10 rows of vec as a line with a different color? 
You might want to read this discussion 
<https://github.com/dcjones/Gadfly.jl/issues/526> suggesting that it is 
much easier to to the kind of plot you (potentially) want to do with a 
DataFrame than with an Array.
If you want to stick to the Array, use layers as described in the linked 
issue; adapted to your example you'd do:

plot(layer( x=[1:size(vec,2)], y=vec[1,:]+2, Geom.line, 
Theme(default_color=color("orange")) ),
      layer( x=[1:size(vec,2)], y=vec[2,:],Geom.line, 
Theme(default_color=color("purple"))) )

(note that I've shifted the first row up by 2 to make it easier to 
distinguish the lines); obviously you'd need 10 layers to plot your 10 
rows, or maybe write a macro if you want to plot a lot of rows.
The "Gadfly way" (Disclaimer: I plot almost exclusively using PyPlot, so 
take this with a grain of salt) would be to convert the Array into a 
stacked DataFrame as follows (partly lifted from this discussion 
<https://github.com/dcjones/Gadfly.jl/issues/529>):

df=DataFrame(y=vec[:], x=repeat([1:1000], outer=[10]), 
row=repeat(["vec"*string(i) for i = 1:10], inner=[1000]))
plot(df, color="row", x="x", y="y", Geom.line)

Reply via email to