JuliaでのPyPlot (matplotlib)
ぜんぜん網羅的ではありません。 自分で調べるたびに追加していきます。
種々のプロット
scatter plot
基本はこんなかんじ。
fig = figure("pyplot_scatterplot",figsize=(5,5)) ax = axes() val1 = rand(10) val2 = rand(10) scatter(val1,val2,s=100,alpha=1,edgecolors="")
figsize
で図のサイズ指定。ax = axes()
は後でプロットを加工するときのためのおまじない。(たぶん)s
は点のサイズ、alpha
(0~1)は透明度(1が不透明)。(pythonと同じ)edgecolors=""
は縁なしを意味。(pythonと違う)- (
marker
はpythonと違うらしい。)
プロットの加工
aspect ratio
横幅を縦幅の2倍にするには
ax[:set_aspect](0.5)
figsize
では、プロット全体の形を調整できるけれど、プロットの目盛は表示領域が歪んでいたりするので、これを使うと解決するときがある。
https://groups.google.com/forum/#!msg/julia-users/hyYoc7SkpU8/gYmc1bNyr8gJ