Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plots.jl: remove series legend, keep color bar

Tags:

julia

plots.jl

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.

like image 313
Ben S. Avatar asked Dec 09 '19 21:12

Ben S.


1 Answers

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

like image 161
Ben S. Avatar answered Oct 18 '22 19:10

Ben S.