This seem quite easy with R’s ggplot2 but I can’t seem to figure it out with Plots.jl
I want to do a scatter plot of two numeric columns of the iris dataset and have the Species be the colour of each point. Of courses, Species isn’t a colour column, but the point is to have it choose a different colour for each specifies separately.
How do I do that using Plots.jl? Using Gadfly.jl it’s
using RDatasets
iris = dataset("datasets", "iris")
@df Gadfly.plot(x = iris[:PetalWidth], y = iris[:PetalLength], coour = iris[:Specifies])
but with Plots.jl I seem to need to specifies a mapping of Species to colours such as :red manually.
I feel like there’s something in StatsPlots that does this but can’t find it now. I guess you could always just loop through the different subsets of the data set and plot on the same graph, which would then assign a different colour to each new series?
julia> using Plots
julia> p = plot()
julia> for c in eachcol(rand(100, 4))
scatter!(p, c)
end
julia> display(p)