はじめに
matplotlibで表示する図のマーカーとして絵文字を用いる方法について説明する。ax.annotateを用いて表示する。
具体的な方法は下記記事の画像をマーカーとして用いる方法と同じとなっている。

[matplotlib] 3.マーカーを画像にしてプロット
画像ファイルを読み込んでマーカーのかわりにプロットする方法について説明する。
コード

解説
モジュールのインポート
バージョン
マーカーの設定
マーカーとして’😎’ と ‘😴’ と ‘😃’を用いる。
データの生成と図の表示
ax.plot(x,y,alpha=0)で透明で見えないplotを表示する。これをしておかないとオートスケールが効かない。
emojiの表示
ax.annotateで絵文字をデータポイントと同じ位置に表示する。マーカーを周期的にプロットするために、元データのxとyをスライスしてannotateしている。
itertoolsを用いたやり方
itertools.cycle((‘😎’, ‘😴’, ‘😃’))のようにmarkerを定義してから、annotateでnext(marker)とすれば周期的にマーカーが表示されるようになる。

参考
https://matplotlib.org/users/dflt_style_changes.html#fonts

unique plot marker for each plot
I have a loop where i create some plots and I need unique marker for each plot. I think about creating function, which r...
コメント