问题描述
我正在尝试创建一个简单的散点图,其中所有点都用靛蓝进行着色:
# AbsVMinus and AbsV are x and y respectively
scatter(AbsVMinusI,AbsV,title = "Color-magnitude diagram",seriescolor = RGBA(140,20,252,1),legend = false)
我以“颜色”文档部分为例编写了这一行。但是,出现以下错误:
ERROR: LoadError: ArgumentError: (140,1) are integers in the range 0-255,but integer inputs are encoded with the N0f8
type,an 8-bit type representing 256 discrete values between 0 and 1.
Consider dividing your input values by 255,for example: RGBA{N0f8}(140/255,20/255,252/255,1/255)
Or use `reinterpret(N0f8,x)` if `x` is a `UInt8`.
See the READMEs for FixedPointNumbers and ColorTypes for more information.
我尝试了错误建议,但得到以下提示:
ERROR: LoadError: UndefVarError: N0f8 not defined
我在这里想念什么?
解决方法
所有参数的范围都是从零到一。
要查看您的紫色,只需:
RGBA(140/255,20/255,252/255,1.0)