Ben S.
Ben S.

Reputation: 3545

Plots.jl: remove series legend, keep color bar

Using Plots.jl I can make a scatter plot from two vectors with color set by another vector as follows:

using Plots
scatter([1,3,5,7], [2,4,6,10], marker_z = [1,1,2,3])

enter image description here

There is both a legend for the series, and there is a color bar.

If I set legend = false both are removed:

scatter([1,3,5,7], [2,4,6,10], marker_z = [1,1,2,3], legend = false)

:

I would like to remove the legend for the series (the "y1" in a box), and keep the color bar. Does anyone know how to do that? Thank you.

Upvotes: 12

Views: 19757

Answers (1)

Ben S.
Ben S.

Reputation: 3545

Derp, figured it out.

scatter([1,3,5,7], [2,4,6,10], marker_z = [1,1,2,3], legend = false, 
        colorbar = true)   

enter image description here

Upvotes: 16

Related Questions