Plots.jl:删除系列图例,保留颜色栏

时间:2019-12-09 21:31:41

标签: julia plots.jl

使用Plots.jl,我可以根据两个向量绘制散点图,其中两个向量的颜色如下:

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

enter image description here

该系列既有图例,也有颜色栏。

如果我设置了legend = false,则两个都将被删除:

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

:

我想删除该系列的图例(方框中的“ y1”),并保留颜色栏。有谁知道这是怎么做到的吗?谢谢。

1 个答案:

答案 0 :(得分:1)

Derp,想通了。

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

enter image description here