タグ

matplotlibに関するadbmalのブックマーク (2)

  • matplotlibで日本語 - Qiita

    matplotlib.pyplotでたま~に日語を使う必要があり,そのたびに あれ?fontpropertiesだっけ?propだっけ?property? となるので整理してみたら,凡例だけpropで,あとはfontpropertiesなのですね. (propertyなんて無いし…) ご参考まで. # -*- coding: utf-8 -*- import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties fp = FontProperties(fname=r'C:\WINDOWS\Fonts\YuGothic.ttf', size=14) plt.bar([1, 2], [5, 10], 0.25) plt.bar([1.25, 2.25], [4, 8], 0.25, color=

    matplotlibで日本語 - Qiita
  • matplotlibで、判例やグラフタイトルに日本語を使用する

    matplotlibで、判例などに日語を使う方法のメモ。 こちらを参考にしました。 Matplotlib 利用ノート 判例に日語を表示 グラフの判例に日語を使ってみます。 まず、何も考えずに表示しようとするプログラム。 # -*- coding: utf-8 -*-import pylab# 適当にデータを用意x = [10, 20, 25, 28, 30]# グラフを描画# label名を指定すること!pylab.plot(x, label=u'日語')# 凡例を表示pylab.legend()# 描画pylab.show() こんな感じで、日語の部分が豆腐になります。 こちらが参考になりました。 How to change legend size with matplotlib.pyplot legendにFontPropertiesを渡してやります。 # -*- codin

    matplotlibで、判例やグラフタイトルに日本語を使用する
  • 1