Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

Alternate color for each point in scatter plot and add legend

$
0
0

I’m plotting a series where I’d like to alternate colors for each point. This works fine via the mc keyword, but I can’t get the legend to indicate the color coding scheme correctly:

using Plots
a = rand(10); b = rand(10);
scatter(a, b, mc = [:navy, :crimson], label = ["odd", "even"])

hi

How can I fix the legend?

5 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 2795

Trending Articles