julia の Makie.jl の色

julia の Makie.jl は、カラーマップを :Blue なととします。 stable 版の公式ドキュメントに帯で一覧がありますがどうも見にくいので、改良公開しました。と、いっても latest の方はちゃんと修正されていますね。

h = 0.0
 offset = 0.1
 scene = Scene()
 cam2d!(scene)
 plot = map(AbstractPlotting.colorbrewer_names) do cmap
     global h
     c = to_colormap(cmap)
     cbar = image!(
         scene,
         range(0, stop = 10, length = length(c)),
         range(0, stop = 1, length = length(c)),
         reshape(c, (length(c)), 1),
         show_axis = false
     )[end]
     text!(
         scene,
         string(cmap, ":"),
         position = Point2f0(-0.1, 0.5 + h),
         align = (:right, :center),
         show_axis = false,
         textsize = 0.4
     )
     translate!(cbar, 0, h, 0)
     h -= (1 + offset)
 end
 scene

12行目を reshape(c, 1, (length(c))) から、reshape(c, (length(c)), 1) に変更しています。

名前の一覧は、`AbstractPlotting.colorbrewer_names` です。

B! LINE