LoginSignup
0
0

More than 3 years have passed since last update.

matplotlibを使ってみる

Posted at

matplotlibはLinux環境で手軽に使えるデータビジュアライゼーションのライブラリです。公式のチュートリアルに紹介されている最もシンプルなパターンのグラフは例えば以下のようなコードで記述することができます。


import matplotlib.pyplot as plt

fig, ax = plt.subplots()  # Create a figure containing a single axes.
ax.plot([1, 2, 3, 4], [1, 4, 2, 3])  # Plot some data on the axes.

plt.show()

モジュールが見つからないなどのエラーが出る場合は、以下のような手順(pipなど)を使ってインストールします。


sudo pip3 install matplotlib

numpyやpandasも一緒に使うことが多いので入れておくと便利かもしれません。


import numpy as np
import pandas as pd
0
0
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
0
0