LoginSignup
0
0

JuliaのPlotsで、フォントのサイズなどを設定する

Posted at

目的

これをこうしたい。

変更前 変更後
sin.png sin2.png

方法

defaultを最初に定義することで、Plotsの全体に設定を反映させます。

using Plots
default(
  fontfamily="serif-roman",
  guidefontsize=25,
  tickfontsize=15,
  legendfontsize=15,
  margin=5Plots.mm,
)

Θ = range(-π,π,100)

fig = plot(
    xlabel = "Θ",
    ylabel = "sinθ",
)
plot!(fig,
    Θ,
    sin.(Θ),
    label = :none,
)

まとめ

自分なりのdefaultを作成しておくことで、使いまわせてとても便利です。

0
0
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
0
0