using Pkg
Pkg.activate("0402")
using Gadfly, Cairo
Gadfly.push_theme(:dark)
#なぜなら、かっこいいから. 自分で色を設定して、themeとして登録もできる詳しくは
#http://gadflyjl.org/v0.6.3/man/themes.html#Named-themes-1
f(x, μ, σ) = (1/(√(2*π*σ^2)))*exp(-(x-μ^2)^2/2σ^2)
#正規分布作る
x = collect(-5:0.1:5)
#numpyならnp.arange(-5,5,0.1)
Standard_Normal_dist = [f(x, 0, 1) for x in x]
p = plot(x=x, y=Standard_Normal_dist)
display(p)
help?> +
search: +
+(x, y...)
Addition operator. x+y+z+... calls this function with all arguments, i.e. +(x, y, z, ...).
Examples
≡≡≡≡≡≡≡≡≡≡
julia> 1 + 20 + 4
25
julia> +(1, 20, 4)
25
...
自分で決めた関数の場合,次のようになる
julia > foo() = println("foo")
foo (generic function with 1 method)
help?> foo
search: foo floor pointer_from_objref OverflowError
No documentation found.
foo is a Function.
# 1 method for generic function "foo":
[1] foo() in Main at none:1
感想
備忘録的な記事になってしまったので,有意義な記事書きます(いずれ)
参考にしたURL,書籍
Julia Programming Projects: Learn Julia 1.x by building apps for data analysis, visualization, machine learning, and the web (English Edition)
Julia Programming Projects: Learn Julia 1.x by building apps for data analysis, visualization, machine learning, and the web (English Edition)
Makie.jl公式レポジトリ Makie.jl公式ドキュメント