I'm using Gadfly to plot data in Julia. I have x = an array of floats, and several y1, y2, y3 ... of matching length. How to I plot all the points (x,y1) in green, (x,y2) in red, etc. in one Gadfly plot?
How to overplot multiple arrays of data in one Gadfly plot?
3.6k views Asked by DarenW At
2
There are 2 answers
0
On
This sort of stuff is simple with my package https://github.com/tbreloff/Plots.jl:
julia> using Plots; scatter(rand(10,3), c=[:green,:red,:blue])
You can put the data in a DataFrame, with three columns,
x
,y
andgroup
, and use the group as a colour aesthetic.As suggested in the comments, you could also use layers: