1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

wslでelixir その78

Posted at

概要

wsl(wsl2じゃない)で、elixirやってみた。
練習問題やってみた。

練習問題

Livebookで、sin波を表示せよ。

方針

  • vegalite使う

写真

image.png

サンプルコード

data = 1..100
  |> Enum.map(fn x ->
    :math.sin(x / 5)
  end)
VegaLite.new(width: 400, height: 400)
|> VegaLite.data_from_values(iteration: 1..100, score: data)
|> VegaLite.mark(:line)
|> VegaLite.encode_field(:x, "iteration", type: :quantitative)
|> VegaLite.encode_field(:y, "score", type: :quantitative)

以上。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?