在朱莉娅(Julia)中,我可以提供颜色作为int。例如,这起作用:
Using Plots()
# Using gr backend
gr()
x = [1,2,3]
y = [1,2,3]
cols = [1,2,3]
scatter(x,y, markercolor = cols, leg = false)
如果我想更改形状,我可以提供以下内容:
shapes = [:hex, :circle, :hex]
scatter(x, y, markershape = shapes, markercolor = cols, leg = false)
,但看来我无法提供标记形状作为int!
shapes = [1, 2, 3]
scatter(x, y, markershape = shapes, markercolor = cols, leg = false)
有什么简单的方法可以为图中的形状提供INT吗?还是将INT转换为形状的好方法?
使用整数用作图中的索引。Supported_markers可能有效:
julia> Plots.supported_markers()
24-element Array{Symbol,1}:
:none
:auto
:circle
:rect
:star5
:diamond
:hexagon
:cross
:xcross
:utriangle
:dtriangle
:rtriangle
:ltriangle
:pentagon
:heptagon
:octagon
:star4
:star6
:star7
:star8
:vline
:hline
:+
:x
julia> Plots.supported_markers()[6]
:diamond