LoginSignup
1
3

More than 3 years have passed since last update.

製薬企業研究者がSeabornについてまとめてみた

Posted at

はじめに

ここではSeabornの基本的な利用方法について解説します。
Python3系の使用を想定しています。

インポート

慣例として、snsとしてインポートすることが多いです。

Seaborn_1.py
import seaborn as sns

Seabornの適用

matplotlibで作成した図に対して、seaborn.set()メソッドを用いることで、見た目を変えることができます。

Seaborn_2.py
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns

sns.set()

x = [1, 2, 3]
y = [3, 1, 2]
plt.title('Line-chart') # グラフタイトル
plt.xlabel('X-axis') # x軸ラベル
plt.ylabel('Y-axis') # y軸ラベル

plt.plot(x, y) # グラフを作成
plt.savefig('seaborn_2.png') # グラフを画像ファイルとして保存

seaborn_2.png

まとめ

ここでは、Seabornの基本的な利用方法について解説しました。
Matplotlibで作成した図の見た目を変更したい場合は使ってみると良いでしょう。

参考資料・リンク

プログラミング言語Pythonとは?AIや機械学習に使える?

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3