投稿

3月, 2019の投稿を表示しています

R の sf パッケージと ggplot2

真っ新な R に sf パッケージを立ち上げようとすると、どうしても ggplot2 の map_plot というのが無いといわれます。 恐らく、devtools 版の ggplot2 が必要なのだと考えます。 devtools::install_github("tidyverse/ggplot2")

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` です。

ffmpeg の brew install で、エラー

Plots.jl や Makie.jl で必要な、ffmepg は `brew install ffmpeg` でインストールできます。 ffmpeg が動くか確認の -version でエラーが出ました。 % ffmpeg -version (git)-[master] dyld: Library not loaded: /usr/local/opt/libidn2/lib/libidn2.4.dylib Referenced from: /usr/local/opt/gnutls/lib/libgnutls.30.dylib Reason: image not found zsh: abort ffmpeg -version libidn2 が上手く繋っていないようです。 brew uninstall --ignore-dependencies libidn2 brew install libidn2 brew unlink libidn2 brew link libidn2 これで OK でした。`brew install libidn2` と`brew unlink libidn2' だけでも良いのかもしれません。 % ffmpeg -version (git)-[master] ffmpeg version 4.1.1 Copyright (c) 2000-2019 the FFmpeg developers built with Apple LLVM version 10.0.0 (clang-1000.11.45.5) ... 以下略