効率的な可視化を作る

Pythonでデータ可視化を磨く

Nick Strayer

Instructor

効率的とは?

  • 物語が伝わるまでの負担を減らす
  • 焦点がぶれないように再配置する
  • 情報量に対する「インク」を改善する
  • メッセージを損なわない

複雑な折れ線が段階的に簡略化され直線になる図

Pythonでデータ可視化を磨く

左に3つの別々のプロット、右に同じ3つを上部にまとめたレポートを示す図

Pythonでデータ可視化を磨く
# Create a subplot w/ one row & two columns.
f, (ax1, ax2) = plt.subplots(1, 2)

# Pass each axes to respective plot sns.lineplot('month', 'NO2', 'year', ax=ax1, data=pol_by_month)
sns.barplot('year', 'count', ax=ax2, data=obs_by_year)

複数年の汚染値の折れ線と、各年の観測数の棒グラフを並べた図

Pythonでデータ可視化を磨く

不要な凡例を削除

折れ線と棒グラフを並べ、棒グラフの色が折れ線の凡例として使えることを示す図

Pythonでデータ可視化を磨く
sns.lineplot('month', 'NO2', 'year', ax=ax1, data=pol_by_month, palette='RdBu',)

sns.barplot('year', 'count', 'year', ax=ax2, data=obs_by_year, palette='RdBu', dodge=False)
# Remove legends for both plots ax1.legend_.remove() ax2.legend_.remove()

棒グラフの色が折れ線の凡例として機能するよう、両方の凡例を外した図

Pythonでデータ可視化を磨く

Ayo berlatih!

Pythonでデータ可視化を磨く

Preparing Video For Download...