機械学習のエッセンス
Mix.install([
{:nx, "~> 0.2"},
{:kino_vega_lite, "~> 0.1.1"}
])
Resolving Hex dependencies...
Dependency resolution completed:
New:
complex 0.4.1
kino 0.6.2
kino_vega_lite 0.1.2
nx 0.2.1
table 0.1.2
vega_lite 0.1.5
* Getting nx (Hex package)
* Getting kino_vega_lite (Hex package)
* Getting kino (Hex package)
* Getting table (Hex package)
* Getting vega_lite (Hex package)
* Getting complex (Hex package)
==> table
Compiling 5 files (.ex)
Generated table app
==> vega_lite
Compiling 5 files (.ex)
Generated vega_lite app
==> kino
Compiling 28 files (.ex)
Generated kino app
==> kino_vega_lite
Compiling 4 files (.ex)
Generated kino_vega_lite app
==> complex
Compiling 2 files (.ex)
Generated complex app
==> nx
Compiling 24 files (.ex)
Generated nx app
:ok
2章グラフの表示
alias VegaLite, as: Vl
x = Nx.iota({11}) |> Nx.subtract(5) |> Nx.to_flat_list()
y = Nx.tensor(x) |> Nx.power(2) |> Nx.to_flat_list()
Vl.new(width: 400, height: 200)
|> Vl.data_from_values(x: x, y: y)
|> Vl.mark(:line)
|> Vl.encode_field(:x, "x", type: :quantitative)
|> Vl.encode_field(:y, "y", type: :quantitative)
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"values":[{"x":-5,"y":25},{"x":-4,"y":16},{"x":-3,"y":9},{"x":-2,"y":4},{"x":-1,"y":1},{"x":0,"y":0},{"x":1,"y":1},{"x":2,"y":4},{"x":3,"y":9},{"x":4,"y":16},{"x":5,"y":25}]},"encoding":{"x":{"field":"x","type":"quantitative"},"y":{"field":"y","type":"quantitative"}},"height":200,"mark":"line","width":400}
04-02 NumPyの基本
# np.exp(2)
Nx.exp(2)
#Nx.Tensor<
f32
7.389056205749512
>
# np.log(np.e)
Nx.exp(1) |> Nx.log()
#Nx.Tensor<
f32
0.9999999403953552
>
# np.sin(np.pi)
:math.pi() |> Nx.sin() |> IO.inspect()
:math.pi() |> :math.sin() |> Nx.tensor()
#Nx.Tensor<
f32
-8.742277657347586e-8
>
#Nx.Tensor<
f32
1.2246468525851679e-16
>
# np.sqrt(3)
Nx.sqrt(3)
#Nx.Tensor<
f32
1.7320507764816284
>
NumPyの配列
# a = np.array([2,3,5,7,8])
a = Nx.tensor([2, 3, 5, 7, 8])
a[0]
#Nx.Tensor<
s64
2
>
# a[1:3]
a[1..2]
#Nx.Tensor<
s64[2]
[3, 5]
>
# a[2:-1]
a[2..-2//1]
#Nx.Tensor<
s64[2]
[5, 7]
>
# b = np.arange(5)
b = Nx.iota({5})
#Nx.Tensor<
s64[5]
[0, 1, 2, 3, 4]
>
# np.arange(1,3,0.2)
c = Nx.iota({10}) |> Nx.multiply(0.2) |> Nx.add(1) |> IO.inspect()
arange = fn s, e, step ->
Kernel.-(e, s)
|> Kernel./(step)
|> Kernel.trunc()
|> then(&Nx.iota({&1}))
|> Nx.multiply(step)
|> Nx.add(s)
end
arange.(1, 3, 0.2)
#Nx.Tensor<
f32[10]
[1.0, 1.2000000476837158, 1.399999976158142, 1.600000023841858, 1.7999999523162842, 2.0, 2.200000047683716, 2.4000000953674316, 2.5999999046325684, 2.8000001907348633]
>
#Nx.Tensor<
f32[10]
[1.0, 1.2000000476837158, 1.399999976158142, 1.600000023841858, 1.7999999523162842, 2.0, 2.200000047683716, 2.4000000953674316, 2.5999999046325684, 2.8000001907348633]
>
Nx.type(a)
{:s, 64}
Nx.tensor([1, 2, 4], type: :s64)
#Nx.Tensor<
s64[3]
[1, 2, 4]
>
2次元配列
# a = np.array([[2, 3, 4], [5 ,6, 7]], dtype=np.float64)
a = Nx.tensor([[2, 3, 4], [5, 6, 7]])
#Nx.Tensor<
s64[2][3]
[
[2, 3, 4],
[5, 6, 7]
]
>
# a[0, 1]
IO.inspect(a)
a[0][1]
#Nx.Tensor<
s64[2][3]
[
[2, 3, 4],
[5, 6, 7]
]
>
#Nx.Tensor<
s64
3
>
# a[:, 1]
IO.inspect(a)
a[[0..-1//1, 1]]
#Nx.Tensor<
s64[2][3]
[
[2, 3, 4],
[5, 6, 7]
]
>
#Nx.Tensor<
s64[2]
[3, 6]
>
# a[1, :]
IO.inspect(a)
a[1]
#Nx.Tensor<
s64[2][3]
[
[2, 3, 4],
[5, 6, 7]
]
>
#Nx.Tensor<
s64[3]
[5, 6, 7]
>
# a[0, 2:]
IO.inspect(a)
a[0][2..-1//1]
#Nx.Tensor<
s64[2][3]
[
[2, 3, 4],
[5, 6, 7]
]
>
#Nx.Tensor<
s64[1]
[4]
>
# a[0, :2]
IO.inspect(a)
a[0][0..1]
#Nx.Tensor<
s64[2][3]
[
[2, 3, 4],
[5, 6, 7]
]
>
#Nx.Tensor<
s64[2]
[2, 3]
>
配列のデータ属性
# a = np.arange(15.).reshape(3, 5)
a = Nx.iota({15}) |> Nx.reshape({3, 5})
#Nx.Tensor<
s64[3][5]
[
[0, 1, 2, 3, 4],
[5, 6, 7, 8, 9],
[10, 11, 12, 13, 14]
]
>
# a.shape
Nx.shape(a)
{3, 5}
# a.ndim
Nx.rank(a)
2
# a.size
Nx.size(a)
15
# b = np.arange(4.)
b = Nx.iota({4})
# b.shape
b |> Nx.shape() |> IO.inspect()
# b.ndim
b |> Nx.rank() |> IO.inspect()
# b.size
b |> Nx.size() |> IO.inspect()
{4}
1
4
4
reshapeメソッドと形状の変更
# a = np.arange(16.)
# c = a.reshape(4, -1)
a = Nx.iota({16}) |> IO.inspect()
c = Nx.reshape(a, {4, 4})
#Nx.Tensor<
s64[16]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
>
#Nx.Tensor<
s64[4][4]
[
[0, 1, 2, 3],
[4, 5, 6, 7],
[8, 9, 10, 11],
[12, 13, 14, 15]
]
>
# c.ravel()
IO.inspect(c)
Nx.flatten(c)
#Nx.Tensor<
s64[4][4]
[
[0, 1, 2, 3],
[4, 5, 6, 7],
[8, 9, 10, 11],
[12, 13, 14, 15]
]
>
#Nx.Tensor<
s64[16]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
>
# b = np.arange(4.)
b = Nx.iota({4}) |> IO.inspect()
Nx.reshape(b, {4, 1}) |> IO.inspect()
b |> Nx.new_axis(0) |> Nx.transpose()
#Nx.Tensor<
s64[4]
[0, 1, 2, 3]
>
#Nx.Tensor<
s64[4][1]
[
[0],
[1],
[2],
[3]
]
>
#Nx.Tensor<
s64[4][1]
[
[0],
[1],
[2],
[3]
]
>
その他の配列操作
# a = np.zeros((3,4))
Nx.random_normal({3, 4}, 0.0, 0.0)
#Nx.Tensor<
f32[3][4]
[
[0.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.0]
]
>
# b = np.ones((2,2))
Nx.random_normal({2, 2}, 1.0, 0.0)
#Nx.Tensor<
f32[2][2]
[
[1.0, 1.0],
[1.0, 1.0]
]
>
# c = np.empty((2, 5))
Nx.random_normal({2, 5})
#Nx.Tensor<
f32[2][5]
[
[-1.7319645881652832, -1.09846031665802, -0.48943886160850525, 0.6615829467773438, 0.4707445800304413],
[0.009378100745379925, 0.341081827878952, -1.1901406049728394, -1.0126851797103882, -0.5051515102386475]
]
>
行列の連結
a = Nx.iota({2, 3})
#Nx.Tensor<
s64[2][3]
[
[0, 1, 2],
[3, 4, 5]
]
>
b = Nx.iota({2, 3}) |> IO.inspect() |> Nx.add(6)
#Nx.Tensor<
s64[2][3]
[
[0, 1, 2],
[3, 4, 5]
]
>
#Nx.Tensor<
s64[2][3]
[
[6, 7, 8],
[9, 10, 11]
]
>
# 縦方向
# np.r_[a, b]
IO.inspect(a)
IO.inspect(b)
Nx.concatenate([a, b])
#Nx.Tensor<
s64[2][3]
[
[0, 1, 2],
[3, 4, 5]
]
>
#Nx.Tensor<
s64[2][3]
[
[6, 7, 8],
[9, 10, 11]
]
>
#Nx.Tensor<
s64[4][3]
[
[0, 1, 2],
[3, 4, 5],
[6, 7, 8],
[9, 10, 11]
]
>
# 横方向に連結
# np._c(a,b)
IO.inspect(a)
IO.inspect(b)
Nx.concatenate([a, b], axis: 1)
#Nx.Tensor<
s64[2][3]
[
[0, 1, 2],
[3, 4, 5]
]
>
#Nx.Tensor<
s64[2][3]
[
[6, 7, 8],
[9, 10, 11]
]
>
#Nx.Tensor<
s64[2][6]
[
[0, 1, 2, 6, 7, 8],
[3, 4, 5, 9, 10, 11]
]
>
c = Nx.iota({3}) |> IO.inspect()
d = Nx.iota({3}) |> Nx.add(3)
#Nx.Tensor<
s64[3]
[0, 1, 2]
>
#Nx.Tensor<
s64[3]
[3, 4, 5]
>
IO.inspect(c)
IO.inspect(d)
Nx.concatenate([c, d]) |> IO.inspect()
Nx.concatenate(
[
c |> Nx.new_axis(0) |> Nx.transpose(),
d |> Nx.new_axis(0) |> Nx.transpose()
],
axis: 1
)
#Nx.Tensor<
s64[3]
[0, 1, 2]
>
#Nx.Tensor<
s64[3]
[3, 4, 5]
>
#Nx.Tensor<
s64[6]
[0, 1, 2, 3, 4, 5]
>
#Nx.Tensor<
s64[3][2]
[
[0, 3],
[1, 4],
[2, 5]
]
>
# 形状が違うものを連結
# numpyではエラー
IO.inspect(a)
IO.inspect(c)
Nx.concatenate([a, c])
#Nx.Tensor<
s64[2][3]
[
[0, 1, 2],
[3, 4, 5]
]
>
#Nx.Tensor<
s64[3]
[0, 1, 2]
>
#Nx.Tensor<
s64[5]
[0, 1, 2, 3, 4]
>
c = Nx.new_axis(c, 0) |> IO.inspect()
Nx.concatenate([a, c])
#Nx.Tensor<
s64[1][3]
[
[0, 1, 2]
]
>
#Nx.Tensor<
s64[3][3]
[
[0, 1, 2],
[3, 4, 5],
[0, 1, 2]
]
>
04-03 配列操作の基本
a = Nx.iota({5})
#Nx.Tensor<
s64[5]
[0, 1, 2, 3, 4]
>
Nx.sum(a)
#Nx.Tensor<
s64
10
>
Nx.mean(a)
#Nx.Tensor<
f32
2.0
>
Nx.reduce_max(a)
#Nx.Tensor<
s64
4
>
Nx.reduce_min(a)
#Nx.Tensor<
s64
0
>
2次元配列の合計
b = Nx.iota({3, 3})
#Nx.Tensor<
s64[3][3]
[
[0, 1, 2],
[3, 4, 5],
[6, 7, 8]
]
>
Nx.sum(b)
#Nx.Tensor<
s64
36
>
IO.inspect(b)
Nx.sum(b, axes: [0])
#Nx.Tensor<
s64[3][3]
[
[0, 1, 2],
[3, 4, 5],
[6, 7, 8]
]
>
#Nx.Tensor<
s64[3]
[9, 12, 15]
>
IO.inspect(b)
Nx.sum(b, axes: [1])
#Nx.Tensor<
s64[3][3]
[
[0, 1, 2],
[3, 4, 5],
[6, 7, 8]
]
>
#Nx.Tensor<
s64[3]
[3, 12, 21]
>
ブロードキャスト
a = Nx.iota({5}) |> Nx.add(3)
#Nx.Tensor<
s64[5]
[3, 4, 5, 6, 7]
>
Nx.exp(a)
#Nx.Tensor<
f32[5]
[20.08553695678711, 54.598148345947266, 148.4131622314453, 403.4288024902344, 1096.6331787109375]
>
Nx.log(a)
#Nx.Tensor<
f32[5]
[1.0986123085021973, 1.3862943649291992, 1.6094379425048828, 1.7917594909667969, 1.945910096168518]
>
Nx.sqrt(a)
#Nx.Tensor<
f32[5]
[1.7320507764816284, 2.0, 2.2360680103302, 2.4494898319244385, 2.6457512378692627]
>
b = Nx.iota({3, 3})
#Nx.Tensor<
s64[3][3]
[
[0, 1, 2],
[3, 4, 5],
[6, 7, 8]
]
>
Nx.exp(b)
#Nx.Tensor<
f32[3][3]
[
[1.0, 2.7182817459106445, 7.389056205749512],
[20.08553695678711, 54.598148345947266, 148.4131622314453],
[403.4288024902344, 1096.6331787109375, 2980.9580078125]
]
>
配列とスカラの演算
a = Nx.iota({5})
#Nx.Tensor<
s64[5]
[0, 1, 2, 3, 4]
>
Nx.add(a, 3)
#Nx.Tensor<
s64[5]
[3, 4, 5, 6, 7]
>
Nx.multiply(a, 3)
#Nx.Tensor<
s64[5]
[0, 3, 6, 9, 12]
>
Nx.power(a, 2)
#Nx.Tensor<
s64[5]
[0, 1, 4, 9, 16]
>
# 2以上の値を1 未満を0
IO.inspect(a)
Nx.greater_equal(a, 2)
#Nx.Tensor<
s64[5]
[0, 1, 2, 3, 4]
>
#Nx.Tensor<
u8[5]
[0, 0, 1, 1, 1]
>
# 一致するもののみ1
IO.inspect(a)
Nx.not_equal(a, 3)
#Nx.Tensor<
s64[5]
[0, 1, 2, 3, 4]
>
#Nx.Tensor<
u8[5]
[1, 1, 1, 0, 1]
>
b = Nx.iota({3, 3})
IO.inspect(b)
Nx.greater(b, 3)
#Nx.Tensor<
s64[3][3]
[
[0, 1, 2],
[3, 4, 5],
[6, 7, 8]
]
>
#Nx.Tensor<
u8[3][3]
[
[0, 0, 0],
[0, 1, 1],
[1, 1, 1]
]
>
ブール値を要素として持つ配列の演算
# a = np.array([10, 20, 30, 40])
# b = np.array([False, True, True, False])
# a[b]
# array([20, 30])
a = Nx.tensor([10, 20, 30, 40])
b = Nx.tensor([0, 1, 1, 0])
Nx.multiply(a, b) |> Nx.to_flat_list() |> Enum.reject(&(&1 == 0)) |> Nx.tensor()
#Nx.Tensor<
s64[2]
[20, 30]
>
条件を指定した要素の抽出
該当する関数なし
配列の演算
u = Nx.iota({4})
#Nx.Tensor<
s64[4]
[0, 1, 2, 3]
>
v = Nx.iota({4}) |> Nx.add(3)
#Nx.Tensor<
s64[4]
[3, 4, 5, 6]
>
IO.inspect(u)
IO.inspect(v)
Nx.add(u, v)
#Nx.Tensor<
s64[4]
[0, 1, 2, 3]
>
#Nx.Tensor<
s64[4]
[3, 4, 5, 6]
>
#Nx.Tensor<
s64[4]
[3, 5, 7, 9]
>
IO.inspect(u)
IO.inspect(v)
Nx.subtract(u, v)
#Nx.Tensor<
s64[4]
[0, 1, 2, 3]
>
#Nx.Tensor<
s64[4]
[3, 4, 5, 6]
>
#Nx.Tensor<
s64[4]
[-3, -3, -3, -3]
>
IO.inspect(u)
IO.inspect(v)
Nx.multiply(u, v)
#Nx.Tensor<
s64[4]
[0, 1, 2, 3]
>
#Nx.Tensor<
s64[4]
[3, 4, 5, 6]
>
#Nx.Tensor<
s64[4]
[0, 4, 10, 18]
>
# ベクトルの内積
IO.inspect(u)
IO.inspect(v)
Nx.dot(u, v)
#Nx.Tensor<
s64[4]
[0, 1, 2, 3]
>
#Nx.Tensor<
s64[4]
[3, 4, 5, 6]
>
#Nx.Tensor<
s64
32
>
Nx.multiply(u, v) |> IO.inspect() |> Nx.sum()
#Nx.Tensor<
s64[4]
[0, 4, 10, 18]
>
#Nx.Tensor<
s64
32
>
2次元配列の演算
a = Nx.iota({3, 3})
#Nx.Tensor<
s64[3][3]
[
[0, 1, 2],
[3, 4, 5],
[6, 7, 8]
]
>
b = Nx.iota({3, 3}) |> Nx.add(4)
#Nx.Tensor<
s64[3][3]
[
[4, 5, 6],
[7, 8, 9],
[10, 11, 12]
]
>
IO.inspect(a)
IO.inspect(b)
Nx.add(a, b)
#Nx.Tensor<
s64[3][3]
[
[0, 1, 2],
[3, 4, 5],
[6, 7, 8]
]
>
#Nx.Tensor<
s64[3][3]
[
[4, 5, 6],
[7, 8, 9],
[10, 11, 12]
]
>
#Nx.Tensor<
s64[3][3]
[
[4, 6, 8],
[10, 12, 14],
[16, 18, 20]
]
>
IO.inspect(a)
IO.inspect(b)
Nx.subtract(a, b)
#Nx.Tensor<
s64[3][3]
[
[0, 1, 2],
[3, 4, 5],
[6, 7, 8]
]
>
#Nx.Tensor<
s64[3][3]
[
[4, 5, 6],
[7, 8, 9],
[10, 11, 12]
]
>
#Nx.Tensor<
s64[3][3]
[
[-4, -4, -4],
[-4, -4, -4],
[-4, -4, -4]
]
>
IO.inspect(a)
IO.inspect(b)
Nx.multiply(a, b)
#Nx.Tensor<
s64[3][3]
[
[0, 1, 2],
[3, 4, 5],
[6, 7, 8]
]
>
#Nx.Tensor<
s64[3][3]
[
[4, 5, 6],
[7, 8, 9],
[10, 11, 12]
]
>
#Nx.Tensor<
s64[3][3]
[
[0, 5, 12],
[21, 32, 45],
[60, 77, 96]
]
>
IO.inspect(a)
IO.inspect(b)
Nx.divide(a, b)
#Nx.Tensor<
s64[3][3]
[
[0, 1, 2],
[3, 4, 5],
[6, 7, 8]
]
>
#Nx.Tensor<
s64[3][3]
[
[4, 5, 6],
[7, 8, 9],
[10, 11, 12]
]
>
#Nx.Tensor<
f32[3][3]
[
[0.0, 0.20000000298023224, 0.3333333432674408],
[0.4285714328289032, 0.5, 0.5555555820465088],
[0.6000000238418579, 0.6363636255264282, 0.6666666865348816]
]
>
IO.inspect(a)
IO.inspect(b)
Nx.dot(a, b)
#Nx.Tensor<
s64[3][3]
[
[0, 1, 2],
[3, 4, 5],
[6, 7, 8]
]
>
#Nx.Tensor<
s64[3][3]
[
[4, 5, 6],
[7, 8, 9],
[10, 11, 12]
]
>
#Nx.Tensor<
s64[3][3]
[
[27, 30, 33],
[90, 102, 114],
[153, 174, 195]
]
>
形状の違う行列の積
a = Nx.iota({3, 3})
#Nx.Tensor<
s64[3][3]
[
[0, 1, 2],
[3, 4, 5],
[6, 7, 8]
]
>
v = Nx.iota({3}) |> Nx.add(1)
#Nx.Tensor<
s64[3]
[1, 2, 3]
>
IO.inspect(a)
IO.inspect(v)
Nx.dot(a, v)
#Nx.Tensor<
s64[3][3]
[
[0, 1, 2],
[3, 4, 5],
[6, 7, 8]
]
>
#Nx.Tensor<
s64[3]
[1, 2, 3]
>
#Nx.Tensor<
s64[3]
[8, 26, 44]
>
IO.inspect(a)
IO.inspect(b)
Nx.dot(v, a)
#Nx.Tensor<
s64[3][3]
[
[0, 1, 2],
[3, 4, 5],
[6, 7, 8]
]
>
#Nx.Tensor<
s64[3][3]
[
[4, 5, 6],
[7, 8, 9],
[10, 11, 12]
]
>
#Nx.Tensor<
s64[3]
[24, 30, 36]
>
u = Nx.new_axis(v, 0) |> Nx.transpose()
IO.inspect(a)
IO.inspect(u)
Nx.dot(a, u)
#Nx.Tensor<
s64[3][3]
[
[0, 1, 2],
[3, 4, 5],
[6, 7, 8]
]
>
#Nx.Tensor<
s64[3][1]
[
[1],
[2],
[3]
]
>
#Nx.Tensor<
s64[3][1]
[
[8],
[26],
[44]
]
>
# error
Nx.dot(u, a)
w = Nx.new_axis(v, 0)
#Nx.Tensor<
s64[1][3]
[
[1, 2, 3]
]
>
IO.inspect(w)
IO.inspect(a)
Nx.dot(w, a)
#Nx.Tensor<
s64[1][3]
[
[1, 2, 3]
]
>
#Nx.Tensor<
s64[3][3]
[
[0, 1, 2],
[3, 4, 5],
[6, 7, 8]
]
>
#Nx.Tensor<
s64[1][3]
[
[24, 30, 36]
]
>
配列同士の演算におけるブロードキャスト
a = Nx.iota({4, 3})
#Nx.Tensor<
s64[4][3]
[
[0, 1, 2],
[3, 4, 5],
[6, 7, 8],
[9, 10, 11]
]
>
b = Nx.iota({1, 3})
#Nx.Tensor<
s64[1][3]
[
[0, 1, 2]
]
>
c = Nx.iota({4, 1})
#Nx.Tensor<
s64[4][1]
[
[0],
[1],
[2],
[3]
]
>
Nx.add(a, b)
#Nx.Tensor<
s64[4][3]
[
[0, 2, 4],
[3, 5, 7],
[6, 8, 10],
[9, 11, 13]
]
>
Nx.multiply(a, c)
#Nx.Tensor<
s64[4][3]
[
[0, 0, 0],
[3, 4, 5],
[12, 14, 16],
[27, 30, 33]
]
>
Nx.subtract(b, c)
#Nx.Tensor<
s64[4][3]
[
[0, 1, 2],
[-1, 0, 1],
[-2, -1, 0],
[-3, -2, -1]
]
>
2次元配列と1次元配列の演算
a = Nx.iota({4, 3})
v = Nx.iota({3})
Nx.add(a, v)
#Nx.Tensor<
s64[4][3]
[
[0, 2, 4],
[3, 5, 7],
[6, 8, 10],
[9, 11, 13]
]
>
04-04疎行列 None
04-05 Numpy/SciPyによる線形代数
逆行列を求める
a = Nx.tensor([[3, 1, 1], [1, 2, 1], [0, -1, 1]])
Nx.LinAlg.invert(a)
#Nx.Tensor<
f32[3][3]
[
[0.4285714328289032, -0.2857142686843872, -0.1428571343421936],
[-0.1428571343421936, 0.4285714328289032, -0.2857142686843872],
[-0.1428571343421936, 0.4285714030265808, 0.714285671710968]
]
>
slove関数を使う
a = Nx.tensor([[3, 1, 1], [1, 2, 1], [0, -1, 1]])
b = Nx.tensor([1, 2, 3])
Nx.LinAlg.solve(a, b)
#Nx.Tensor<
f32[3]
[-0.5714285373687744, -0.14285710453987122, 2.857142686843872]
>
LU分解により連立方程式を解く
a = Nx.tensor([[3, 1, 1], [1, 2, 1], [0, -1, 1]])
b = Nx.tensor([1, 2, 3])
{_p, l, u} = Nx.LinAlg.lu(a)
Nx.dot(l, u) |> Nx.LinAlg.solve(b)
#Nx.Tensor<
f32[3]
[-0.5714285969734192, -0.1428571492433548, 2.857142925262451]
>
04-06 乱数
numpy.randomモジュールを使う
Nx.random_uniform({1}, 0.0, 1.0)
#Nx.Tensor<
f32[1]
[0.15390929579734802]
>
Nx.random_uniform({3, 2}, 0.0, 1.0)
#Nx.Tensor<
f32[3][2]
[
[0.6100258231163025, 0.8514121174812317],
[0.3418392539024353, 0.8625666499137878],
[0.5158955454826355, 0.4589833617210388]
]
>
Nx.random_uniform({1}, 0, 4)
#Nx.Tensor<
s64[1]
[0]
>
Nx.random_uniform({1}, 10, 20)
#Nx.Tensor<
s64[1]
[15]
>
Nx.random_uniform({3, 3}, 0, 5)
#Nx.Tensor<
s64[3][3]
[
[2, 4, 1],
[0, 0, 0],
[4, 3, 1]
]
>
乱数の種を指定する None
04-07 データの可視化
折れ線グラフ
x = [0, 1, 2, 3]
y = [3, 7, 4, 8]
Vl.new(width: 200, height: 200)
|> Vl.data_from_values(x: x, y: y)
|> Vl.mark(:line)
|> Vl.encode_field(:x, "x", type: :quantitative)
|> Vl.encode_field(:y, "y", type: :quantitative)
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"values":[{"x":0,"y":3},{"x":1,"y":7},{"x":2,"y":4},{"x":3,"y":8}]},"encoding":{"x":{"field":"x","type":"quantitative"},"y":{"field":"y","type":"quantitative"}},"height":200,"mark":"line","width":200}
散布図
x = [0, 1, 2, 3]
y = [3, 7, 4, 8]
Vl.new(width: 200, height: 200)
|> Vl.data_from_values(x: x, y: y)
|> Vl.mark(:point)
|> Vl.encode_field(:x, "x", type: :quantitative)
|> Vl.encode_field(:y, "y", type: :quantitative)
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"values":[{"x":0,"y":3},{"x":1,"y":7},{"x":2,"y":4},{"x":3,"y":8}]},"encoding":{"x":{"field":"x","type":"quantitative"},"y":{"field":"y","type":"quantitative"}},"height":200,"mark":"point","width":200}
曲線のグラフ
# np.linspace(-5, 5, 300)
x = Nx.iota({1, 300}) |> Nx.multiply(10 / 300) |> Nx.subtract(5) |> IO.inspect()
y = Nx.power(x, 2) |> IO.inspect()
Vl.new(width: 200, height: 200)
|> Vl.data_from_values(x: Nx.to_flat_list(x), y: Nx.to_flat_list(y))
|> Vl.mark(:line)
|> Vl.encode_field(:x, "x", type: :quantitative)
|> Vl.encode_field(:y, "y", type: :quantitative)
#Nx.Tensor<
f32[1][300]
[
[-5.0, -4.9666666984558105, -4.933333396911621, -4.900000095367432, -4.866666793823242, -4.833333492279053, -4.800000190734863, -4.766666412353516, -4.733333110809326, -4.699999809265137, -4.666666507720947, -4.633333206176758, -4.599999904632568, -4.566666603088379, -4.5333333015441895, -4.5, -4.4666666984558105, -4.433333396911621, -4.400000095367432, -4.366666793823242, -4.333333492279053, -4.300000190734863, -4.266666412353516, -4.233333110809326, -4.199999809265137, -4.166666507720947, -4.133333206176758, -4.099999904632568, -4.066666603088379, -4.0333333015441895, -4.0, -3.9666666984558105, -3.933333396911621, -3.9000000953674316, -3.866666555404663, -3.8333332538604736, -3.799999952316284, -3.7666666507720947, -3.733333110809326, -3.6999998092651367, -3.6666665077209473, -3.633333206176758, -3.5999999046325684, -3.566666603088379, -3.5333333015441895, -3.5, -3.4666666984558105, -3.433333396911621, -3.3999998569488525, -3.366666555404663, ...]
]
>
#Nx.Tensor<
f32[1][300]
[
[25.0, 24.66777801513672, 24.337778091430664, 24.010000228881836, 23.684446334838867, 23.361112594604492, 23.040000915527344, 22.72110939025879, 22.404441833496094, 22.089998245239258, 21.77777671813965, 21.467777252197266, 21.15999984741211, 20.85444450378418, 20.551111221313477, 20.25, 19.95111083984375, 19.65444564819336, 19.360000610351562, 19.067779541015625, 18.77777862548828, 18.490001678466797, 18.204442977905273, 17.921110153198242, 17.639997482299805, 17.36111068725586, 17.084444046020508, 16.809999465942383, 16.537776947021484, 16.267778396606445, 16.0, 15.734444618225098, 15.471111297607422, 15.210000991821289, 14.951109886169434, 14.694443702697754, 14.4399995803833, 14.187777519226074, 13.937776565551758, 13.689998626708984, 13.444443702697754, 13.201109886169434, 12.959999084472656, 12.721110343933105, 12.484444618225098, 12.25, 12.017778396606445, 11.7877779006958, 11.559999465942383, 11.334444046020508, ...]
]
>
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"values":[{"x":-5.0,"y":25.0},{"x":-4.9666666984558105,"y":24.66777801513672},{"x":-4.933333396911621,"y":24.337778091430664},{"x":-4.900000095367432,"y":24.010000228881836},{"x":-4.866666793823242,"y":23.684446334838867},{"x":-4.833333492279053,"y":23.361112594604492},{"x":-4.800000190734863,"y":23.040000915527344},{"x":-4.766666412353516,"y":22.72110939025879},{"x":-4.733333110809326,"y":22.404441833496094},{"x":-4.699999809265137,"y":22.089998245239258},{"x":-4.666666507720947,"y":21.77777671813965},{"x":-4.633333206176758,"y":21.467777252197266},{"x":-4.599999904632568,"y":21.15999984741211},{"x":-4.566666603088379,"y":20.85444450378418},{"x":-4.5333333015441895,"y":20.551111221313477},{"x":-4.5,"y":20.25},{"x":-4.4666666984558105,"y":19.95111083984375},{"x":-4.433333396911621,"y":19.65444564819336},{"x":-4.400000095367432,"y":19.360000610351562},{"x":-4.366666793823242,"y":19.067779541015625},{"x":-4.333333492279053,"y":18.77777862548828},{"x":-4.300000190734863,"y":18.490001678466797},{"x":-4.266666412353516,"y":18.204442977905273},{"x":-4.233333110809326,"y":17.921110153198242},{"x":-4.199999809265137,"y":17.639997482299805},{"x":-4.166666507720947,"y":17.36111068725586},{"x":-4.133333206176758,"y":17.084444046020508},{"x":-4.099999904632568,"y":16.809999465942383},{"x":-4.066666603088379,"y":16.537776947021484},{"x":-4.0333333015441895,"y":16.267778396606445},{"x":-4.0,"y":16.0},{"x":-3.9666666984558105,"y":15.734444618225098},{"x":-3.933333396911621,"y":15.471111297607422},{"x":-3.9000000953674316,"y":15.210000991821289},{"x":-3.866666555404663,"y":14.951109886169434},{"x":-3.8333332538604736,"y":14.694443702697754},{"x":-3.799999952316284,"y":14.4399995803833},{"x":-3.7666666507720947,"y":14.187777519226074},{"x":-3.733333110809326,"y":13.937776565551758},{"x":-3.6999998092651367,"y":13.689998626708984},{"x":-3.6666665077209473,"y":13.444443702697754},{"x":-3.633333206176758,"y":13.201109886169434},{"x":-3.5999999046325684,"y":12.959999084472656},{"x":-3.566666603088379,"y":12.721110343933105},{"x":-3.5333333015441895,"y":12.484444618225098},{"x":-3.5,"y":12.25},{"x":-3.4666666984558105,"y":12.017778396606445},{"x":-3.433333396911621,"y":11.7877779006958},{"x":-3.3999998569488525,"y":11.559999465942383},{"x":-3.366666555404663,"y":11.334444046020508},{"x":-3.3333332538604736,"y":11.11111068725586},{"x":-3.299999952316284,"y":10.889999389648438},{"x":-3.2666664123535156,"y":10.671109199523926},{"x":-3.233333110809326,"y":10.454442977905273},{"x":-3.1999998092651367,"y":10.239998817443848},{"x":-3.1666665077209473,"y":10.027776718139648},{"x":-3.133333206176758,"y":9.817776679992676},{"x":-3.0999999046325684,"y":9.609999656677246},{"x":-3.066666603088379,"y":9.404443740844727},{"x":-3.0333333015441895,"y":9.20111083984375},{"x":-3.0,"y":9.0},{"x":-2.9666664600372314,"y":8.80111026763916},{"x":-2.933333158493042,"y":8.604443550109863},{"x":-2.8999998569488525,"y":8.409998893737793},{"x":-2.866666555404663,"y":8.217777252197266},{"x":-2.8333332538604736,"y":8.027777671813965},{"x":-2.799999952316284,"y":7.839999675750732},{"x":-2.7666666507720947,"y":7.654444217681885},{"x":-2.733333110809326,"y":7.471109867095947},{"x":-2.6999998092651367,"y":7.289999008178711},{"x":-2.6666665077209473,"y":7.111110210418701},{"x":-2.633333206176758,"y":6.934443950653076},{"x":-2.5999999046325684,"y":6.7599992752075195},{"x":-2.566666603088379,"y":6.587777614593506},{"x":-2.5333333015441895,"y":6.4177775382995605},{"x":-2.499999761581421,"y":6.249999046325684},{"x":-2.4666664600372314,"y":6.08444356918335},{"x":-2.433333158493042,"y":5.921110153198242},{"x":-2.3999998569488525,"y":5.7599992752075195},{"x":-2.366666555404663,"y":5.601110458374023},{"x":-2.3333332538604736,"y":5.444444179534912},{"x":-2.299999952316284,"y":5.289999961853027},{"x":-2.2666664123535156,"y":5.137776851654053},{"x":-2.233333110809326,"y":4.987776756286621},{"x":-2.1999998092651367,"y":4.839999198913574},{"x":-2.1666665077209473,"y":4.694443702697754},{"x":-2.133333206176758,"y":4.551110744476318},{"x":-2.0999999046325684,"y":4.409999370574951},{"x":-2.066666603088379,"y":4.271111011505127},{"x":-2.0333330631256104,"y":4.134443283081055},{"x":-1.999999761581421,"y":3.9999990463256836},{"x":-1.9666664600372314,"y":3.867776870727539},{"x":-1.933333158493042,"y":3.7377769947052},{"x":-1.8999998569488525,"y":3.609999418258667},{"x":-1.866666555404663,"y":3.4844441413879395},{"x":-1.8333332538604736,"y":3.3611109256744385},{"x":-1.799999713897705,"y":3.2399990558624268},{"x":-1.7666664123535156,"y":3.121110200881958},{"x":-1.7333331108093262,"y":3.004443645477295},{"x":-1.6999998092651367,"y":2.8899993896484375},{"x":-1.6666665077209473,"y":2.7777771949768066},{"x":-1.6333332061767578,"y":2.6677772998809814},{"x":-1.5999999046325684,"y":2.559999704360962},{"x":-1.566666603088379,"y":2.454444169998169},{"x":-1.5333330631256104,"y":2.3511102199554443},{"x":-1.499999761581421,"y":2.2499992847442627},{"x":-1.4666664600372314,"y":2.1511104106903076},{"x":-1.433333158493042,"y":2.054443836212158},{"x":-1.3999998569488525,"y":1.9599995613098145},{"x":-1.366666555404663,"y":1.8677774667739868},{"x":-1.3333332538604736,"y":1.7777775526046753},{"x":-1.299999713897705,"y":1.6899992227554321},{"x":-1.2666664123535156,"y":1.6044437885284424},{"x":-1.2333331108093262,"y":1.5211105346679688},{"x":-1.1999998092651367,"y":1.4399995803833008},{"x":-1.1666665077209473,"y":1.3611106872558594},{"x":-1.1333332061767578,"y":1.2844442129135132},{"x":-1.0999999046325684,"y":1.2099997997283936},{"x":-1.0666663646697998,"y":1.1377770900726318},{"x":-1.0333330631256104,"y":1.0677772760391235},{"x":-1.0,"y":1.0},{"x":-0.9666662216186523,"y":0.9344435930252075},{"x":-0.9333329200744629,"y":0.8711103200912476},{"x":-0.8999996185302734,"y":0.8099992871284485},{"x":-0.866666316986084,"y":0.7511104941368103},{"x":-0.8333330154418945,"y":0.694443941116333},{"x":-0.7999997138977051,"y":0.6399995684623718},{"x":-0.7666664123535156,"y":0.5877773761749268},{"x":-0.7333331108093262,"y":0.5377774238586426},{"x":-0.6999998092651367,"y":0.4899997413158417},{"x":-0.6666665077209473,"y":0.4444442391395569},{"x":-0.6333332061767578,"y":0.4011109471321106},{"x":-0.5999999046325684,"y":0.3599998950958252},{"x":-0.5666666030883789,"y":0.3211110532283783},{"x":-0.5333333015441895,"y":0.2844444215297699},{"x":-0.5,"y":0.25},{"x":-0.46666622161865234,"y":0.21777735650539398},{"x":-0.4333329200744629,"y":0.18777741491794586},{"x":-0.39999961853027344,"y":0.15999969840049744},{"x":-0.366666316986084,"y":0.1344441920518875},{"x":-0.33333301544189453,"y":0.11111089587211609},{"x":-0.2999997138977051,"y":0.08999982476234436},{"x":-0.2666664123535156,"y":0.07111097872257233},{"x":-0.23333311080932617,"y":0.054444339126348495},{"x":-0.19999980926513672,"y":0.03999992460012436},{"x":-0.16666650772094727,"y":0.027777723968029022},{"x":-0.1333332061767578,"y":0.01777774468064308},{"x":-0.09999990463256836,"y":0.00999998115003109},{"x":-0.0666666030883789,"y":0.00444443617016077},{"x":-0.03333330154418945,"y":0.0011111090425401926},{"x":4.76837158203125e-7,"y":2.2737367544323206e-13},{"x":0.033333778381347656,"y":0.0011111408239230514},{"x":0.06666707992553711,"y":0.004444499500095844},{"x":0.10000038146972656,"y":0.0100000761449337},{"x":0.13333368301391602,"y":0.01777787134051323},{"x":0.16666698455810547,"y":0.027777884155511856},{"x":0.20000028610229492,"y":0.04000011458992958},{"x":0.23333358764648438,"y":0.0544445626437664},{"x":0.26666688919067383,"y":0.07111123204231262},{"x":0.3000001907348633,"y":0.09000011533498764},{"x":0.33333349227905273,"y":0.11111121624708176},{"x":0.3666667938232422,"y":0.13444453477859497},{"x":0.40000009536743164,"y":0.16000007092952728},{"x":0.4333333969116211,"y":0.1877778321504593},{"x":0.46666717529296875,"y":0.2177782505750656},{"x":0.5000004768371582,"y":0.2500004768371582},{"x":0.5333337783813477,"y":0.2844449281692505},{"x":0.5666670799255371,"y":0.3211115896701813},{"x":0.6000003814697266,"y":0.36000046133995056},{"x":0.633333683013916,"y":0.40111154317855835},{"x":0.6666669845581055,"y":0.444444864988327},{"x":0.7000002861022949,"y":0.4900003969669342},{"x":0.7333335876464844,"y":0.5377781391143799},{"x":0.7666668891906738,"y":0.5877780914306641},{"x":0.8000001907348633,"y":0.6400002837181091},{"x":0.8333334922790527,"y":0.6944447159767151},{"x":0.8666667938232422,"y":0.7511113286018372},{"x":0.9000000953674316,"y":0.8100001811981201},{"x":0.9333338737487793,"y":0.8711121082305908},{"x":0.9666671752929688,"y":0.9344454407691956},{"x":1.0000004768371582,"y":1.0000009536743164},{"x":1.0333337783813477,"y":1.0677787065505981},{"x":1.066667079925537,"y":1.137778639793396},{"x":1.1000003814697266,"y":1.2100008726119995},{"x":1.133333683013916,"y":1.2844452857971191},{"x":1.1666669845581055,"y":1.3611118793487549},{"x":1.200000286102295,"y":1.4400006532669067},{"x":1.2333335876464844,"y":1.5211117267608643},{"x":1.2666668891906738,"y":1.604444980621338},{"x":1.3000001907348633,"y":1.6900005340576172},{"x":1.3333334922790527,"y":1.777778148651123},{"x":1.3666667938232422,"y":1.8677781820297241},{"x":1.4000005722045898,"y":1.9600015878677368},{"x":1.4333338737487793,"y":2.05444598197937},{"x":1.4666671752929688,"y":2.1511125564575195},{"x":1.5000004768371582,"y":2.2500014305114746},{"x":1.5333337783813477,"y":2.3511123657226562},{"x":1.566667079925537,"y":2.4544458389282227},{"x":1.6000003814697266,"y":2.5600011348724365},{"x":1.633333683013916,"y":2.667778968811035},{"x":1.6666669845581055,"y":2.7777788639068604},{"x":1.700000286102295,"y":2.890001058578491},{"x":1.7333335876464844,"y":3.0044453144073486},{"x":1.7666668891906738,"y":3.1211118698120117},{"x":1.8000001907348633,"y":3.2400007247924805},{"x":1.8333334922790527,"y":3.361111640930176},{"x":1.8666667938232422,"y":3.4844448566436768},{"x":1.9000005722045898,"y":3.610002279281616},{"x":1.9333338737487793,"y":3.7377798557281494},{"x":1.9666671752929688,"y":3.8677797317504883},{"x":2.000000476837158,"y":4.000001907348633},{"x":2.0333337783813477,"y":4.134446144104004},{"x":2.066667079925537,"y":4.27111291885376},{"x":2.1000003814697266,"y":4.410001754760742},{"x":2.133333683013916,"y":4.551112651824951},{"x":2.1666669845581055,"y":4.694445610046387},{"x":2.200000286102295,"y":4.840001106262207},{"x":2.2333335876464844,"y":4.987779140472412},{"x":2.266666889190674,"y":5.1377787590026855},{"x":2.3000001907348633,"y":5.290000915527344},{"x":2.3333334922790527,"y":5.4444451332092285},{"x":2.3666672706604004,"y":5.601113796234131},{"x":2.40000057220459,"y":5.760002613067627},{"x":2.4333338737487793,"y":5.921113967895508},{"x":2.4666671752929688,"y":6.084446907043457},{"x":2.500000476837158,"y":6.250002384185791},{"x":2.5333337783813477,"y":6.417779922485352},{"x":2.566667079925537,"y":6.587779998779297},{"x":2.6000003814697266,"y":6.760002136230469},{"x":2.633333683013916,"y":6.934446334838867},{"x":2.6666669845581055,"y":7.111112594604492},{"x":2.700000286102295,"y":7.290001392364502},{"x":2.7333335876464844,"y":7.4711127281188965},{"x":2.766666889190674,"y":7.654445648193359},{"x":2.8000001907348633,"y":7.840001106262207},{"x":2.833333969116211,"y":8.02778148651123},{"x":2.8666672706604004,"y":8.217781066894531},{"x":2.90000057220459,"y":8.410003662109375},{"x":2.9333338737487793,"y":8.604447364807129},{"x":2.9666671752929688,"y":8.801114082336426},{"x":3.0,"y":9.0},{"x":3.0333337783813477,"y":9.2011137008667},{"x":3.0666675567626953,"y":9.404449462890625},{"x":3.1000003814697266,"y":9.610002517700195},{"x":3.133334159851074,"y":9.81778335571289},{"x":3.1666669845581055,"y":10.027779579162598},{"x":3.200000762939453,"y":10.240004539489746},{"x":3.2333335876464844,"y":10.454445838928223},{"x":3.266667366027832,"y":10.67111587524414},{"x":3.3000001907348633,"y":10.89000129699707},{"x":3.333333969116211,"y":11.111115455627441},{"x":3.366666793823242,"y":11.334444999694824},{"x":3.40000057220459,"y":11.560004234313965},{"x":3.433333396911621,"y":11.7877779006958},{"x":3.4666671752929688,"y":12.017781257629395},{"x":3.5,"y":12.25},{"x":3.5333337783813477,"y":12.484447479248047},{"x":3.5666675567626953,"y":12.72111701965332},{"x":3.6000003814697266,"y":12.960002899169922},{"x":3.633334159851074,"y":13.201117515563965},{"x":3.6666669845581055,"y":13.444446563720703},{"x":3.700000762939453,"y":13.6900053024292},{"x":3.7333335876464844,"y":13.937779426574707},{"x":3.766667366027832,"y":14.187783241271973},{"x":3.8000001907348633,"y":14.440001487731934},{"x":3.833333969116211,"y":14.694449424743652},{"x":3.866666793823242,"y":14.951111793518066},{"x":3.90000057220459,"y":15.210004806518555},{"x":3.933333396911621,"y":15.471111297607422},{"x":3.9666671752929688,"y":15.734448432922363},{"x":4.0,"y":16.0},{"x":4.033333778381348,"y":16.26778221130371},{"x":4.066667556762695,"y":16.537784576416016},{"x":4.100000381469727,"y":16.81000328063965},{"x":4.133334159851074,"y":17.08445167541504},{"x":4.1666669845581055,"y":17.361114501953125},{"x":4.200000762939453,"y":17.64000701904297},{"x":4.233333587646484,"y":17.921113967895508},{"x":4.266667366027832,"y":18.204450607299805},{"x":4.300000190734863,"y":18.490001678466797},{"x":4.333333969116211,"y":18.777782440185547},{"x":4.366666793823242,"y":19.067779541015625},{"x":4.40000057220459,"y":19.360004425048828},{"x":4.433333396911621,"y":19.65444564819336},{"x":4.466667175292969,"y":19.95111656188965},{"x":4.500000953674316,"y":20.250009536743164},{"x":4.533333778381348,"y":20.551115036010742},{"x":4.566667556762695,"y":20.85445213317871},{"x":4.600000381469727,"y":21.160003662109375},{"x":4.633334159851074,"y":21.467784881591797},{"x":4.6666669845581055,"y":21.777780532836914},{"x":4.700000762939453,"y":22.090007781982422},{"x":4.733333587646484,"y":22.404447555541992},{"x":4.766667366027832,"y":22.72111701965332},{"x":4.800000190734863,"y":23.040000915527344},{"x":4.833333969116211,"y":23.361116409301758},{"x":4.866666793823242,"y":23.684446334838867},{"x":4.90000057220459,"y":24.010005950927734},{"x":4.933333396911621,"y":24.337778091430664},{"x":4.966667175292969,"y":24.667783737182617}]},"encoding":{"x":{"field":"x","type":"quantitative"},"y":{"field":"y","type":"quantitative"}},"height":200,"mark":"line","width":200}
複数の線を表示する
# np.linspace(-5, 5, 300)
x = Nx.iota({1, 300}) |> Nx.multiply(10 / 300) |> Nx.subtract(5)
y1 = Nx.power(x, 2) |> Nx.to_flat_list()
y2 = Nx.subtract(x, 2) |> Nx.power(2) |> Nx.to_flat_list()
Vl.new(width: 200, height: 200)
|> Vl.data_from_values(x: Nx.to_flat_list(x), y1: y1, y2: y2)
|> Vl.layers([
Vl.new()
|> Vl.mark(:line, color: :red)
|> Vl.encode_field(:x, "x", type: :quantitative)
|> Vl.encode_field(:y, "y1", type: :quantitative),
Vl.new()
|> Vl.mark(:line, color: :black, stroke_dash: [6, 4])
|> Vl.encode_field(:x, "x", type: :quantitative)
|> Vl.encode_field(:y, "y2", type: :quantitative)
])
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"values":[{"x":-5.0,"y1":25.0,"y2":49.0},{"x":-4.9666666984558105,"y1":24.66777801513672,"y2":48.534446716308594},{"x":-4.933333396911621,"y1":24.337778091430664,"y2":48.07111358642578},{"x":-4.900000095367432,"y1":24.010000228881836,"y2":47.61000061035156},{"x":-4.866666793823242,"y1":23.684446334838867,"y2":47.1511116027832},{"x":-4.833333492279053,"y1":23.361112594604492,"y2":46.6944465637207},{"x":-4.800000190734863,"y1":23.040000915527344,"y2":46.2400016784668},{"x":-4.766666412353516,"y1":22.72110939025879,"y2":45.78777313232422},{"x":-4.733333110809326,"y1":22.404441833496094,"y2":45.33777618408203},{"x":-4.699999809265137,"y1":22.089998245239258,"y2":44.88999557495117},{"x":-4.666666507720947,"y1":21.77777671813965,"y2":44.44444274902344},{"x":-4.633333206176758,"y1":21.467777252197266,"y2":44.0011100769043},{"x":-4.599999904632568,"y1":21.15999984741211,"y2":43.55999755859375},{"x":-4.566666603088379,"y1":20.85444450378418,"y2":43.12110900878906},{"x":-4.5333333015441895,"y1":20.551111221313477,"y2":42.684444427490234},{"x":-4.5,"y1":20.25,"y2":42.25},{"x":-4.4666666984558105,"y1":19.95111083984375,"y2":41.817779541015625},{"x":-4.433333396911621,"y1":19.65444564819336,"y2":41.387779235839844},{"x":-4.400000095367432,"y1":19.360000610351562,"y2":40.96000289916992},{"x":-4.366666793823242,"y1":19.067779541015625,"y2":40.534446716308594},{"x":-4.333333492279053,"y1":18.77777862548828,"y2":40.111114501953125},{"x":-4.300000190734863,"y1":18.490001678466797,"y2":39.69000244140625},{"x":-4.266666412353516,"y1":18.204442977905273,"y2":39.2711067199707},{"x":-4.233333110809326,"y1":17.921110153198242,"y2":38.85444259643555},{"x":-4.199999809265137,"y1":17.639997482299805,"y2":38.439998626708984},{"x":-4.166666507720947,"y1":17.36111068725586,"y2":38.027774810791016},{"x":-4.133333206176758,"y1":17.084444046020508,"y2":37.617774963378906},{"x":-4.099999904632568,"y1":16.809999465942383,"y2":37.209999084472656},{"x":-4.066666603088379,"y1":16.537776947021484,"y2":36.804443359375},{"x":-4.0333333015441895,"y1":16.267778396606445,"y2":36.4011116027832},{"x":-4.0,"y1":16.0,"y2":36.0},{"x":-3.9666666984558105,"y1":15.734444618225098,"y2":35.601112365722656},{"x":-3.933333396911621,"y1":15.471111297607422,"y2":35.204444885253906},{"x":-3.9000000953674316,"y1":15.210000991821289,"y2":34.810001373291016},{"x":-3.866666555404663,"y1":14.951109886169434,"y2":34.41777801513672},{"x":-3.8333332538604736,"y1":14.694443702697754,"y2":34.027774810791016},{"x":-3.799999952316284,"y1":14.4399995803833,"y2":33.6400032043457},{"x":-3.7666666507720947,"y1":14.187777519226074,"y2":33.25444030761719},{"x":-3.733333110809326,"y1":13.937776565551758,"y2":32.87110900878906},{"x":-3.6999998092651367,"y1":13.689998626708984,"y2":32.48999786376953},{"x":-3.6666665077209473,"y1":13.444443702697754,"y2":32.11111068725586},{"x":-3.633333206176758,"y1":13.201109886169434,"y2":31.73444366455078},{"x":-3.5999999046325684,"y1":12.959999084472656,"y2":31.35999870300293},{"x":-3.566666603088379,"y1":12.721110343933105,"y2":30.987777709960938},{"x":-3.5333333015441895,"y1":12.484444618225098,"y2":30.61777687072754},{"x":-3.5,"y1":12.25,"y2":30.25},{"x":-3.4666666984558105,"y1":12.017778396606445,"y2":29.884445190429688},{"x":-3.433333396911621,"y1":11.7877779006958,"y2":29.5211124420166},{"x":-3.3999998569488525,"y1":11.559999465942383,"y2":29.159996032714844},{"x":-3.366666555404663,"y1":11.334444046020508,"y2":28.80111312866211},{"x":-3.3333332538604736,"y1":11.11111068725586,"y2":28.444440841674805},{"x":-3.299999952316284,"y1":10.889999389648438,"y2":28.090002059936523},{"x":-3.2666664123535156,"y1":10.671109199523926,"y2":27.737775802612305},{"x":-3.233333110809326,"y1":10.454442977905273,"y2":27.387775421142578},{"x":-3.1999998092651367,"y1":10.239998817443848,"y2":27.039997100830078},{"x":-3.1666665077209473,"y1":10.027776718139648,"y2":26.694442749023438},{"x":-3.133333206176758,"y1":9.817776679992676,"y2":26.351110458374023},{"x":-3.0999999046325684,"y1":9.609999656677246,"y2":26.009998321533203},{"x":-3.066666603088379,"y1":9.404443740844727,"y2":25.671110153198242},{"x":-3.0333333015441895,"y1":9.20111083984375,"y2":25.334444046020508},{"x":-3.0,"y1":9.0,"y2":25.0},{"x":-2.9666664600372314,"y1":8.80111026763916,"y2":24.667774200439453},{"x":-2.933333158493042,"y1":8.604443550109863,"y2":24.337778091430664},{"x":-2.8999998569488525,"y1":8.409998893737793,"y2":24.00999641418457},{"x":-2.866666555404663,"y1":8.217777252197266,"y2":23.684446334838867},{"x":-2.8333332538604736,"y1":8.027777671813965,"y2":23.361108779907227},{"x":-2.799999952316284,"y1":7.839999675750732,"y2":23.040000915527344},{"x":-2.7666666507720947,"y1":7.654444217681885,"y2":22.72110939025879},{"x":-2.733333110809326,"y1":7.471109867095947,"y2":22.404441833496094},{"x":-2.6999998092651367,"y1":7.289999008178711,"y2":22.089998245239258},{"x":-2.6666665077209473,"y1":7.111110210418701,"y2":21.77777671813965},{"x":-2.633333206176758,"y1":6.934443950653076,"y2":21.467777252197266},{"x":-2.5999999046325684,"y1":6.7599992752075195,"y2":21.15999984741211},{"x":-2.566666603088379,"y1":6.587777614593506,"y2":20.85444450378418},{"x":-2.5333333015441895,"y1":6.4177775382995605,"y2":20.551111221313477},{"x":-2.499999761581421,"y1":6.249999046325684,"y2":20.25},{"x":-2.4666664600372314,"y1":6.08444356918335,"y2":19.951107025146484},{"x":-2.433333158493042,"y1":5.921110153198242,"y2":19.65444564819336},{"x":-2.3999998569488525,"y1":5.7599992752075195,"y2":19.359996795654297},{"x":-2.366666555404663,"y1":5.601110458374023,"y2":19.067779541015625},{"x":-2.3333332538604736,"y1":5.444444179534912,"y2":18.777774810791016},{"x":-2.299999952316284,"y1":5.289999961853027,"y2":18.490001678466797},{"x":-2.2666664123535156,"y1":5.137776851654053,"y2":18.204442977905273},{"x":-2.233333110809326,"y1":4.987776756286621,"y2":17.921110153198242},{"x":-2.1999998092651367,"y1":4.839999198913574,"y2":17.639997482299805},{"x":-2.1666665077209473,"y1":4.694443702697754,"y2":17.36111068725586},{"x":-2.133333206176758,"y1":4.551110744476318,"y2":17.084444046020508},{"x":-2.0999999046325684,"y1":4.409999370574951,"y2":16.809999465942383},{"x":-2.066666603088379,"y1":4.271111011505127,"y2":16.537776947021484},{"x":-2.0333330631256104,"y1":4.134443283081055,"y2":16.26777458190918},{"x":-1.999999761581421,"y1":3.9999990463256836,"y2":15.999998092651367},{"x":-1.9666664600372314,"y1":3.867776870727539,"y2":15.734442710876465},{"x":-1.933333158493042,"y1":3.7377769947052,"y2":15.471109390258789},{"x":-1.8999998569488525,"y1":3.609999418258667,"y2":15.209999084472656},{"x":-1.866666555404663,"y1":3.4844441413879395,"y2":14.951109886169434},{"x":-1.8333332538604736,"y1":3.3611109256744385,"y2":14.694443702697754},{"x":-1.799999713897705,"y1":3.2399990558624268,"y2":14.439997673034668},{"x":-1.7666664123535156,"y1":3.121110200881958,"y2":14.187775611877441},{"x":-1.7333331108093262,"y1":3.004443645477295,"y2":13.937776565551758},{"x":-1.6999998092651367,"y1":2.8899993896484375,"y2":13.689998626708984},{"x":-1.6666665077209473,"y1":2.7777771949768066,"y2":13.444443702697754},{"x":-1.6333332061767578,"y1":2.6677772998809814,"y2":13.201109886169434},{"x":-1.5999999046325684,"y1":2.559999704360962,"y2":12.959999084472656},{"x":-1.566666603088379,"y1":2.454444169998169,"y2":12.721110343933105},{"x":-1.5333330631256104,"y1":2.3511102199554443,"y2":12.484442710876465},{"x":-1.499999761581421,"y1":2.2499992847442627,"y2":12.249998092651367},{"x":-1.4666664600372314,"y1":2.1511104106903076,"y2":12.017776489257812},{"x":-1.433333158493042,"y1":2.054443836212158,"y2":11.787776947021484},{"x":-1.3999998569488525,"y1":1.9599995613098145,"y2":11.559999465942383},{"x":-1.366666555404663,"y1":1.8677774667739868,"y2":11.334444046020508},{"x":-1.3333332538604736,"y1":1.7777775526046753,"y2":11.11111068725586},{"x":-1.299999713897705,"y1":1.6899992227554321,"y2":10.889998435974121},{"x":-1.2666664123535156,"y1":1.6044437885284424,"y2":10.671109199523926},{"x":-1.2333331108093262,"y1":1.5211105346679688,"y2":10.454442977905273},{"x":-1.1999998092651367,"y1":1.4399995803833008,"y2":10.239998817443848},{"x":-1.1666665077209473,"y1":1.3611106872558594,"y2":10.027776718139648},{"x":-1.1333332061767578,"y1":1.2844442129135132,"y2":9.817776679992676},{"x":-1.0999999046325684,"y1":1.2099997997283936,"y2":9.609999656677246},{"x":-1.0666663646697998,"y1":1.1377770900726318,"y2":9.40444278717041},{"x":-1.0333330631256104,"y1":1.0677772760391235,"y2":9.201109886169434},{"x":-1.0,"y1":1.0,"y2":9.0},{"x":-0.9666662216186523,"y1":0.9344435930252075,"y2":8.801108360290527},{"x":-0.9333329200744629,"y1":0.8711103200912476,"y2":8.60444164276123},{"x":-0.8999996185302734,"y1":0.8099992871284485,"y2":8.409997940063477},{"x":-0.866666316986084,"y1":0.7511104941368103,"y2":8.217775344848633},{"x":-0.8333330154418945,"y1":0.694443941116333,"y2":8.027775764465332},{"x":-0.7999997138977051,"y1":0.6399995684623718,"y2":7.839998245239258},{"x":-0.7666664123535156,"y1":0.5877773761749268,"y2":7.654443264007568},{"x":-0.7333331108093262,"y1":0.5377774238586426,"y2":7.471109867095947},{"x":-0.6999998092651367,"y1":0.4899997413158417,"y2":7.289999008178711},{"x":-0.6666665077209473,"y1":0.4444442391395569,"y2":7.111110210418701},{"x":-0.6333332061767578,"y1":0.4011109471321106,"y2":6.934443950653076},{"x":-0.5999999046325684,"y1":0.3599998950958252,"y2":6.7599992752075195},{"x":-0.5666666030883789,"y1":0.3211110532283783,"y2":6.587777614593506},{"x":-0.5333333015441895,"y1":0.2844444215297699,"y2":6.4177775382995605},{"x":-0.5,"y1":0.25,"y2":6.25},{"x":-0.46666622161865234,"y1":0.21777735650539398,"y2":6.084442138671875},{"x":-0.4333329200744629,"y1":0.18777741491794586,"y2":5.921109199523926},{"x":-0.39999961853027344,"y1":0.15999969840049744,"y2":5.759998321533203},{"x":-0.366666316986084,"y1":0.1344441920518875,"y2":5.601109504699707},{"x":-0.33333301544189453,"y1":0.11111089587211609,"y2":5.4444427490234375},{"x":-0.2999997138977051,"y1":0.08999982476234436,"y2":5.289998531341553},{"x":-0.2666664123535156,"y1":0.07111097872257233,"y2":5.137776851654053},{"x":-0.23333311080932617,"y1":0.054444339126348495,"y2":4.987776756286621},{"x":-0.19999980926513672,"y1":0.03999992460012436,"y2":4.839999198913574},{"x":-0.16666650772094727,"y1":0.027777723968029022,"y2":4.694443702697754},{"x":-0.1333332061767578,"y1":0.01777774468064308,"y2":4.551110744476318},{"x":-0.09999990463256836,"y1":0.00999998115003109,"y2":4.409999370574951},{"x":-0.0666666030883789,"y1":0.00444443617016077,"y2":4.271111011505127},{"x":-0.03333330154418945,"y1":0.0011111090425401926,"y2":4.134444236755371},{"x":4.76837158203125e-7,"y1":2.2737367544323206e-13,"y2":3.999998092651367},{"x":0.033333778381347656,"y1":0.0011111408239230514,"y2":3.8677759170532227},{"x":0.06666707992553711,"y1":0.004444499500095844,"y2":3.737776279449463},{"x":0.10000038146972656,"y1":0.0100000761449337,"y2":3.6099984645843506},{"x":0.13333368301391602,"y1":0.01777787134051323,"y2":3.484443187713623},{"x":0.16666698455810547,"y1":0.027777884155511856,"y2":3.361109972000122},{"x":0.20000028610229492,"y1":0.04000011458992958,"y2":3.2399990558624268},{"x":0.23333358764648438,"y1":0.0544445626437664,"y2":3.121110200881958},{"x":0.26666688919067383,"y1":0.07111123204231262,"y2":3.004443645477295},{"x":0.3000001907348633,"y1":0.09000011533498764,"y2":2.8899993896484375},{"x":0.33333349227905273,"y1":0.11111121624708176,"y2":2.7777771949768066},{"x":0.3666667938232422,"y1":0.13444453477859497,"y2":2.6677772998809814},{"x":0.40000009536743164,"y1":0.16000007092952728,"y2":2.559999704360962},{"x":0.4333333969116211,"y1":0.1877778321504593,"y2":2.454444169998169},{"x":0.46666717529296875,"y1":0.2177782505750656,"y2":2.351109504699707},{"x":0.5000004768371582,"y1":0.2500004768371582,"y2":2.2499985694885254},{"x":0.5333337783813477,"y1":0.2844449281692505,"y2":2.1511096954345703},{"x":0.5666670799255371,"y1":0.3211115896701813,"y2":2.054443359375},{"x":0.6000003814697266,"y1":0.36000046133995056,"y2":1.9599989652633667},{"x":0.633333683013916,"y1":0.40111154317855835,"y2":1.867776870727539},{"x":0.6666669845581055,"y1":0.444444864988327,"y2":1.7777769565582275},{"x":0.7000002861022949,"y1":0.4900003969669342,"y2":1.6899992227554321},{"x":0.7333335876464844,"y1":0.5377781391143799,"y2":1.6044437885284424},{"x":0.7666668891906738,"y1":0.5877780914306641,"y2":1.5211105346679688},{"x":0.8000001907348633,"y1":0.6400002837181091,"y2":1.4399995803833008},{"x":0.8333334922790527,"y1":0.6944447159767151,"y2":1.3611106872558594},{"x":0.8666667938232422,"y1":0.7511113286018372,"y2":1.2844442129135132},{"x":0.9000000953674316,"y1":0.8100001811981201,"y2":1.2099997997283936},{"x":0.9333338737487793,"y1":0.8711121082305908,"y2":1.1377766132354736},{"x":0.9666671752929688,"y1":0.9344454407691956,"y2":1.0677766799926758},{"x":1.0000004768371582,"y1":1.0000009536743164,"y2":0.9999990463256836},{"x":1.0333337783813477,"y1":1.0677787065505981,"y2":0.9344435930252075},{"x":1.066667079925537,"y1":1.137778639793396,"y2":0.8711103200912476},{"x":1.1000003814697266,"y1":1.2100008726119995,"y2":0.8099992871284485},{"x":1.133333683013916,"y1":1.2844452857971191,"y2":0.7511104941368103},{"x":1.1666669845581055,"y1":1.3611118793487549,"y2":0.694443941116333},{"x":1.200000286102295,"y1":1.4400006532669067,"y2":0.6399995684623718},{"x":1.2333335876464844,"y1":1.5211117267608643,"y2":0.5877773761749268},{"x":1.2666668891906738,"y1":1.604444980621338,"y2":0.5377774238586426},{"x":1.3000001907348633,"y1":1.6900005340576172,"y2":0.4899997413158417},{"x":1.3333334922790527,"y1":1.777778148651123,"y2":0.4444442391395569},{"x":1.3666667938232422,"y1":1.8677781820297241,"y2":0.4011109471321106},{"x":1.4000005722045898,"y1":1.9600015878677368,"y2":0.35999929904937744},{"x":1.4333338737487793,"y1":2.05444598197937,"y2":0.32111048698425293},{"x":1.4666671752929688,"y1":2.1511125564575195,"y2":0.2844439148902893},{"x":1.5000004768371582,"y1":2.2500014305114746,"y2":0.2499995231628418},{"x":1.5333337783813477,"y1":2.3511123657226562,"y2":0.21777735650539398},{"x":1.566667079925537,"y1":2.4544458389282227,"y2":0.18777741491794586},{"x":1.6000003814697266,"y1":2.5600011348724365,"y2":0.15999969840049744},{"x":1.633333683013916,"y1":2.667778968811035,"y2":0.1344441920518875},{"x":1.6666669845581055,"y1":2.7777788639068604,"y2":0.11111089587211609},{"x":1.700000286102295,"y1":2.890001058578491,"y2":0.08999982476234436},{"x":1.7333335876464844,"y1":3.0044453144073486,"y2":0.07111097872257233},{"x":1.7666668891906738,"y1":3.1211118698120117,"y2":0.054444339126348495},{"x":1.8000001907348633,"y1":3.2400007247924805,"y2":0.03999992460012436},{"x":1.8333334922790527,"y1":3.361111640930176,"y2":0.027777723968029022},{"x":1.8666667938232422,"y1":3.4844448566436768,"y2":0.01777774468064308},{"x":1.9000005722045898,"y1":3.610002279281616,"y2":0.009999885223805904},{"x":1.9333338737487793,"y1":3.7377798557281494,"y2":0.004444372374564409},{"x":1.9666671752929688,"y1":3.8677797317504883,"y2":0.001111077144742012},{"x":2.000000476837158,"y1":4.000001907348633,"y2":2.2737367544323206e-13},{"x":2.0333337783813477,"y1":4.134446144104004,"y2":0.0011111408239230514},{"x":2.066667079925537,"y1":4.27111291885376,"y2":0.004444499500095844},{"x":2.1000003814697266,"y1":4.410001754760742,"y2":0.0100000761449337},{"x":2.133333683013916,"y1":4.551112651824951,"y2":0.01777787134051323},{"x":2.1666669845581055,"y1":4.694445610046387,"y2":0.027777884155511856},{"x":2.200000286102295,"y1":4.840001106262207,"y2":0.04000011458992958},{"x":2.2333335876464844,"y1":4.987779140472412,"y2":0.0544445626437664},{"x":2.266666889190674,"y1":5.1377787590026855,"y2":0.07111123204231262},{"x":2.3000001907348633,"y1":5.290000915527344,"y2":0.09000011533498764},{"x":2.3333334922790527,"y1":5.4444451332092285,"y2":0.11111121624708176},{"x":2.3666672706604004,"y1":5.601113796234131,"y2":0.13444489240646362},{"x":2.40000057220459,"y1":5.760002613067627,"y2":0.16000045835971832},{"x":2.4333338737487793,"y1":5.921113967895508,"y2":0.18777824938297272},{"x":2.4666671752929688,"y1":6.084446907043457,"y2":0.2177782505750656},{"x":2.500000476837158,"y1":6.250002384185791,"y2":0.2500004768371582},{"x":2.5333337783813477,"y1":6.417779922485352,"y2":0.2844449281692505},{"x":2.566667079925537,"y1":6.587779998779297,"y2":0.3211115896701813},{"x":2.6000003814697266,"y1":6.760002136230469,"y2":0.36000046133995056},{"x":2.633333683013916,"y1":6.934446334838867,"y2":0.40111154317855835},{"x":2.6666669845581055,"y1":7.111112594604492,"y2":0.444444864988327},{"x":2.700000286102295,"y1":7.290001392364502,"y2":0.4900003969669342},{"x":2.7333335876464844,"y1":7.4711127281188965,"y2":0.5377781391143799},{"x":2.766666889190674,"y1":7.654445648193359,"y2":0.5877780914306641},{"x":2.8000001907348633,"y1":7.840001106262207,"y2":0.6400002837181091},{"x":2.833333969116211,"y1":8.02778148651123,"y2":0.6944454908370972},{"x":2.8666672706604004,"y1":8.217781066894531,"y2":0.751112163066864},{"x":2.90000057220459,"y1":8.410003662109375,"y2":0.810001015663147},{"x":2.9333338737487793,"y1":8.604447364807129,"y2":0.8711121082305908},{"x":2.9666671752929688,"y1":8.801114082336426,"y2":0.9344454407691956},{"x":3.0,"y1":9.0,"y2":1.0},{"x":3.0333337783813477,"y1":9.2011137008667,"y2":1.0677787065505981},{"x":3.0666675567626953,"y1":9.404449462890625,"y2":1.137779712677002},{"x":3.1000003814697266,"y1":9.610002517700195,"y2":1.2100008726119995},{"x":3.133334159851074,"y1":9.81778335571289,"y2":1.284446358680725},{"x":3.1666669845581055,"y1":10.027779579162598,"y2":1.3611118793487549},{"x":3.200000762939453,"y1":10.240004539489746,"y2":1.4400018453598022},{"x":3.2333335876464844,"y1":10.454445838928223,"y2":1.5211117267608643},{"x":3.266667366027832,"y1":10.67111587524414,"y2":1.6044461727142334},{"x":3.3000001907348633,"y1":10.89000129699707,"y2":1.6900005340576172},{"x":3.333333969116211,"y1":11.111115455627441,"y2":1.777779459953308},{"x":3.366666793823242,"y1":11.334444999694824,"y2":1.8677781820297241},{"x":3.40000057220459,"y1":11.560004234313965,"y2":1.9600015878677368},{"x":3.433333396911621,"y1":11.7877779006958,"y2":2.0544445514678955},{"x":3.4666671752929688,"y1":12.017781257629395,"y2":2.1511125564575195},{"x":3.5,"y1":12.25,"y2":2.25},{"x":3.5333337783813477,"y1":12.484447479248047,"y2":2.3511123657226562},{"x":3.5666675567626953,"y1":12.72111701965332,"y2":2.4544472694396973},{"x":3.6000003814697266,"y1":12.960002899169922,"y2":2.5600011348724365},{"x":3.633334159851074,"y1":13.201117515563965,"y2":2.6677803993225098},{"x":3.6666669845581055,"y1":13.444446563720703,"y2":2.7777788639068604},{"x":3.700000762939453,"y1":13.6900053024292,"y2":2.890002489089966},{"x":3.7333335876464844,"y1":13.937779426574707,"y2":3.0044453144073486},{"x":3.766667366027832,"y1":14.187783241271973,"y2":3.1211135387420654},{"x":3.8000001907348633,"y1":14.440001487731934,"y2":3.2400007247924805},{"x":3.833333969116211,"y1":14.694449424743652,"y2":3.3611135482788086},{"x":3.866666793823242,"y1":14.951111793518066,"y2":3.4844448566436768},{"x":3.90000057220459,"y1":15.210004806518555,"y2":3.610002279281616},{"x":3.933333396911621,"y1":15.471111297607422,"y2":3.7377779483795166},{"x":3.9666671752929688,"y1":15.734448432922363,"y2":3.8677797317504883},{"x":4.0,"y1":16.0,"y2":4.0},{"x":4.033333778381348,"y1":16.26778221130371,"y2":4.134446144104004},{"x":4.066667556762695,"y1":16.537784576416016,"y2":4.271114826202393},{"x":4.100000381469727,"y1":16.81000328063965,"y2":4.410001754760742},{"x":4.133334159851074,"y1":17.08445167541504,"y2":4.551114559173584},{"x":4.1666669845581055,"y1":17.361114501953125,"y2":4.694445610046387},{"x":4.200000762939453,"y1":17.64000701904297,"y2":4.840003490447998},{"x":4.233333587646484,"y1":17.921113967895508,"y2":4.987779140472412},{"x":4.266667366027832,"y1":18.204450607299805,"y2":5.137781143188477},{"x":4.300000190734863,"y1":18.490001678466797,"y2":5.290000915527344},{"x":4.333333969116211,"y1":18.777782440185547,"y2":5.4444475173950195},{"x":4.366666793823242,"y1":19.067779541015625,"y2":5.601111888885498},{"x":4.40000057220459,"y1":19.360004425048828,"y2":5.760002613067627},{"x":4.433333396911621,"y1":19.65444564819336,"y2":5.921111583709717},{"x":4.466667175292969,"y1":19.95111656188965,"y2":6.084446907043457},{"x":4.500000953674316,"y1":20.250009536743164,"y2":6.250004768371582},{"x":4.533333778381348,"y1":20.551115036010742,"y2":6.417779922485352},{"x":4.566667556762695,"y1":20.85445213317871,"y2":6.587782382965088},{"x":4.600000381469727,"y1":21.160003662109375,"y2":6.760002136230469},{"x":4.633334159851074,"y1":21.467784881591797,"y2":6.934448719024658},{"x":4.6666669845581055,"y1":21.777780532836914,"y2":7.111112594604492},{"x":4.700000762939453,"y1":22.090007781982422,"y2":7.290004253387451},{"x":4.733333587646484,"y1":22.404447555541992,"y2":7.4711127281188965},{"x":4.766667366027832,"y1":22.72111701965332,"y2":7.654448509216309},{"x":4.800000190734863,"y1":23.040000915527344,"y2":7.840001106262207},{"x":4.833333969116211,"y1":23.361116409301758,"y2":8.02778148651123},{"x":4.866666793823242,"y1":23.684446334838867,"y2":8.217778205871582},{"x":4.90000057220459,"y1":24.010005950927734,"y2":8.410003662109375},{"x":4.933333396911621,"y1":24.337778091430664,"y2":8.60444450378418},{"x":4.966667175292969,"y1":24.667783737182617,"y2":8.801114082336426}]},"height":200,"layer":[{"encoding":{"x":{"field":"x","type":"quantitative"},"y":{"field":"y1","type":"quantitative"}},"mark":{"color":"red","type":"line"}},{"encoding":{"x":{"field":"x","type":"quantitative"},"y":{"field":"y2","type":"quantitative"}},"mark":{"color":"black","strokeDash":[6,4],"type":"line"}}],"width":200}
ヒストグラム
# サイコロを10回振って目の合計を計算するを1000回行う
x =
Nx.iota({1000})
|> Nx.map(fn _i -> Nx.random_uniform({10}, 1, 6) |> Nx.sum() end)
|> Nx.to_flat_list()
y = Nx.iota({1000}) |> Nx.to_flat_list()
Vl.new(width: 200, height: 200)
|> Vl.data_from_values(x: x, y: y)
|> Vl.mark(:bar, color: :gray)
|> Vl.encode_field(:x, "x", type: :quantitative, bin: %{maxbins: 20})
|> Vl.encode_field(:y, "y", type: :quantitative, aggregate: :count)
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"values":[{"x":32,"y":0},{"x":28,"y":1},{"x":33,"y":2},{"x":34,"y":3},{"x":34,"y":4},{"x":35,"y":5},{"x":30,"y":6},{"x":21,"y":7},{"x":33,"y":8},{"x":30,"y":9},{"x":24,"y":10},{"x":23,"y":11},{"x":25,"y":12},{"x":28,"y":13},{"x":27,"y":14},{"x":30,"y":15},{"x":34,"y":16},{"x":27,"y":17},{"x":25,"y":18},{"x":33,"y":19},{"x":32,"y":20},{"x":34,"y":21},{"x":31,"y":22},{"x":36,"y":23},{"x":33,"y":24},{"x":40,"y":25},{"x":30,"y":26},{"x":32,"y":27},{"x":28,"y":28},{"x":24,"y":29},{"x":32,"y":30},{"x":25,"y":31},{"x":34,"y":32},{"x":28,"y":33},{"x":31,"y":34},{"x":29,"y":35},{"x":27,"y":36},{"x":35,"y":37},{"x":34,"y":38},{"x":31,"y":39},{"x":34,"y":40},{"x":30,"y":41},{"x":34,"y":42},{"x":26,"y":43},{"x":35,"y":44},{"x":32,"y":45},{"x":24,"y":46},{"x":28,"y":47},{"x":36,"y":48},{"x":25,"y":49},{"x":31,"y":50},{"x":22,"y":51},{"x":17,"y":52},{"x":33,"y":53},{"x":31,"y":54},{"x":37,"y":55},{"x":34,"y":56},{"x":34,"y":57},{"x":31,"y":58},{"x":29,"y":59},{"x":29,"y":60},{"x":27,"y":61},{"x":33,"y":62},{"x":30,"y":63},{"x":36,"y":64},{"x":25,"y":65},{"x":29,"y":66},{"x":34,"y":67},{"x":28,"y":68},{"x":29,"y":69},{"x":30,"y":70},{"x":30,"y":71},{"x":27,"y":72},{"x":27,"y":73},{"x":27,"y":74},{"x":25,"y":75},{"x":27,"y":76},{"x":29,"y":77},{"x":32,"y":78},{"x":36,"y":79},{"x":34,"y":80},{"x":32,"y":81},{"x":31,"y":82},{"x":34,"y":83},{"x":29,"y":84},{"x":31,"y":85},{"x":31,"y":86},{"x":31,"y":87},{"x":24,"y":88},{"x":27,"y":89},{"x":25,"y":90},{"x":37,"y":91},{"x":29,"y":92},{"x":32,"y":93},{"x":25,"y":94},{"x":27,"y":95},{"x":24,"y":96},{"x":33,"y":97},{"x":31,"y":98},{"x":33,"y":99},{"x":31,"y":100},{"x":22,"y":101},{"x":34,"y":102},{"x":32,"y":103},{"x":33,"y":104},{"x":28,"y":105},{"x":35,"y":106},{"x":27,"y":107},{"x":29,"y":108},{"x":37,"y":109},{"x":36,"y":110},{"x":34,"y":111},{"x":32,"y":112},{"x":30,"y":113},{"x":24,"y":114},{"x":34,"y":115},{"x":32,"y":116},{"x":30,"y":117},{"x":31,"y":118},{"x":33,"y":119},{"x":27,"y":120},{"x":33,"y":121},{"x":24,"y":122},{"x":37,"y":123},{"x":29,"y":124},{"x":24,"y":125},{"x":25,"y":126},{"x":28,"y":127},{"x":27,"y":128},{"x":31,"y":129},{"x":33,"y":130},{"x":30,"y":131},{"x":26,"y":132},{"x":27,"y":133},{"x":27,"y":134},{"x":34,"y":135},{"x":32,"y":136},{"x":25,"y":137},{"x":33,"y":138},{"x":30,"y":139},{"x":25,"y":140},{"x":28,"y":141},{"x":28,"y":142},{"x":26,"y":143},{"x":24,"y":144},{"x":26,"y":145},{"x":30,"y":146},{"x":36,"y":147},{"x":32,"y":148},{"x":28,"y":149},{"x":31,"y":150},{"x":35,"y":151},{"x":36,"y":152},{"x":27,"y":153},{"x":28,"y":154},{"x":30,"y":155},{"x":30,"y":156},{"x":34,"y":157},{"x":35,"y":158},{"x":27,"y":159},{"x":30,"y":160},{"x":31,"y":161},{"x":19,"y":162},{"x":29,"y":163},{"x":33,"y":164},{"x":25,"y":165},{"x":34,"y":166},{"x":36,"y":167},{"x":31,"y":168},{"x":32,"y":169},{"x":42,"y":170},{"x":36,"y":171},{"x":20,"y":172},{"x":28,"y":173},{"x":28,"y":174},{"x":28,"y":175},{"x":29,"y":176},{"x":30,"y":177},{"x":40,"y":178},{"x":24,"y":179},{"x":32,"y":180},{"x":34,"y":181},{"x":27,"y":182},{"x":29,"y":183},{"x":37,"y":184},{"x":33,"y":185},{"x":26,"y":186},{"x":29,"y":187},{"x":35,"y":188},{"x":35,"y":189},{"x":22,"y":190},{"x":35,"y":191},{"x":27,"y":192},{"x":26,"y":193},{"x":36,"y":194},{"x":30,"y":195},{"x":33,"y":196},{"x":29,"y":197},{"x":31,"y":198},{"x":28,"y":199},{"x":28,"y":200},{"x":33,"y":201},{"x":31,"y":202},{"x":26,"y":203},{"x":36,"y":204},{"x":37,"y":205},{"x":31,"y":206},{"x":25,"y":207},{"x":37,"y":208},{"x":30,"y":209},{"x":28,"y":210},{"x":32,"y":211},{"x":40,"y":212},{"x":24,"y":213},{"x":27,"y":214},{"x":27,"y":215},{"x":30,"y":216},{"x":36,"y":217},{"x":28,"y":218},{"x":32,"y":219},{"x":25,"y":220},{"x":27,"y":221},{"x":29,"y":222},{"x":33,"y":223},{"x":23,"y":224},{"x":20,"y":225},{"x":37,"y":226},{"x":33,"y":227},{"x":24,"y":228},{"x":22,"y":229},{"x":31,"y":230},{"x":27,"y":231},{"x":29,"y":232},{"x":32,"y":233},{"x":38,"y":234},{"x":29,"y":235},{"x":25,"y":236},{"x":32,"y":237},{"x":30,"y":238},{"x":26,"y":239},{"x":32,"y":240},{"x":30,"y":241},{"x":34,"y":242},{"x":34,"y":243},{"x":26,"y":244},{"x":42,"y":245},{"x":31,"y":246},{"x":32,"y":247},{"x":32,"y":248},{"x":25,"y":249},{"x":40,"y":250},{"x":26,"y":251},{"x":27,"y":252},{"x":36,"y":253},{"x":39,"y":254},{"x":30,"y":255},{"x":28,"y":256},{"x":26,"y":257},{"x":25,"y":258},{"x":30,"y":259},{"x":32,"y":260},{"x":24,"y":261},{"x":33,"y":262},{"x":38,"y":263},{"x":32,"y":264},{"x":36,"y":265},{"x":30,"y":266},{"x":30,"y":267},{"x":28,"y":268},{"x":32,"y":269},{"x":40,"y":270},{"x":31,"y":271},{"x":31,"y":272},{"x":34,"y":273},{"x":28,"y":274},{"x":37,"y":275},{"x":33,"y":276},{"x":29,"y":277},{"x":31,"y":278},{"x":32,"y":279},{"x":33,"y":280},{"x":37,"y":281},{"x":31,"y":282},{"x":32,"y":283},{"x":33,"y":284},{"x":36,"y":285},{"x":31,"y":286},{"x":34,"y":287},{"x":36,"y":288},{"x":42,"y":289},{"x":36,"y":290},{"x":37,"y":291},{"x":22,"y":292},{"x":31,"y":293},{"x":29,"y":294},{"x":26,"y":295},{"x":25,"y":296},{"x":22,"y":297},{"x":27,"y":298},{"x":36,"y":299},{"x":37,"y":300},{"x":27,"y":301},{"x":28,"y":302},{"x":30,"y":303},{"x":34,"y":304},{"x":36,"y":305},{"x":37,"y":306},{"x":31,"y":307},{"x":28,"y":308},{"x":34,"y":309},{"x":32,"y":310},{"x":32,"y":311},{"x":35,"y":312},{"x":27,"y":313},{"x":28,"y":314},{"x":32,"y":315},{"x":37,"y":316},{"x":31,"y":317},{"x":26,"y":318},{"x":22,"y":319},{"x":31,"y":320},{"x":23,"y":321},{"x":30,"y":322},{"x":27,"y":323},{"x":30,"y":324},{"x":33,"y":325},{"x":30,"y":326},{"x":25,"y":327},{"x":26,"y":328},{"x":28,"y":329},{"x":30,"y":330},{"x":33,"y":331},{"x":35,"y":332},{"x":28,"y":333},{"x":29,"y":334},{"x":26,"y":335},{"x":29,"y":336},{"x":30,"y":337},{"x":39,"y":338},{"x":31,"y":339},{"x":31,"y":340},{"x":28,"y":341},{"x":29,"y":342},{"x":30,"y":343},{"x":29,"y":344},{"x":24,"y":345},{"x":25,"y":346},{"x":38,"y":347},{"x":21,"y":348},{"x":31,"y":349},{"x":27,"y":350},{"x":31,"y":351},{"x":31,"y":352},{"x":32,"y":353},{"x":32,"y":354},{"x":29,"y":355},{"x":31,"y":356},{"x":30,"y":357},{"x":39,"y":358},{"x":38,"y":359},{"x":29,"y":360},{"x":24,"y":361},{"x":23,"y":362},{"x":30,"y":363},{"x":35,"y":364},{"x":33,"y":365},{"x":25,"y":366},{"x":35,"y":367},{"x":30,"y":368},{"x":33,"y":369},{"x":25,"y":370},{"x":29,"y":371},{"x":30,"y":372},{"x":32,"y":373},{"x":36,"y":374},{"x":29,"y":375},{"x":33,"y":376},{"x":29,"y":377},{"x":20,"y":378},{"x":30,"y":379},{"x":31,"y":380},{"x":29,"y":381},{"x":31,"y":382},{"x":30,"y":383},{"x":24,"y":384},{"x":27,"y":385},{"x":31,"y":386},{"x":39,"y":387},{"x":30,"y":388},{"x":33,"y":389},{"x":32,"y":390},{"x":29,"y":391},{"x":36,"y":392},{"x":26,"y":393},{"x":40,"y":394},{"x":28,"y":395},{"x":34,"y":396},{"x":22,"y":397},{"x":34,"y":398},{"x":34,"y":399},{"x":29,"y":400},{"x":30,"y":401},{"x":32,"y":402},{"x":25,"y":403},{"x":28,"y":404},{"x":23,"y":405},{"x":28,"y":406},{"x":23,"y":407},{"x":22,"y":408},{"x":30,"y":409},{"x":36,"y":410},{"x":30,"y":411},{"x":32,"y":412},{"x":35,"y":413},{"x":32,"y":414},{"x":26,"y":415},{"x":29,"y":416},{"x":34,"y":417},{"x":25,"y":418},{"x":30,"y":419},{"x":38,"y":420},{"x":37,"y":421},{"x":27,"y":422},{"x":32,"y":423},{"x":30,"y":424},{"x":23,"y":425},{"x":26,"y":426},{"x":24,"y":427},{"x":28,"y":428},{"x":35,"y":429},{"x":31,"y":430},{"x":25,"y":431},{"x":36,"y":432},{"x":33,"y":433},{"x":33,"y":434},{"x":34,"y":435},{"x":27,"y":436},{"x":31,"y":437},{"x":26,"y":438},{"x":28,"y":439},{"x":30,"y":440},{"x":25,"y":441},{"x":26,"y":442},{"x":34,"y":443},{"x":27,"y":444},{"x":26,"y":445},{"x":26,"y":446},{"x":26,"y":447},{"x":29,"y":448},{"x":30,"y":449},{"x":33,"y":450},{"x":29,"y":451},{"x":25,"y":452},{"x":32,"y":453},{"x":33,"y":454},{"x":32,"y":455},{"x":32,"y":456},{"x":24,"y":457},{"x":36,"y":458},{"x":27,"y":459},{"x":31,"y":460},{"x":30,"y":461},{"x":30,"y":462},{"x":29,"y":463},{"x":26,"y":464},{"x":28,"y":465},{"x":24,"y":466},{"x":24,"y":467},{"x":29,"y":468},{"x":36,"y":469},{"x":26,"y":470},{"x":31,"y":471},{"x":26,"y":472},{"x":25,"y":473},{"x":35,"y":474},{"x":31,"y":475},{"x":33,"y":476},{"x":30,"y":477},{"x":29,"y":478},{"x":33,"y":479},{"x":37,"y":480},{"x":24,"y":481},{"x":27,"y":482},{"x":29,"y":483},{"x":33,"y":484},{"x":31,"y":485},{"x":24,"y":486},{"x":37,"y":487},{"x":31,"y":488},{"x":27,"y":489},{"x":33,"y":490},{"x":31,"y":491},{"x":29,"y":492},{"x":28,"y":493},{"x":33,"y":494},{"x":24,"y":495},{"x":27,"y":496},{"x":35,"y":497},{"x":36,"y":498},{"x":29,"y":499},{"x":31,"y":500},{"x":26,"y":501},{"x":25,"y":502},{"x":24,"y":503},{"x":19,"y":504},{"x":39,"y":505},{"x":30,"y":506},{"x":34,"y":507},{"x":32,"y":508},{"x":28,"y":509},{"x":33,"y":510},{"x":30,"y":511},{"x":28,"y":512},{"x":40,"y":513},{"x":28,"y":514},{"x":38,"y":515},{"x":24,"y":516},{"x":33,"y":517},{"x":23,"y":518},{"x":29,"y":519},{"x":42,"y":520},{"x":20,"y":521},{"x":31,"y":522},{"x":40,"y":523},{"x":34,"y":524},{"x":33,"y":525},{"x":29,"y":526},{"x":27,"y":527},{"x":33,"y":528},{"x":38,"y":529},{"x":28,"y":530},{"x":35,"y":531},{"x":24,"y":532},{"x":37,"y":533},{"x":33,"y":534},{"x":33,"y":535},{"x":37,"y":536},{"x":25,"y":537},{"x":20,"y":538},{"x":30,"y":539},{"x":33,"y":540},{"x":34,"y":541},{"x":30,"y":542},{"x":30,"y":543},{"x":33,"y":544},{"x":35,"y":545},{"x":29,"y":546},{"x":31,"y":547},{"x":34,"y":548},{"x":26,"y":549},{"x":24,"y":550},{"x":32,"y":551},{"x":26,"y":552},{"x":30,"y":553},{"x":31,"y":554},{"x":25,"y":555},{"x":32,"y":556},{"x":31,"y":557},{"x":32,"y":558},{"x":30,"y":559},{"x":24,"y":560},{"x":34,"y":561},{"x":34,"y":562},{"x":28,"y":563},{"x":31,"y":564},{"x":23,"y":565},{"x":32,"y":566},{"x":31,"y":567},{"x":20,"y":568},{"x":32,"y":569},{"x":32,"y":570},{"x":29,"y":571},{"x":27,"y":572},{"x":32,"y":573},{"x":32,"y":574},{"x":36,"y":575},{"x":29,"y":576},{"x":35,"y":577},{"x":31,"y":578},{"x":37,"y":579},{"x":30,"y":580},{"x":33,"y":581},{"x":30,"y":582},{"x":31,"y":583},{"x":34,"y":584},{"x":28,"y":585},{"x":29,"y":586},{"x":24,"y":587},{"x":37,"y":588},{"x":30,"y":589},{"x":30,"y":590},{"x":25,"y":591},{"x":28,"y":592},{"x":35,"y":593},{"x":31,"y":594},{"x":28,"y":595},{"x":40,"y":596},{"x":35,"y":597},{"x":32,"y":598},{"x":27,"y":599},{"x":33,"y":600},{"x":24,"y":601},{"x":28,"y":602},{"x":32,"y":603},{"x":28,"y":604},{"x":31,"y":605},{"x":19,"y":606},{"x":32,"y":607},{"x":26,"y":608},{"x":35,"y":609},{"x":22,"y":610},{"x":28,"y":611},{"x":29,"y":612},{"x":29,"y":613},{"x":27,"y":614},{"x":29,"y":615},{"x":31,"y":616},{"x":23,"y":617},{"x":28,"y":618},{"x":28,"y":619},{"x":33,"y":620},{"x":29,"y":621},{"x":22,"y":622},{"x":28,"y":623},{"x":32,"y":624},{"x":27,"y":625},{"x":21,"y":626},{"x":32,"y":627},{"x":25,"y":628},{"x":29,"y":629},{"x":27,"y":630},{"x":33,"y":631},{"x":30,"y":632},{"x":29,"y":633},{"x":25,"y":634},{"x":30,"y":635},{"x":24,"y":636},{"x":31,"y":637},{"x":33,"y":638},{"x":27,"y":639},{"x":25,"y":640},{"x":26,"y":641},{"x":26,"y":642},{"x":27,"y":643},{"x":31,"y":644},{"x":24,"y":645},{"x":26,"y":646},{"x":28,"y":647},{"x":30,"y":648},{"x":29,"y":649},{"x":32,"y":650},{"x":29,"y":651},{"x":31,"y":652},{"x":34,"y":653},{"x":29,"y":654},{"x":28,"y":655},{"x":27,"y":656},{"x":28,"y":657},{"x":24,"y":658},{"x":39,"y":659},{"x":27,"y":660},{"x":28,"y":661},{"x":34,"y":662},{"x":31,"y":663},{"x":28,"y":664},{"x":25,"y":665},{"x":25,"y":666},{"x":29,"y":667},{"x":31,"y":668},{"x":26,"y":669},{"x":37,"y":670},{"x":32,"y":671},{"x":27,"y":672},{"x":29,"y":673},{"x":35,"y":674},{"x":25,"y":675},{"x":28,"y":676},{"x":36,"y":677},{"x":26,"y":678},{"x":29,"y":679},{"x":27,"y":680},{"x":30,"y":681},{"x":37,"y":682},{"x":27,"y":683},{"x":30,"y":684},{"x":31,"y":685},{"x":38,"y":686},{"x":28,"y":687},{"x":27,"y":688},{"x":35,"y":689},{"x":26,"y":690},{"x":32,"y":691},{"x":33,"y":692},{"x":31,"y":693},{"x":27,"y":694},{"x":31,"y":695},{"x":29,"y":696},{"x":33,"y":697},{"x":30,"y":698},{"x":30,"y":699},{"x":28,"y":700},{"x":29,"y":701},{"x":24,"y":702},{"x":28,"y":703},{"x":30,"y":704},{"x":27,"y":705},{"x":30,"y":706},{"x":30,"y":707},{"x":37,"y":708},{"x":32,"y":709},{"x":24,"y":710},{"x":30,"y":711},{"x":36,"y":712},{"x":26,"y":713},{"x":33,"y":714},{"x":28,"y":715},{"x":25,"y":716},{"x":27,"y":717},{"x":34,"y":718},{"x":35,"y":719},{"x":29,"y":720},{"x":26,"y":721},{"x":28,"y":722},{"x":25,"y":723},{"x":15,"y":724},{"x":31,"y":725},{"x":29,"y":726},{"x":34,"y":727},{"x":30,"y":728},{"x":26,"y":729},{"x":30,"y":730},{"x":36,"y":731},{"x":28,"y":732},{"x":37,"y":733},{"x":27,"y":734},{"x":26,"y":735},{"x":29,"y":736},{"x":27,"y":737},{"x":30,"y":738},{"x":25,"y":739},{"x":31,"y":740},{"x":22,"y":741},{"x":20,"y":742},{"x":39,"y":743},{"x":29,"y":744},{"x":31,"y":745},{"x":28,"y":746},{"x":40,"y":747},{"x":31,"y":748},{"x":35,"y":749},{"x":26,"y":750},{"x":25,"y":751},{"x":33,"y":752},{"x":37,"y":753},{"x":26,"y":754},{"x":28,"y":755},{"x":35,"y":756},{"x":35,"y":757},{"x":29,"y":758},{"x":25,"y":759},{"x":25,"y":760},{"x":33,"y":761},{"x":25,"y":762},{"x":31,"y":763},{"x":23,"y":764},{"x":24,"y":765},{"x":26,"y":766},{"x":30,"y":767},{"x":28,"y":768},{"x":32,"y":769},{"x":39,"y":770},{"x":26,"y":771},{"x":34,"y":772},{"x":34,"y":773},{"x":28,"y":774},{"x":37,"y":775},{"x":25,"y":776},{"x":26,"y":777},{"x":31,"y":778},{"x":29,"y":779},{"x":23,"y":780},{"x":32,"y":781},{"x":32,"y":782},{"x":28,"y":783},{"x":27,"y":784},{"x":23,"y":785},{"x":30,"y":786},{"x":33,"y":787},{"x":36,"y":788},{"x":28,"y":789},{"x":38,"y":790},{"x":28,"y":791},{"x":36,"y":792},{"x":26,"y":793},{"x":39,"y":794},{"x":37,"y":795},{"x":36,"y":796},{"x":33,"y":797},{"x":39,"y":798},{"x":28,"y":799},{"x":31,"y":800},{"x":28,"y":801},{"x":28,"y":802},{"x":30,"y":803},{"x":28,"y":804},{"x":28,"y":805},{"x":29,"y":806},{"x":30,"y":807},{"x":31,"y":808},{"x":28,"y":809},{"x":26,"y":810},{"x":34,"y":811},{"x":26,"y":812},{"x":34,"y":813},{"x":33,"y":814},{"x":28,"y":815},{"x":32,"y":816},{"x":31,"y":817},{"x":32,"y":818},{"x":26,"y":819},{"x":31,"y":820},{"x":32,"y":821},{"x":38,"y":822},{"x":36,"y":823},{"x":41,"y":824},{"x":36,"y":825},{"x":34,"y":826},{"x":31,"y":827},{"x":28,"y":828},{"x":28,"y":829},{"x":36,"y":830},{"x":27,"y":831},{"x":36,"y":832},{"x":25,"y":833},{"x":30,"y":834},{"x":29,"y":835},{"x":29,"y":836},{"x":36,"y":837},{"x":27,"y":838},{"x":28,"y":839},{"x":33,"y":840},{"x":32,"y":841},{"x":32,"y":842},{"x":24,"y":843},{"x":41,"y":844},{"x":29,"y":845},{"x":28,"y":846},{"x":36,"y":847},{"x":25,"y":848},{"x":30,"y":849},{"x":32,"y":850},{"x":34,"y":851},{"x":26,"y":852},{"x":31,"y":853},{"x":31,"y":854},{"x":30,"y":855},{"x":31,"y":856},{"x":24,"y":857},{"x":27,"y":858},{"x":31,"y":859},{"x":30,"y":860},{"x":27,"y":861},{"x":30,"y":862},{"x":33,"y":863},{"x":29,"y":864},{"x":35,"y":865},{"x":33,"y":866},{"x":35,"y":867},{"x":28,"y":868},{"x":25,"y":869},{"x":38,"y":870},{"x":25,"y":871},{"x":34,"y":872},{"x":31,"y":873},{"x":34,"y":874},{"x":28,"y":875},{"x":27,"y":876},{"x":32,"y":877},{"x":34,"y":878},{"x":35,"y":879},{"x":26,"y":880},{"x":31,"y":881},{"x":37,"y":882},{"x":34,"y":883},{"x":32,"y":884},{"x":34,"y":885},{"x":42,"y":886},{"x":39,"y":887},{"x":25,"y":888},{"x":30,"y":889},{"x":33,"y":890},{"x":34,"y":891},{"x":27,"y":892},{"x":31,"y":893},{"x":32,"y":894},{"x":29,"y":895},{"x":19,"y":896},{"x":28,"y":897},{"x":23,"y":898},{"x":20,"y":899},{"x":26,"y":900},{"x":38,"y":901},{"x":26,"y":902},{"x":29,"y":903},{"x":24,"y":904},{"x":35,"y":905},{"x":27,"y":906},{"x":35,"y":907},{"x":29,"y":908},{"x":30,"y":909},{"x":29,"y":910},{"x":34,"y":911},{"x":30,"y":912},{"x":28,"y":913},{"x":25,"y":914},{"x":34,"y":915},{"x":32,"y":916},{"x":34,"y":917},{"x":27,"y":918},{"x":30,"y":919},{"x":28,"y":920},{"x":29,"y":921},{"x":32,"y":922},{"x":41,"y":923},{"x":32,"y":924},{"x":32,"y":925},{"x":24,"y":926},{"x":30,"y":927},{"x":26,"y":928},{"x":25,"y":929},{"x":35,"y":930},{"x":27,"y":931},{"x":29,"y":932},{"x":28,"y":933},{"x":26,"y":934},{"x":27,"y":935},{"x":20,"y":936},{"x":27,"y":937},{"x":27,"y":938},{"x":36,"y":939},{"x":25,"y":940},{"x":32,"y":941},{"x":25,"y":942},{"x":34,"y":943},{"x":34,"y":944},{"x":32,"y":945},{"x":25,"y":946},{"x":33,"y":947},{"x":27,"y":948},{"x":38,"y":949},{"x":21,"y":950},{"x":36,"y":951},{"x":26,"y":952},{"x":27,"y":953},{"x":28,"y":954},{"x":34,"y":955},{"x":36,"y":956},{"x":28,"y":957},{"x":29,"y":958},{"x":21,"y":959},{"x":30,"y":960},{"x":29,"y":961},{"x":27,"y":962},{"x":29,"y":963},{"x":33,"y":964},{"x":26,"y":965},{"x":35,"y":966},{"x":24,"y":967},{"x":27,"y":968},{"x":21,"y":969},{"x":38,"y":970},{"x":37,"y":971},{"x":32,"y":972},{"x":28,"y":973},{"x":35,"y":974},{"x":32,"y":975},{"x":33,"y":976},{"x":28,"y":977},{"x":36,"y":978},{"x":33,"y":979},{"x":24,"y":980},{"x":31,"y":981},{"x":40,"y":982},{"x":33,"y":983},{"x":24,"y":984},{"x":35,"y":985},{"x":29,"y":986},{"x":38,"y":987},{"x":33,"y":988},{"x":35,"y":989},{"x":31,"y":990},{"x":36,"y":991},{"x":33,"y":992},{"x":34,"y":993},{"x":29,"y":994},{"x":32,"y":995},{"x":35,"y":996},{"x":38,"y":997},{"x":28,"y":998},{"x":26,"y":999}]},"encoding":{"x":{"bin":{"maxbins":20},"field":"x","type":"quantitative"},"y":{"aggregate":"count","field":"y","type":"quantitative"}},"height":200,"mark":{"color":"gray","type":"bar"},"width":200}
複数のグラフを並べて表示する
# np.linspace(-5, 5, 300)
x = Nx.iota({1, 300}) |> Nx.multiply(10 / 300) |> Nx.subtract(5)
sin_x = Nx.sin(x) |> Nx.to_flat_list()
cos_x = Nx.cos(x) |> Nx.to_flat_list()
# 縦方向
Vl.new(width: 400, height: 200)
|> Vl.data_from_values(x: Nx.to_flat_list(x), y: sin_x, y2: cos_x)
|> Vl.transform(filter: %{field: "y", range: [-1.5, 1.5]})
|> Vl.transform(filter: %{field: "y2", range: [-1.5, 1.5]})
|> Vl.concat(
[
Vl.new(width: 600)
|> Vl.mark(:line, color: :red)
|> Vl.encode_field(:x, "x", type: :quantitative)
|> Vl.encode_field(:y, "y", type: :quantitative),
Vl.new(width: 600)
|> Vl.mark(:line, color: :black)
|> Vl.encode_field(:x, "x", type: :quantitative)
|> Vl.encode_field(:y, "y2", type: :quantitative)
],
:vertical
)
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"values":[{"x":-5.0,"y":0.9589242935180664,"y2":0.28366219997406006},{"x":-4.9666666984558105,"y":0.9678452610969543,"y2":0.2515464127063751},{"x":-4.933333396911621,"y":0.9756909012794495,"y2":0.21915118396282196},{"x":-4.900000095367432,"y":0.9824525713920593,"y2":0.18651247024536133},{"x":-4.866666793823242,"y":0.9881227612495422,"y2":0.15366652607917786},{"x":-4.833333492279053,"y":0.992695152759552,"y2":0.12064987421035767},{"x":-4.800000190734863,"y":0.9961646199226379,"y2":0.08749917149543762},{"x":-4.766666412353516,"y":0.9985273480415344,"y2":0.05425078421831131},{"x":-4.733333110809326,"y":0.9997806549072266,"y2":0.020942598581314087},{"x":-4.699999809265137,"y":0.9999232292175293,"y2":-0.012388854287564754},{"x":-4.666666507720947,"y":0.9989548921585083,"y2":-0.04570654407143593},{"x":-4.633333206176758,"y":0.9968767166137695,"y2":-0.0789734497666359},{"x":-4.599999904632568,"y":0.9936909675598145,"y2":-0.11215262115001678},{"x":-4.566666603088379,"y":0.9894012808799744,"y2":-0.14520718157291412},{"x":-4.5333333015441895,"y":0.9840123057365417,"y2":-0.17810042202472687},{"x":-4.5,"y":0.9775301218032837,"y2":-0.2107958048582077},{"x":-4.4666666984558105,"y":0.9699618816375732,"y2":-0.24325697124004364},{"x":-4.433333396911621,"y":0.9613159894943237,"y2":-0.27544787526130676},{"x":-4.400000095367432,"y":0.9516021013259888,"y2":-0.3073327839374542},{"x":-4.366666793823242,"y":0.9408309459686279,"y2":-0.33887621760368347},{"x":-4.333333492279053,"y":0.9290145635604858,"y2":-0.37004315853118896},{"x":-4.300000190734863,"y":0.9161660075187683,"y2":-0.4007990062236786},{"x":-4.266666412353516,"y":0.9022994041442871,"y2":-0.4311099648475647},{"x":-4.233333110809326,"y":0.8874304890632629,"y2":-0.46094152331352234},{"x":-4.199999809265137,"y":0.871575653553009,"y2":-0.4902609884738922},{"x":-4.166666507720947,"y":0.8547525405883789,"y2":-0.5190357565879822},{"x":-4.133333206176758,"y":0.8369797468185425,"y2":-0.5472338795661926},{"x":-4.099999904632568,"y":0.8182770609855652,"y2":-0.5748240351676941},{"x":-4.066666603088379,"y":0.7986652851104736,"y2":-0.6017755270004272},{"x":-4.0333333015441895,"y":0.7781661748886108,"y2":-0.6280584931373596},{"x":-4.0,"y":0.756802499294281,"y2":-0.6536436080932617},{"x":-3.9666666984558105,"y":0.7345980405807495,"y2":-0.6785025596618652},{"x":-3.933333396911621,"y":0.7115774154663086,"y2":-0.7026076912879944},{"x":-3.9000000953674316,"y":0.6877662539482117,"y2":-0.725932240486145},{"x":-3.866666555404663,"y":0.6631907820701599,"y2":-0.7484503984451294},{"x":-3.8333332538604736,"y":0.6378786563873291,"y2":-0.7701368927955627},{"x":-3.799999952316284,"y":0.6118578314781189,"y2":-0.7909677624702454},{"x":-3.7666666507720947,"y":0.5851572751998901,"y2":-0.8109198212623596},{"x":-3.733333110809326,"y":0.5578063726425171,"y2":-0.8299710750579834},{"x":-3.6999998092651367,"y":0.5298359990119934,"y2":-0.8481001257896423},{"x":-3.6666665077209473,"y":0.5012769103050232,"y2":-0.8652869462966919},{"x":-3.633333206176758,"y":0.4721609354019165,"y2":-0.8815123438835144},{"x":-3.5999999046325684,"y":0.4425203502178192,"y2":-0.8967584371566772},{"x":-3.566666603088379,"y":0.4123881459236145,"y2":-0.9110082387924194},{"x":-3.5333333015441895,"y":0.38179779052734375,"y2":-0.9242458939552307},{"x":-3.5,"y":0.35078322887420654,"y2":-0.9364566802978516},{"x":-3.4666666984558105,"y":0.31937894225120544,"y2":-0.947627067565918},{"x":-3.433333396911621,"y":0.28761985898017883,"y2":-0.9577446579933167},{"x":-3.3999998569488525,"y":0.25554096698760986,"y2":-0.9667982459068298},{"x":-3.366666555404663,"y":0.22317840158939362,"y2":-0.9747776389122009},{"x":-3.3333332538604736,"y":0.19056788086891174,"y2":-0.9816740155220032},{"x":-3.299999952316284,"y":0.15774564445018768,"y2":-0.9874798059463501},{"x":-3.2666664123535156,"y":0.12474791705608368,"y2":-0.9921884536743164},{"x":-3.233333110809326,"y":0.0916118249297142,"y2":-0.9957947731018066},{"x":-3.1999998092651367,"y":0.05837395414710045,"y2":-0.9982947707176208},{"x":-3.1666665077209473,"y":0.025071226060390472,"y2":-0.9996856451034546},{"x":-3.133333206176758,"y":-0.00825935322791338,"y2":-0.9999659061431885},{"x":-3.0999999046325684,"y":-0.04158075898885727,"y2":-0.9991351366043091},{"x":-3.066666603088379,"y":-0.07485596835613251,"y2":-0.9971943497657776},{"x":-3.0333333015441895,"y":-0.10804800689220428,"y2":-0.9941456913948059},{"x":-3.0,"y":-0.14112000167369843,"y2":-0.9899924993515015},{"x":-2.9666664600372314,"y":-0.1740354597568512,"y2":-0.984739363193512},{"x":-2.933333158493042,"y":-0.2067573219537735,"y2":-0.9783922433853149},{"x":-2.8999998569488525,"y":-0.23924946784973145,"y2":-0.9709581136703491},{"x":-2.866666555404663,"y":-0.27147582173347473,"y2":-0.9624452590942383},{"x":-2.8333332538604736,"y":-0.30340054631233215,"y2":-0.9528630971908569},{"x":-2.799999952316284,"y":-0.33498820662498474,"y2":-0.9422222971916199},{"x":-2.7666666507720947,"y":-0.3662036657333374,"y2":-0.9305347204208374},{"x":-2.733333110809326,"y":-0.39701250195503235,"y2":-0.9178131818771362},{"x":-2.6999998092651367,"y":-0.4273800551891327,"y2":-0.9040720462799072},{"x":-2.6666665077209473,"y":-0.4572727680206299,"y2":-0.8893265128135681},{"x":-2.633333206176758,"y":-0.48665744066238403,"y2":-0.8735929131507874},{"x":-2.5999999046325684,"y":-0.5155014395713806,"y2":-0.8568887114524841},{"x":-2.566666603088379,"y":-0.5437727570533752,"y2":-0.8392325043678284},{"x":-2.5333333015441895,"y":-0.5714398622512817,"y2":-0.820643961429596},{"x":-2.499999761581421,"y":-0.5984723567962646,"y2":-0.8011434674263},{"x":-2.4666664600372314,"y":-0.624839723110199,"y2":-0.7807530760765076},{"x":-2.433333158493042,"y":-0.6505128741264343,"y2":-0.7594952583312988},{"x":-2.3999998569488525,"y":-0.6754632592201233,"y2":-0.7373936176300049},{"x":-2.366666555404663,"y":-0.6996632814407349,"y2":-0.714472770690918},{"x":-2.3333332538604736,"y":-0.7230859398841858,"y2":-0.6907581090927124},{"x":-2.299999952316284,"y":-0.745705246925354,"y2":-0.6662759780883789},{"x":-2.2666664123535156,"y":-0.7674962282180786,"y2":-0.6410534977912903},{"x":-2.233333110809326,"y":-0.7884343266487122,"y2":-0.6151189208030701},{"x":-2.1999998092651367,"y":-0.8084965348243713,"y2":-0.5885009765625},{"x":-2.1666665077209473,"y":-0.8276604413986206,"y2":-0.5612291693687439},{"x":-2.133333206176758,"y":-0.8459048271179199,"y2":-0.5333338975906372},{"x":-2.0999999046325684,"y":-0.8632094264030457,"y2":-0.5048460364341736},{"x":-2.066666603088379,"y":-0.8795549869537354,"y2":-0.47579729557037354},{"x":-2.0333330631256104,"y":-0.8949234485626221,"y2":-0.44621971249580383},{"x":-1.999999761581421,"y":-0.909297525882721,"y2":-0.4161466062068939},{"x":-1.9666664600372314,"y":-0.9226613640785217,"y2":-0.3856111764907837},{"x":-1.933333158493042,"y":-0.9350001811981201,"y2":-0.35464730858802795},{"x":-1.8999998569488525,"y":-0.9463001489639282,"y2":-0.3232894241809845},{"x":-1.866666555404663,"y":-0.9565487504005432,"y2":-0.29157236218452454},{"x":-1.8333332538604736,"y":-0.9657346606254578,"y2":-0.2595313787460327},{"x":-1.799999713897705,"y":-0.9738476872444153,"y2":-0.22720181941986084},{"x":-1.7666664123535156,"y":-0.9808787107467651,"y2":-0.1946200579404831},{"x":-1.7333331108093262,"y":-0.9868199229240417,"y2":-0.16182208061218262},{"x":-1.6999998092651367,"y":-0.9916648268699646,"y2":-0.12884430587291718},{"x":-1.6666665077209473,"y":-0.9954079985618591,"y2":-0.09572339057922363},{"x":-1.6333332061767578,"y":-0.9980452060699463,"y2":-0.0624961256980896},{"x":-1.5999999046325684,"y":-0.9995735883712769,"y2":-0.029199426993727684},{"x":-1.566666603088379,"y":-0.9999914765357971,"y2":0.004129712004214525},{"x":-1.5333330631256104,"y":-0.9992983341217041,"y2":0.037454500794410706},{"x":-1.499999761581421,"y":-0.9974949955940247,"y2":0.07073743641376495},{"x":-1.4666664600372314,"y":-0.9945833683013916,"y2":0.10394179075956345},{"x":-1.433333158493042,"y":-0.9905667901039124,"y2":0.13703066110610962},{"x":-1.3999998569488525,"y":-0.9854497313499451,"y2":0.16996727883815765},{"x":-1.366666555404663,"y":-0.9792377352714539,"y2":0.20271506905555725},{"x":-1.3333332538604736,"y":-0.971937894821167,"y2":0.23523764312267303},{"x":-1.299999713897705,"y":-0.9635581374168396,"y2":0.2674991190433502},{"x":-1.2666664123535156,"y":-0.9541078805923462,"y2":0.2994631230831146},{"x":-1.2333331108093262,"y":-0.9435976147651672,"y2":0.3310944437980652},{"x":-1.1999998092651367,"y":-0.9320390224456787,"y2":0.3623579442501068},{"x":-1.1666665077209473,"y":-0.9194449186325073,"y2":0.3932188153266907},{"x":-1.1333332061767578,"y":-0.9058293104171753,"y2":0.4236428439617157},{"x":-1.0999999046325684,"y":-0.8912073373794556,"y2":0.45359620451927185},{"x":-1.0666663646697998,"y":-0.8755950927734375,"y2":0.4830458164215088},{"x":-1.0333330631256104,"y":-0.8590101599693298,"y2":0.5119585394859314},{"x":-1.0,"y":-0.8414709568023682,"y2":0.5403022766113281},{"x":-0.9666662216186523,"y":-0.8229965567588806,"y2":0.5680463910102844},{"x":-0.9333329200744629,"y":-0.8036080002784729,"y2":0.5951589345932007},{"x":-0.8999996185302734,"y":-0.7833266854286194,"y2":0.6216102838516235},{"x":-0.866666316986084,"y":-0.7621750235557556,"y2":0.6473709940910339},{"x":-0.8333330154418945,"y":-0.7401766180992126,"y2":0.6724124550819397},{"x":-0.7999997138977051,"y":-0.7173559069633484,"y2":0.6967068910598755},{"x":-0.7666664123535156,"y":-0.6937381625175476,"y2":0.7202273011207581},{"x":-0.7333331108093262,"y":-0.6693496704101562,"y2":0.742947518825531},{"x":-0.6999998092651367,"y":-0.6442175507545471,"y2":0.7648423314094543},{"x":-0.6666665077209473,"y":-0.6183696985244751,"y2":0.7858873605728149},{"x":-0.6333332061767578,"y":-0.5918347835540771,"y2":0.8060593008995056},{"x":-0.5999999046325684,"y":-0.5646423697471619,"y2":0.825335681438446},{"x":-0.5666666030883789,"y":-0.5368226766586304,"y2":0.8436951041221619},{"x":-0.5333333015441895,"y":-0.5084065198898315,"y2":0.8611171841621399},{"x":-0.5,"y":-0.4794255495071411,"y2":0.8775825500488281},{"x":-0.46666622161865234,"y":-0.4499114751815796,"y2":0.8930731415748596},{"x":-0.4333329200744629,"y":-0.41989800333976746,"y2":0.9075713157653809},{"x":-0.39999961853027344,"y":-0.38941797614097595,"y2":0.9210611581802368},{"x":-0.366666316986084,"y":-0.35850533843040466,"y2":0.9335276484489441},{"x":-0.33333301544189453,"y":-0.3271943926811218,"y2":0.9449570775032043},{"x":-0.2999997138977051,"y":-0.29551994800567627,"y2":0.9553365707397461},{"x":-0.2666664123535156,"y":-0.2635171413421631,"y2":0.9646546840667725},{"x":-0.23333311080932617,"y":-0.23122158646583557,"y2":0.9729011058807373},{"x":-0.19999980926513672,"y":-0.19866915047168732,"y2":0.9800665974617004},{"x":-0.16666650772094727,"y":-0.1658959686756134,"y2":0.9861432313919067},{"x":-0.1333332061767578,"y":-0.13293848931789398,"y2":0.9911242723464966},{"x":-0.09999990463256836,"y":-0.09983332455158234,"y2":0.9950041770935059},{"x":-0.0666666030883789,"y":-0.06661722809076309,"y2":0.997778594493866},{"x":-0.03333330154418945,"y":-0.0333271287381649,"y2":0.9994444847106934},{"x":4.76837158203125e-7,"y":4.76837158203125e-7,"y2":1.0},{"x":0.033333778381347656,"y":0.033327605575323105,"y2":0.9994444847106934},{"x":0.06666707992553711,"y":0.0666177049279213,"y2":0.997778594493866},{"x":0.10000038146972656,"y":0.09983379393815994,"y2":0.9950041174888611},{"x":0.13333368301391602,"y":0.13293896615505219,"y2":0.9911242127418518},{"x":0.16666698455810547,"y":0.1658964455127716,"y2":0.986143171787262},{"x":0.20000028610229492,"y":0.19866961240768433,"y2":0.9800665378570557},{"x":0.23333358764648438,"y":0.23122204840183258,"y2":0.9729009866714478},{"x":0.26666688919067383,"y":0.2635176181793213,"y2":0.9646545648574829},{"x":0.3000001907348633,"y":0.2955203950405121,"y2":0.9553364515304565},{"x":0.33333349227905273,"y":0.32719483971595764,"y2":0.94495689868927},{"x":0.3666667938232422,"y":0.3585057854652405,"y2":0.9335275292396545},{"x":0.40000009536743164,"y":0.38941842317581177,"y2":0.9210609793663025},{"x":0.4333333969116211,"y":0.4198984205722809,"y2":0.9075710773468018},{"x":0.46666717529296875,"y":0.44991233944892883,"y2":0.8930727243423462},{"x":0.5000004768371582,"y":0.47942596673965454,"y2":0.877582311630249},{"x":0.5333337783813477,"y":0.508406937122345,"y2":0.8611169457435608},{"x":0.5666670799255371,"y":0.5368230938911438,"y2":0.8436948657035828},{"x":0.6000003814697266,"y":0.5646427869796753,"y2":0.8253353834152222},{"x":0.633333683013916,"y":0.5918352007865906,"y2":0.8060590028762817},{"x":0.6666669845581055,"y":0.6183700561523438,"y2":0.7858870625495911},{"x":0.7000002861022949,"y":0.6442179083824158,"y2":0.7648419737815857},{"x":0.7333335876464844,"y":0.6693500280380249,"y2":0.7429472208023071},{"x":0.7666668891906738,"y":0.6937385201454163,"y2":0.7202270030975342},{"x":0.8000001907348633,"y":0.7173562049865723,"y2":0.6967065930366516},{"x":0.8333334922790527,"y":0.7401769757270813,"y2":0.672412097454071},{"x":0.8666667938232422,"y":0.7621753811836243,"y2":0.6473706364631653},{"x":0.9000000953674316,"y":0.7833269834518433,"y2":0.6216098666191101},{"x":0.9333338737487793,"y":0.8036085963249207,"y2":0.5951581597328186},{"x":0.9666671752929688,"y":0.8229970932006836,"y2":0.5680455565452576},{"x":1.0000004768371582,"y":0.841471254825592,"y2":0.5403019189834595},{"x":1.0333337783813477,"y":0.8590105175971985,"y2":0.5119579434394836},{"x":1.066667079925537,"y":0.8755953907966614,"y2":0.48304519057273865},{"x":1.1000003814697266,"y":0.8912075161933899,"y2":0.4535957872867584},{"x":1.133333683013916,"y":0.9058294892311096,"y2":0.42364242672920227},{"x":1.1666669845581055,"y":0.9194450974464417,"y2":0.39321839809417725},{"x":1.200000286102295,"y":0.932039201259613,"y2":0.362357497215271},{"x":1.2333335876464844,"y":0.9435977935791016,"y2":0.33109399676322937},{"x":1.2666668891906738,"y":0.9541079998016357,"y2":0.2994626760482788},{"x":1.3000001907348633,"y":0.9635582566261292,"y2":0.267498642206192},{"x":1.3333334922790527,"y":0.9719379544258118,"y2":0.23523741960525513},{"x":1.3666667938232422,"y":0.9792377948760986,"y2":0.20271484553813934},{"x":1.4000005722045898,"y":0.9854498505592346,"y2":0.16996657848358154},{"x":1.4333338737487793,"y":0.9905669093132019,"y2":0.13702994585037231},{"x":1.4666671752929688,"y":0.9945834279060364,"y2":0.10394107550382614},{"x":1.5000004768371582,"y":0.9974949955940247,"y2":0.07073672860860825},{"x":1.5333337783813477,"y":0.9992983341217041,"y2":0.0374537855386734},{"x":1.566667079925537,"y":0.9999914765357971,"y2":0.004129235167056322},{"x":1.6000003814697266,"y":0.9995735883712769,"y2":-0.029199903830885887},{"x":1.633333683013916,"y":0.9980452060699463,"y2":-0.0624966025352478},{"x":1.6666669845581055,"y":0.9954079389572144,"y2":-0.09572386741638184},{"x":1.700000286102295,"y":0.9916647672653198,"y2":-0.12884478271007538},{"x":1.7333335876464844,"y":0.986819863319397,"y2":-0.16182254254817963},{"x":1.7666668891906738,"y":0.9808785915374756,"y2":-0.1946205198764801},{"x":1.8000001907348633,"y":0.9738475680351257,"y2":-0.22720228135585785},{"x":1.8333334922790527,"y":0.965734601020813,"y2":-0.2595316171646118},{"x":1.8666667938232422,"y":0.9565486907958984,"y2":-0.29157260060310364},{"x":1.9000005722045898,"y":0.9462999105453491,"y2":-0.3232901096343994},{"x":1.9333338737487793,"y":0.9349998831748962,"y2":-0.3546479642391205},{"x":1.9666671752929688,"y":0.9226611256599426,"y2":-0.3856118321418762},{"x":2.000000476837158,"y":0.9092972278594971,"y2":-0.41614726185798645},{"x":2.0333337783813477,"y":0.8949230909347534,"y2":-0.44622036814689636},{"x":2.066667079925537,"y":0.8795547485351562,"y2":-0.47579771280288696},{"x":2.1000003814697266,"y":0.8632091879844666,"y2":-0.504846453666687},{"x":2.133333683013916,"y":0.8459045886993408,"y2":-0.5333342552185059},{"x":2.1666669845581055,"y":0.8276602029800415,"y2":-0.5612295866012573},{"x":2.200000286102295,"y":0.8084962368011475,"y2":-0.5885013341903687},{"x":2.2333335876464844,"y":0.7884340286254883,"y2":-0.6151192784309387},{"x":2.266666889190674,"y":0.7674959301948547,"y2":-0.6410538554191589},{"x":2.3000001907348633,"y":0.7457050681114197,"y2":-0.6662761569023132},{"x":2.3333334922790527,"y":0.7230857610702515,"y2":-0.690758228302002},{"x":2.3666672706604004,"y":0.6996627449989319,"y2":-0.7144732475280762},{"x":2.40000057220459,"y":0.6754627823829651,"y2":-0.7373940944671631},{"x":2.4333338737487793,"y":0.6505123376846313,"y2":-0.759495735168457},{"x":2.4666671752929688,"y":0.6248391270637512,"y2":-0.780753493309021},{"x":2.500000476837158,"y":0.5984717607498169,"y2":-0.8011438846588135},{"x":2.5333337783813477,"y":0.5714395046234131,"y2":-0.820644199848175},{"x":2.566667079925537,"y":0.5437723398208618,"y2":-0.8392328023910522},{"x":2.6000003814697266,"y":0.5155010223388672,"y2":-0.8568889498710632},{"x":2.633333683013916,"y":0.4866570234298706,"y2":-0.8735930919647217},{"x":2.6666669845581055,"y":0.45727235078811646,"y2":-0.8893266916275024},{"x":2.700000286102295,"y":0.4273796081542969,"y2":-0.9040722846984863},{"x":2.7333335876464844,"y":0.3970120847225189,"y2":-0.9178133606910706},{"x":2.766666889190674,"y":0.3662034571170807,"y2":-0.9305347800254822},{"x":2.8000001907348633,"y":0.33498796820640564,"y2":-0.9422224164009094},{"x":2.833333969116211,"y":0.30339986085891724,"y2":-0.952863335609436},{"x":2.8666672706604004,"y":0.2714751362800598,"y2":-0.9624454379081726},{"x":2.90000057220459,"y":0.23924876749515533,"y2":-0.9709582924842834},{"x":2.9333338737487793,"y":0.2067566215991974,"y2":-0.9783924221992493},{"x":2.9666671752929688,"y":0.17403475940227509,"y2":-0.9847394824028015},{"x":3.0,"y":0.14112000167369843,"y2":-0.9899924993515015},{"x":3.0333337783813477,"y":0.10804753005504608,"y2":-0.9941457509994507},{"x":3.0666675567626953,"y":0.0748550146818161,"y2":-0.9971944093704224},{"x":3.1000003814697266,"y":0.041580282151699066,"y2":-0.9991351366043091},{"x":3.133334159851074,"y":0.008258399553596973,"y2":-0.9999659061431885},{"x":3.1666669845581055,"y":-0.025071702897548676,"y2":-0.9996856451034546},{"x":3.200000762939453,"y":-0.058374904096126556,"y2":-0.9982947111129761},{"x":3.2333335876464844,"y":-0.0916123017668724,"y2":-0.9957947731018066},{"x":3.266667366027832,"y":-0.12474886327981949,"y2":-0.9921883344650269},{"x":3.3000001907348633,"y":-0.15774588286876678,"y2":-0.9874797463417053},{"x":3.333333969116211,"y":-0.19056858122348785,"y2":-0.9816738963127136},{"x":3.366666793823242,"y":-0.22317864000797272,"y2":-0.9747775793075562},{"x":3.40000057220459,"y":-0.2555416524410248,"y2":-0.9667980670928955},{"x":3.433333396911621,"y":-0.28761985898017883,"y2":-0.9577446579933167},{"x":3.4666671752929688,"y":-0.31937941908836365,"y2":-0.9476269483566284},{"x":3.5,"y":-0.35078322887420654,"y2":-0.9364566802978516},{"x":3.5333337783813477,"y":-0.3817982077598572,"y2":-0.9242457151412964},{"x":3.5666675567626953,"y":-0.41238901019096375,"y2":-0.911007821559906},{"x":3.6000003814697266,"y":-0.44252079725265503,"y2":-0.8967582583427429},{"x":3.633334159851074,"y":-0.47216176986694336,"y2":-0.881511926651001},{"x":3.6666669845581055,"y":-0.5012773275375366,"y2":-0.8652867078781128},{"x":3.700000762939453,"y":-0.5298367738723755,"y2":-0.8480996489524841},{"x":3.7333335876464844,"y":-0.5578067898750305,"y2":-0.8299708366394043},{"x":3.766667366027832,"y":-0.5851578712463379,"y2":-0.8109194040298462},{"x":3.8000001907348633,"y":-0.611858069896698,"y2":-0.790967583656311},{"x":3.833333969116211,"y":-0.6378791928291321,"y2":-0.7701364159584045},{"x":3.866666793823242,"y":-0.6631909608840942,"y2":-0.7484502792358398},{"x":3.90000057220459,"y":-0.6877665519714355,"y2":-0.7259318828582764},{"x":3.933333396911621,"y":-0.7115774154663086,"y2":-0.7026076912879944},{"x":3.9666671752929688,"y":-0.7345983386039734,"y2":-0.6785022020339966},{"x":4.0,"y":-0.756802499294281,"y2":-0.6536436080932617},{"x":4.033333778381348,"y":-0.7781664729118347,"y2":-0.6280580759048462},{"x":4.066667556762695,"y":-0.7986658215522766,"y2":-0.6017747521400452},{"x":4.100000381469727,"y":-0.8182773590087891,"y2":-0.5748236179351807},{"x":4.133334159851074,"y":-0.8369802832603455,"y2":-0.5472331047058105},{"x":4.1666669845581055,"y":-0.854752779006958,"y2":-0.5190353393554688},{"x":4.200000762939453,"y":-0.8715761303901672,"y2":-0.49026015400886536},{"x":4.233333587646484,"y":-0.887430727481842,"y2":-0.4609411060810089},{"x":4.266667366027832,"y":-0.9022998213768005,"y2":-0.43110910058021545},{"x":4.300000190734863,"y":-0.9161660075187683,"y2":-0.4007990062236786},{"x":4.333333969116211,"y":-0.9290147423744202,"y2":-0.37004271149635315},{"x":4.366666793823242,"y":-0.9408309459686279,"y2":-0.33887621760368347},{"x":4.40000057220459,"y":-0.9516022205352783,"y2":-0.3073323369026184},{"x":4.433333396911621,"y":-0.9613159894943237,"y2":-0.27544787526130676},{"x":4.466667175292969,"y":-0.9699620008468628,"y2":-0.24325650930404663},{"x":4.500000953674316,"y":-0.977530300617218,"y2":-0.2107948660850525},{"x":4.533333778381348,"y":-0.9840124249458313,"y2":-0.17809996008872986},{"x":4.566667556762695,"y":-0.9894014000892639,"y2":-0.1452062427997589},{"x":4.600000381469727,"y":-0.9936910271644592,"y2":-0.11215214431285858},{"x":4.633334159851074,"y":-0.9968767762184143,"y2":-0.07897250354290009},{"x":4.6666669845581055,"y":-0.9989549517631531,"y2":-0.045706067234277725},{"x":4.700000762939453,"y":-0.9999232888221741,"y2":-0.012387900613248348},{"x":4.733333587646484,"y":-0.9997806549072266,"y2":0.02094307541847229},{"x":4.766667366027832,"y":-0.9985272884368896,"y2":0.054251737892627716},{"x":4.800000190734863,"y":-0.9961646199226379,"y2":0.08749917149543762},{"x":4.833333969116211,"y":-0.9926950931549072,"y2":0.12065034359693527},{"x":4.866666793823242,"y":-0.9881227612495422,"y2":0.15366652607917786},{"x":4.90000057220459,"y":-0.9824525117874146,"y2":0.18651293218135834},{"x":4.933333396911621,"y":-0.9756909012794495,"y2":0.21915118396282196},{"x":4.966667175292969,"y":-0.9678451418876648,"y2":0.2515468895435333}]},"height":200,"transform":[{"filter":{"field":"y","range":[-1.5,1.5]}},{"filter":{"field":"y2","range":[-1.5,1.5]}}],"vconcat":[{"encoding":{"x":{"field":"x","type":"quantitative"},"y":{"field":"y","type":"quantitative"}},"mark":{"color":"red","type":"line"},"width":600},{"encoding":{"x":{"field":"x","type":"quantitative"},"y":{"field":"y2","type":"quantitative"}},"mark":{"color":"black","type":"line"},"width":600}],"width":400}
# np.linspace(-5, 5, 300)
x = Nx.iota({1, 300}) |> Nx.multiply(10 / 300) |> Nx.subtract(5)
sin_x = Nx.sin(x) |> Nx.to_flat_list()
cos_x = Nx.cos(x) |> Nx.to_flat_list()
# 横方向
Vl.new(width: 400, height: 200)
|> Vl.data_from_values(x: Nx.to_flat_list(x), y: sin_x, y2: cos_x)
|> Vl.transform(filter: %{field: "y", range: [-1.5, 1.5]})
|> Vl.transform(filter: %{field: "y2", range: [-1.5, 1.5]})
|> Vl.concat([
Vl.new(width: 600)
|> Vl.mark(:line, color: :red)
|> Vl.encode_field(:x, "x", type: :quantitative)
|> Vl.encode_field(:y, "y", type: :quantitative),
Vl.new(width: 600)
|> Vl.mark(:line, color: :black)
|> Vl.encode_field(:x, "x", type: :quantitative)
|> Vl.encode_field(:y, "y2", type: :quantitative)
])
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","concat":[{"encoding":{"x":{"field":"x","type":"quantitative"},"y":{"field":"y","type":"quantitative"}},"mark":{"color":"red","type":"line"},"width":600},{"encoding":{"x":{"field":"x","type":"quantitative"},"y":{"field":"y2","type":"quantitative"}},"mark":{"color":"black","type":"line"},"width":600}],"data":{"values":[{"x":-5.0,"y":0.9589242935180664,"y2":0.28366219997406006},{"x":-4.9666666984558105,"y":0.9678452610969543,"y2":0.2515464127063751},{"x":-4.933333396911621,"y":0.9756909012794495,"y2":0.21915118396282196},{"x":-4.900000095367432,"y":0.9824525713920593,"y2":0.18651247024536133},{"x":-4.866666793823242,"y":0.9881227612495422,"y2":0.15366652607917786},{"x":-4.833333492279053,"y":0.992695152759552,"y2":0.12064987421035767},{"x":-4.800000190734863,"y":0.9961646199226379,"y2":0.08749917149543762},{"x":-4.766666412353516,"y":0.9985273480415344,"y2":0.05425078421831131},{"x":-4.733333110809326,"y":0.9997806549072266,"y2":0.020942598581314087},{"x":-4.699999809265137,"y":0.9999232292175293,"y2":-0.012388854287564754},{"x":-4.666666507720947,"y":0.9989548921585083,"y2":-0.04570654407143593},{"x":-4.633333206176758,"y":0.9968767166137695,"y2":-0.0789734497666359},{"x":-4.599999904632568,"y":0.9936909675598145,"y2":-0.11215262115001678},{"x":-4.566666603088379,"y":0.9894012808799744,"y2":-0.14520718157291412},{"x":-4.5333333015441895,"y":0.9840123057365417,"y2":-0.17810042202472687},{"x":-4.5,"y":0.9775301218032837,"y2":-0.2107958048582077},{"x":-4.4666666984558105,"y":0.9699618816375732,"y2":-0.24325697124004364},{"x":-4.433333396911621,"y":0.9613159894943237,"y2":-0.27544787526130676},{"x":-4.400000095367432,"y":0.9516021013259888,"y2":-0.3073327839374542},{"x":-4.366666793823242,"y":0.9408309459686279,"y2":-0.33887621760368347},{"x":-4.333333492279053,"y":0.9290145635604858,"y2":-0.37004315853118896},{"x":-4.300000190734863,"y":0.9161660075187683,"y2":-0.4007990062236786},{"x":-4.266666412353516,"y":0.9022994041442871,"y2":-0.4311099648475647},{"x":-4.233333110809326,"y":0.8874304890632629,"y2":-0.46094152331352234},{"x":-4.199999809265137,"y":0.871575653553009,"y2":-0.4902609884738922},{"x":-4.166666507720947,"y":0.8547525405883789,"y2":-0.5190357565879822},{"x":-4.133333206176758,"y":0.8369797468185425,"y2":-0.5472338795661926},{"x":-4.099999904632568,"y":0.8182770609855652,"y2":-0.5748240351676941},{"x":-4.066666603088379,"y":0.7986652851104736,"y2":-0.6017755270004272},{"x":-4.0333333015441895,"y":0.7781661748886108,"y2":-0.6280584931373596},{"x":-4.0,"y":0.756802499294281,"y2":-0.6536436080932617},{"x":-3.9666666984558105,"y":0.7345980405807495,"y2":-0.6785025596618652},{"x":-3.933333396911621,"y":0.7115774154663086,"y2":-0.7026076912879944},{"x":-3.9000000953674316,"y":0.6877662539482117,"y2":-0.725932240486145},{"x":-3.866666555404663,"y":0.6631907820701599,"y2":-0.7484503984451294},{"x":-3.8333332538604736,"y":0.6378786563873291,"y2":-0.7701368927955627},{"x":-3.799999952316284,"y":0.6118578314781189,"y2":-0.7909677624702454},{"x":-3.7666666507720947,"y":0.5851572751998901,"y2":-0.8109198212623596},{"x":-3.733333110809326,"y":0.5578063726425171,"y2":-0.8299710750579834},{"x":-3.6999998092651367,"y":0.5298359990119934,"y2":-0.8481001257896423},{"x":-3.6666665077209473,"y":0.5012769103050232,"y2":-0.8652869462966919},{"x":-3.633333206176758,"y":0.4721609354019165,"y2":-0.8815123438835144},{"x":-3.5999999046325684,"y":0.4425203502178192,"y2":-0.8967584371566772},{"x":-3.566666603088379,"y":0.4123881459236145,"y2":-0.9110082387924194},{"x":-3.5333333015441895,"y":0.38179779052734375,"y2":-0.9242458939552307},{"x":-3.5,"y":0.35078322887420654,"y2":-0.9364566802978516},{"x":-3.4666666984558105,"y":0.31937894225120544,"y2":-0.947627067565918},{"x":-3.433333396911621,"y":0.28761985898017883,"y2":-0.9577446579933167},{"x":-3.3999998569488525,"y":0.25554096698760986,"y2":-0.9667982459068298},{"x":-3.366666555404663,"y":0.22317840158939362,"y2":-0.9747776389122009},{"x":-3.3333332538604736,"y":0.19056788086891174,"y2":-0.9816740155220032},{"x":-3.299999952316284,"y":0.15774564445018768,"y2":-0.9874798059463501},{"x":-3.2666664123535156,"y":0.12474791705608368,"y2":-0.9921884536743164},{"x":-3.233333110809326,"y":0.0916118249297142,"y2":-0.9957947731018066},{"x":-3.1999998092651367,"y":0.05837395414710045,"y2":-0.9982947707176208},{"x":-3.1666665077209473,"y":0.025071226060390472,"y2":-0.9996856451034546},{"x":-3.133333206176758,"y":-0.00825935322791338,"y2":-0.9999659061431885},{"x":-3.0999999046325684,"y":-0.04158075898885727,"y2":-0.9991351366043091},{"x":-3.066666603088379,"y":-0.07485596835613251,"y2":-0.9971943497657776},{"x":-3.0333333015441895,"y":-0.10804800689220428,"y2":-0.9941456913948059},{"x":-3.0,"y":-0.14112000167369843,"y2":-0.9899924993515015},{"x":-2.9666664600372314,"y":-0.1740354597568512,"y2":-0.984739363193512},{"x":-2.933333158493042,"y":-0.2067573219537735,"y2":-0.9783922433853149},{"x":-2.8999998569488525,"y":-0.23924946784973145,"y2":-0.9709581136703491},{"x":-2.866666555404663,"y":-0.27147582173347473,"y2":-0.9624452590942383},{"x":-2.8333332538604736,"y":-0.30340054631233215,"y2":-0.9528630971908569},{"x":-2.799999952316284,"y":-0.33498820662498474,"y2":-0.9422222971916199},{"x":-2.7666666507720947,"y":-0.3662036657333374,"y2":-0.9305347204208374},{"x":-2.733333110809326,"y":-0.39701250195503235,"y2":-0.9178131818771362},{"x":-2.6999998092651367,"y":-0.4273800551891327,"y2":-0.9040720462799072},{"x":-2.6666665077209473,"y":-0.4572727680206299,"y2":-0.8893265128135681},{"x":-2.633333206176758,"y":-0.48665744066238403,"y2":-0.8735929131507874},{"x":-2.5999999046325684,"y":-0.5155014395713806,"y2":-0.8568887114524841},{"x":-2.566666603088379,"y":-0.5437727570533752,"y2":-0.8392325043678284},{"x":-2.5333333015441895,"y":-0.5714398622512817,"y2":-0.820643961429596},{"x":-2.499999761581421,"y":-0.5984723567962646,"y2":-0.8011434674263},{"x":-2.4666664600372314,"y":-0.624839723110199,"y2":-0.7807530760765076},{"x":-2.433333158493042,"y":-0.6505128741264343,"y2":-0.7594952583312988},{"x":-2.3999998569488525,"y":-0.6754632592201233,"y2":-0.7373936176300049},{"x":-2.366666555404663,"y":-0.6996632814407349,"y2":-0.714472770690918},{"x":-2.3333332538604736,"y":-0.7230859398841858,"y2":-0.6907581090927124},{"x":-2.299999952316284,"y":-0.745705246925354,"y2":-0.6662759780883789},{"x":-2.2666664123535156,"y":-0.7674962282180786,"y2":-0.6410534977912903},{"x":-2.233333110809326,"y":-0.7884343266487122,"y2":-0.6151189208030701},{"x":-2.1999998092651367,"y":-0.8084965348243713,"y2":-0.5885009765625},{"x":-2.1666665077209473,"y":-0.8276604413986206,"y2":-0.5612291693687439},{"x":-2.133333206176758,"y":-0.8459048271179199,"y2":-0.5333338975906372},{"x":-2.0999999046325684,"y":-0.8632094264030457,"y2":-0.5048460364341736},{"x":-2.066666603088379,"y":-0.8795549869537354,"y2":-0.47579729557037354},{"x":-2.0333330631256104,"y":-0.8949234485626221,"y2":-0.44621971249580383},{"x":-1.999999761581421,"y":-0.909297525882721,"y2":-0.4161466062068939},{"x":-1.9666664600372314,"y":-0.9226613640785217,"y2":-0.3856111764907837},{"x":-1.933333158493042,"y":-0.9350001811981201,"y2":-0.35464730858802795},{"x":-1.8999998569488525,"y":-0.9463001489639282,"y2":-0.3232894241809845},{"x":-1.866666555404663,"y":-0.9565487504005432,"y2":-0.29157236218452454},{"x":-1.8333332538604736,"y":-0.9657346606254578,"y2":-0.2595313787460327},{"x":-1.799999713897705,"y":-0.9738476872444153,"y2":-0.22720181941986084},{"x":-1.7666664123535156,"y":-0.9808787107467651,"y2":-0.1946200579404831},{"x":-1.7333331108093262,"y":-0.9868199229240417,"y2":-0.16182208061218262},{"x":-1.6999998092651367,"y":-0.9916648268699646,"y2":-0.12884430587291718},{"x":-1.6666665077209473,"y":-0.9954079985618591,"y2":-0.09572339057922363},{"x":-1.6333332061767578,"y":-0.9980452060699463,"y2":-0.0624961256980896},{"x":-1.5999999046325684,"y":-0.9995735883712769,"y2":-0.029199426993727684},{"x":-1.566666603088379,"y":-0.9999914765357971,"y2":0.004129712004214525},{"x":-1.5333330631256104,"y":-0.9992983341217041,"y2":0.037454500794410706},{"x":-1.499999761581421,"y":-0.9974949955940247,"y2":0.07073743641376495},{"x":-1.4666664600372314,"y":-0.9945833683013916,"y2":0.10394179075956345},{"x":-1.433333158493042,"y":-0.9905667901039124,"y2":0.13703066110610962},{"x":-1.3999998569488525,"y":-0.9854497313499451,"y2":0.16996727883815765},{"x":-1.366666555404663,"y":-0.9792377352714539,"y2":0.20271506905555725},{"x":-1.3333332538604736,"y":-0.971937894821167,"y2":0.23523764312267303},{"x":-1.299999713897705,"y":-0.9635581374168396,"y2":0.2674991190433502},{"x":-1.2666664123535156,"y":-0.9541078805923462,"y2":0.2994631230831146},{"x":-1.2333331108093262,"y":-0.9435976147651672,"y2":0.3310944437980652},{"x":-1.1999998092651367,"y":-0.9320390224456787,"y2":0.3623579442501068},{"x":-1.1666665077209473,"y":-0.9194449186325073,"y2":0.3932188153266907},{"x":-1.1333332061767578,"y":-0.9058293104171753,"y2":0.4236428439617157},{"x":-1.0999999046325684,"y":-0.8912073373794556,"y2":0.45359620451927185},{"x":-1.0666663646697998,"y":-0.8755950927734375,"y2":0.4830458164215088},{"x":-1.0333330631256104,"y":-0.8590101599693298,"y2":0.5119585394859314},{"x":-1.0,"y":-0.8414709568023682,"y2":0.5403022766113281},{"x":-0.9666662216186523,"y":-0.8229965567588806,"y2":0.5680463910102844},{"x":-0.9333329200744629,"y":-0.8036080002784729,"y2":0.5951589345932007},{"x":-0.8999996185302734,"y":-0.7833266854286194,"y2":0.6216102838516235},{"x":-0.866666316986084,"y":-0.7621750235557556,"y2":0.6473709940910339},{"x":-0.8333330154418945,"y":-0.7401766180992126,"y2":0.6724124550819397},{"x":-0.7999997138977051,"y":-0.7173559069633484,"y2":0.6967068910598755},{"x":-0.7666664123535156,"y":-0.6937381625175476,"y2":0.7202273011207581},{"x":-0.7333331108093262,"y":-0.6693496704101562,"y2":0.742947518825531},{"x":-0.6999998092651367,"y":-0.6442175507545471,"y2":0.7648423314094543},{"x":-0.6666665077209473,"y":-0.6183696985244751,"y2":0.7858873605728149},{"x":-0.6333332061767578,"y":-0.5918347835540771,"y2":0.8060593008995056},{"x":-0.5999999046325684,"y":-0.5646423697471619,"y2":0.825335681438446},{"x":-0.5666666030883789,"y":-0.5368226766586304,"y2":0.8436951041221619},{"x":-0.5333333015441895,"y":-0.5084065198898315,"y2":0.8611171841621399},{"x":-0.5,"y":-0.4794255495071411,"y2":0.8775825500488281},{"x":-0.46666622161865234,"y":-0.4499114751815796,"y2":0.8930731415748596},{"x":-0.4333329200744629,"y":-0.41989800333976746,"y2":0.9075713157653809},{"x":-0.39999961853027344,"y":-0.38941797614097595,"y2":0.9210611581802368},{"x":-0.366666316986084,"y":-0.35850533843040466,"y2":0.9335276484489441},{"x":-0.33333301544189453,"y":-0.3271943926811218,"y2":0.9449570775032043},{"x":-0.2999997138977051,"y":-0.29551994800567627,"y2":0.9553365707397461},{"x":-0.2666664123535156,"y":-0.2635171413421631,"y2":0.9646546840667725},{"x":-0.23333311080932617,"y":-0.23122158646583557,"y2":0.9729011058807373},{"x":-0.19999980926513672,"y":-0.19866915047168732,"y2":0.9800665974617004},{"x":-0.16666650772094727,"y":-0.1658959686756134,"y2":0.9861432313919067},{"x":-0.1333332061767578,"y":-0.13293848931789398,"y2":0.9911242723464966},{"x":-0.09999990463256836,"y":-0.09983332455158234,"y2":0.9950041770935059},{"x":-0.0666666030883789,"y":-0.06661722809076309,"y2":0.997778594493866},{"x":-0.03333330154418945,"y":-0.0333271287381649,"y2":0.9994444847106934},{"x":4.76837158203125e-7,"y":4.76837158203125e-7,"y2":1.0},{"x":0.033333778381347656,"y":0.033327605575323105,"y2":0.9994444847106934},{"x":0.06666707992553711,"y":0.0666177049279213,"y2":0.997778594493866},{"x":0.10000038146972656,"y":0.09983379393815994,"y2":0.9950041174888611},{"x":0.13333368301391602,"y":0.13293896615505219,"y2":0.9911242127418518},{"x":0.16666698455810547,"y":0.1658964455127716,"y2":0.986143171787262},{"x":0.20000028610229492,"y":0.19866961240768433,"y2":0.9800665378570557},{"x":0.23333358764648438,"y":0.23122204840183258,"y2":0.9729009866714478},{"x":0.26666688919067383,"y":0.2635176181793213,"y2":0.9646545648574829},{"x":0.3000001907348633,"y":0.2955203950405121,"y2":0.9553364515304565},{"x":0.33333349227905273,"y":0.32719483971595764,"y2":0.94495689868927},{"x":0.3666667938232422,"y":0.3585057854652405,"y2":0.9335275292396545},{"x":0.40000009536743164,"y":0.38941842317581177,"y2":0.9210609793663025},{"x":0.4333333969116211,"y":0.4198984205722809,"y2":0.9075710773468018},{"x":0.46666717529296875,"y":0.44991233944892883,"y2":0.8930727243423462},{"x":0.5000004768371582,"y":0.47942596673965454,"y2":0.877582311630249},{"x":0.5333337783813477,"y":0.508406937122345,"y2":0.8611169457435608},{"x":0.5666670799255371,"y":0.5368230938911438,"y2":0.8436948657035828},{"x":0.6000003814697266,"y":0.5646427869796753,"y2":0.8253353834152222},{"x":0.633333683013916,"y":0.5918352007865906,"y2":0.8060590028762817},{"x":0.6666669845581055,"y":0.6183700561523438,"y2":0.7858870625495911},{"x":0.7000002861022949,"y":0.6442179083824158,"y2":0.7648419737815857},{"x":0.7333335876464844,"y":0.6693500280380249,"y2":0.7429472208023071},{"x":0.7666668891906738,"y":0.6937385201454163,"y2":0.7202270030975342},{"x":0.8000001907348633,"y":0.7173562049865723,"y2":0.6967065930366516},{"x":0.8333334922790527,"y":0.7401769757270813,"y2":0.672412097454071},{"x":0.8666667938232422,"y":0.7621753811836243,"y2":0.6473706364631653},{"x":0.9000000953674316,"y":0.7833269834518433,"y2":0.6216098666191101},{"x":0.9333338737487793,"y":0.8036085963249207,"y2":0.5951581597328186},{"x":0.9666671752929688,"y":0.8229970932006836,"y2":0.5680455565452576},{"x":1.0000004768371582,"y":0.841471254825592,"y2":0.5403019189834595},{"x":1.0333337783813477,"y":0.8590105175971985,"y2":0.5119579434394836},{"x":1.066667079925537,"y":0.8755953907966614,"y2":0.48304519057273865},{"x":1.1000003814697266,"y":0.8912075161933899,"y2":0.4535957872867584},{"x":1.133333683013916,"y":0.9058294892311096,"y2":0.42364242672920227},{"x":1.1666669845581055,"y":0.9194450974464417,"y2":0.39321839809417725},{"x":1.200000286102295,"y":0.932039201259613,"y2":0.362357497215271},{"x":1.2333335876464844,"y":0.9435977935791016,"y2":0.33109399676322937},{"x":1.2666668891906738,"y":0.9541079998016357,"y2":0.2994626760482788},{"x":1.3000001907348633,"y":0.9635582566261292,"y2":0.267498642206192},{"x":1.3333334922790527,"y":0.9719379544258118,"y2":0.23523741960525513},{"x":1.3666667938232422,"y":0.9792377948760986,"y2":0.20271484553813934},{"x":1.4000005722045898,"y":0.9854498505592346,"y2":0.16996657848358154},{"x":1.4333338737487793,"y":0.9905669093132019,"y2":0.13702994585037231},{"x":1.4666671752929688,"y":0.9945834279060364,"y2":0.10394107550382614},{"x":1.5000004768371582,"y":0.9974949955940247,"y2":0.07073672860860825},{"x":1.5333337783813477,"y":0.9992983341217041,"y2":0.0374537855386734},{"x":1.566667079925537,"y":0.9999914765357971,"y2":0.004129235167056322},{"x":1.6000003814697266,"y":0.9995735883712769,"y2":-0.029199903830885887},{"x":1.633333683013916,"y":0.9980452060699463,"y2":-0.0624966025352478},{"x":1.6666669845581055,"y":0.9954079389572144,"y2":-0.09572386741638184},{"x":1.700000286102295,"y":0.9916647672653198,"y2":-0.12884478271007538},{"x":1.7333335876464844,"y":0.986819863319397,"y2":-0.16182254254817963},{"x":1.7666668891906738,"y":0.9808785915374756,"y2":-0.1946205198764801},{"x":1.8000001907348633,"y":0.9738475680351257,"y2":-0.22720228135585785},{"x":1.8333334922790527,"y":0.965734601020813,"y2":-0.2595316171646118},{"x":1.8666667938232422,"y":0.9565486907958984,"y2":-0.29157260060310364},{"x":1.9000005722045898,"y":0.9462999105453491,"y2":-0.3232901096343994},{"x":1.9333338737487793,"y":0.9349998831748962,"y2":-0.3546479642391205},{"x":1.9666671752929688,"y":0.9226611256599426,"y2":-0.3856118321418762},{"x":2.000000476837158,"y":0.9092972278594971,"y2":-0.41614726185798645},{"x":2.0333337783813477,"y":0.8949230909347534,"y2":-0.44622036814689636},{"x":2.066667079925537,"y":0.8795547485351562,"y2":-0.47579771280288696},{"x":2.1000003814697266,"y":0.8632091879844666,"y2":-0.504846453666687},{"x":2.133333683013916,"y":0.8459045886993408,"y2":-0.5333342552185059},{"x":2.1666669845581055,"y":0.8276602029800415,"y2":-0.5612295866012573},{"x":2.200000286102295,"y":0.8084962368011475,"y2":-0.5885013341903687},{"x":2.2333335876464844,"y":0.7884340286254883,"y2":-0.6151192784309387},{"x":2.266666889190674,"y":0.7674959301948547,"y2":-0.6410538554191589},{"x":2.3000001907348633,"y":0.7457050681114197,"y2":-0.6662761569023132},{"x":2.3333334922790527,"y":0.7230857610702515,"y2":-0.690758228302002},{"x":2.3666672706604004,"y":0.6996627449989319,"y2":-0.7144732475280762},{"x":2.40000057220459,"y":0.6754627823829651,"y2":-0.7373940944671631},{"x":2.4333338737487793,"y":0.6505123376846313,"y2":-0.759495735168457},{"x":2.4666671752929688,"y":0.6248391270637512,"y2":-0.780753493309021},{"x":2.500000476837158,"y":0.5984717607498169,"y2":-0.8011438846588135},{"x":2.5333337783813477,"y":0.5714395046234131,"y2":-0.820644199848175},{"x":2.566667079925537,"y":0.5437723398208618,"y2":-0.8392328023910522},{"x":2.6000003814697266,"y":0.5155010223388672,"y2":-0.8568889498710632},{"x":2.633333683013916,"y":0.4866570234298706,"y2":-0.8735930919647217},{"x":2.6666669845581055,"y":0.45727235078811646,"y2":-0.8893266916275024},{"x":2.700000286102295,"y":0.4273796081542969,"y2":-0.9040722846984863},{"x":2.7333335876464844,"y":0.3970120847225189,"y2":-0.9178133606910706},{"x":2.766666889190674,"y":0.3662034571170807,"y2":-0.9305347800254822},{"x":2.8000001907348633,"y":0.33498796820640564,"y2":-0.9422224164009094},{"x":2.833333969116211,"y":0.30339986085891724,"y2":-0.952863335609436},{"x":2.8666672706604004,"y":0.2714751362800598,"y2":-0.9624454379081726},{"x":2.90000057220459,"y":0.23924876749515533,"y2":-0.9709582924842834},{"x":2.9333338737487793,"y":0.2067566215991974,"y2":-0.9783924221992493},{"x":2.9666671752929688,"y":0.17403475940227509,"y2":-0.9847394824028015},{"x":3.0,"y":0.14112000167369843,"y2":-0.9899924993515015},{"x":3.0333337783813477,"y":0.10804753005504608,"y2":-0.9941457509994507},{"x":3.0666675567626953,"y":0.0748550146818161,"y2":-0.9971944093704224},{"x":3.1000003814697266,"y":0.041580282151699066,"y2":-0.9991351366043091},{"x":3.133334159851074,"y":0.008258399553596973,"y2":-0.9999659061431885},{"x":3.1666669845581055,"y":-0.025071702897548676,"y2":-0.9996856451034546},{"x":3.200000762939453,"y":-0.058374904096126556,"y2":-0.9982947111129761},{"x":3.2333335876464844,"y":-0.0916123017668724,"y2":-0.9957947731018066},{"x":3.266667366027832,"y":-0.12474886327981949,"y2":-0.9921883344650269},{"x":3.3000001907348633,"y":-0.15774588286876678,"y2":-0.9874797463417053},{"x":3.333333969116211,"y":-0.19056858122348785,"y2":-0.9816738963127136},{"x":3.366666793823242,"y":-0.22317864000797272,"y2":-0.9747775793075562},{"x":3.40000057220459,"y":-0.2555416524410248,"y2":-0.9667980670928955},{"x":3.433333396911621,"y":-0.28761985898017883,"y2":-0.9577446579933167},{"x":3.4666671752929688,"y":-0.31937941908836365,"y2":-0.9476269483566284},{"x":3.5,"y":-0.35078322887420654,"y2":-0.9364566802978516},{"x":3.5333337783813477,"y":-0.3817982077598572,"y2":-0.9242457151412964},{"x":3.5666675567626953,"y":-0.41238901019096375,"y2":-0.911007821559906},{"x":3.6000003814697266,"y":-0.44252079725265503,"y2":-0.8967582583427429},{"x":3.633334159851074,"y":-0.47216176986694336,"y2":-0.881511926651001},{"x":3.6666669845581055,"y":-0.5012773275375366,"y2":-0.8652867078781128},{"x":3.700000762939453,"y":-0.5298367738723755,"y2":-0.8480996489524841},{"x":3.7333335876464844,"y":-0.5578067898750305,"y2":-0.8299708366394043},{"x":3.766667366027832,"y":-0.5851578712463379,"y2":-0.8109194040298462},{"x":3.8000001907348633,"y":-0.611858069896698,"y2":-0.790967583656311},{"x":3.833333969116211,"y":-0.6378791928291321,"y2":-0.7701364159584045},{"x":3.866666793823242,"y":-0.6631909608840942,"y2":-0.7484502792358398},{"x":3.90000057220459,"y":-0.6877665519714355,"y2":-0.7259318828582764},{"x":3.933333396911621,"y":-0.7115774154663086,"y2":-0.7026076912879944},{"x":3.9666671752929688,"y":-0.7345983386039734,"y2":-0.6785022020339966},{"x":4.0,"y":-0.756802499294281,"y2":-0.6536436080932617},{"x":4.033333778381348,"y":-0.7781664729118347,"y2":-0.6280580759048462},{"x":4.066667556762695,"y":-0.7986658215522766,"y2":-0.6017747521400452},{"x":4.100000381469727,"y":-0.8182773590087891,"y2":-0.5748236179351807},{"x":4.133334159851074,"y":-0.8369802832603455,"y2":-0.5472331047058105},{"x":4.1666669845581055,"y":-0.854752779006958,"y2":-0.5190353393554688},{"x":4.200000762939453,"y":-0.8715761303901672,"y2":-0.49026015400886536},{"x":4.233333587646484,"y":-0.887430727481842,"y2":-0.4609411060810089},{"x":4.266667366027832,"y":-0.9022998213768005,"y2":-0.43110910058021545},{"x":4.300000190734863,"y":-0.9161660075187683,"y2":-0.4007990062236786},{"x":4.333333969116211,"y":-0.9290147423744202,"y2":-0.37004271149635315},{"x":4.366666793823242,"y":-0.9408309459686279,"y2":-0.33887621760368347},{"x":4.40000057220459,"y":-0.9516022205352783,"y2":-0.3073323369026184},{"x":4.433333396911621,"y":-0.9613159894943237,"y2":-0.27544787526130676},{"x":4.466667175292969,"y":-0.9699620008468628,"y2":-0.24325650930404663},{"x":4.500000953674316,"y":-0.977530300617218,"y2":-0.2107948660850525},{"x":4.533333778381348,"y":-0.9840124249458313,"y2":-0.17809996008872986},{"x":4.566667556762695,"y":-0.9894014000892639,"y2":-0.1452062427997589},{"x":4.600000381469727,"y":-0.9936910271644592,"y2":-0.11215214431285858},{"x":4.633334159851074,"y":-0.9968767762184143,"y2":-0.07897250354290009},{"x":4.6666669845581055,"y":-0.9989549517631531,"y2":-0.045706067234277725},{"x":4.700000762939453,"y":-0.9999232888221741,"y2":-0.012387900613248348},{"x":4.733333587646484,"y":-0.9997806549072266,"y2":0.02094307541847229},{"x":4.766667366027832,"y":-0.9985272884368896,"y2":0.054251737892627716},{"x":4.800000190734863,"y":-0.9961646199226379,"y2":0.08749917149543762},{"x":4.833333969116211,"y":-0.9926950931549072,"y2":0.12065034359693527},{"x":4.866666793823242,"y":-0.9881227612495422,"y2":0.15366652607917786},{"x":4.90000057220459,"y":-0.9824525117874146,"y2":0.18651293218135834},{"x":4.933333396911621,"y":-0.9756909012794495,"y2":0.21915118396282196},{"x":4.966667175292969,"y":-0.9678451418876648,"y2":0.2515468895435333}]},"height":200,"transform":[{"filter":{"field":"y","range":[-1.5,1.5]}},{"filter":{"field":"y2","range":[-1.5,1.5]}}],"width":400}