본문 바로가기
TensorFlow(AI)/Python&Django

Sample plots in Matplotlib¶

by swconsulting swconsulting 2018. 12. 14.

https://matplotlib.org/tutorials/introductory/sample_plots.html



https://matplotlib.org/gallery/subplots_axes_and_figures/subplot.html


import numpy as np
import matplotlib.pyplot as plt


x1 = np.linspace(0.0, 5.0)
x2 = np.linspace(0.0, 2.0)

y1 = np.cos(2 * np.pi * x1) * np.exp(-x1)
y2 = np.cos(2 * np.pi * x2)

plt.subplot(2, 1, 1)
plt.plot(x1, y1, 'o-')
plt.title('A tale of 2 subplots')
plt.ylabel('Damped oscillation')

plt.subplot(2, 1, 2)
plt.plot(x2, y2, '.-')
plt.xlabel('time (s)')
plt.ylabel('Undamped')

plt.show()


'TensorFlow(AI) > Python&Django' 카테고리의 다른 글

Convert a 1D array to a 2D array in numpy  (0) 2018.12.24
python get current datetime  (0) 2018.12.15
Sample plots in Matplotlib¶  (0) 2018.12.14
The easiest way to convert Jupyter(.ipynb) to Python(.py)  (0) 2018.12.06
pandas-datareader  (0) 2018.11.21
django forms  (0) 2018.10.25

댓글0