text: import numpy as np
  import matplotlib.pyplot as plt
  
  # 都道府県
  pref = ['北海道', '青森', '岩手', '宮城', '秋田', '山形', '福島', '茨城', '栃木',
          '群馬', '埼玉', '千葉', '東京', '神奈川', '新潟', '富山', '石川', '福井',
          '山梨', '長野', '岐阜', '静岡', '愛知', '三重', '滋賀', '京都', '大阪',
          '兵庫', '奈良', '和歌山', '鳥取', '島根', '岡山', '広島', '山口', '徳島',
          '香川', '愛媛', '高知', '福岡', '佐賀', '長崎', '熊本', '大分', '宮崎',
          '鹿児島', '沖縄']
  # 自民投票率
  xs = [41.4, 76.3, 59.2, 51.8, 52.5, 53.2, 62.4, 55.0, 57.7,
        63.2, 37.5, 48.5, 32.4, 20.5, 47.9, 68.9, 68.5, 52.5, 63.3, 58.8,
        59.7, 48.4, 40.7, 51.0, 50.9, 34.3, 25.8, 32.1, 34.4, 55.1, 60.3,
        57.0, 45.6, 54.2, 55.1, 55.7, 70.3, 61.8, 47.6, 42.5, 71.3, 55.2,
        65.2, 42.9, 54.7, 62.0, 48.2]
  # 持ち家比率
  ys = [52.8, 71.2, 72.6, 63.7, 81.3, 81.8, 70.9, 74.0, 73.2,
        72.9, 66.7, 65.7, 43.7, 55.5, 79.6, 85.7, 75.3, 80.5, 73.0, 77.0,
        77.5, 69.2, 60.0, 78.2, 79.5, 61.8, 49.6, 59.6, 72.1, 71.0, 76.3,
        72.8, 71.8, 60.7, 67.0, 71.8, 71.2, 68.3, 68.5, 54.8, 76.0, 65.8,
        69.4, 66.9, 69.7, 71.2, 59.6]
  
  if __name__ == '__main__':
      co = np.corrcoef(xs, ys)
      print(co[0, 1])
  
      plt.rcParams['font.family'] = 'Ricty'
      plt.title('都道府県ごとの自民党の得票率と持ち家比率の相関関係')
      plt.scatter(xs, ys)
      plt.xlabel('自民得票率 [%]')
      plt.ylabel('持ち家比率 [%]')
      for (x, y, p) in zip(xs, ys, pref):
          plt.annotate(p, (x, y))
      plt.show()
  