Skip to content

Instantly share code, notes, and snippets.

@lockdef
Created November 29, 2018 14:55
Show Gist options
  • Save lockdef/e4f907cacb2f394fbaf42c2b29398215 to your computer and use it in GitHub Desktop.
Save lockdef/e4f907cacb2f394fbaf42c2b29398215 to your computer and use it in GitHub Desktop.

はじめに

Python3を用いたグラフ描写プログラムを書いていきます。

環境

Python 3.6.6
matplotlib
numpy

プログラム本体

import numpy as np
import matplotlib.pyplot as plt

x = np.arange(-10, 10, 0.1)
y = eval(input('f(x)='))

plt.plot(x, y)
plt.show()

入力された関数のグラフがプロットされます。

お疲れ様でした。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment