In [33]:
import matplotlib.pyplot as plt
from matplotlib import font_manager, rc
import numpy as np
%matplotlib inline
print(np.__version__)
font_name = font_manager.FontProperties(fname="/Library/Fonts/NanumGothic.otf").get_name()
rc("font", family = font_name)
In [39]:
plt.figure()
plt.plot([1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2,1,4,5,6,7,4,3,6,7,8,9,6,7,5,6,7,4])
plt.show()
In [35]:
t = np.arange(0,12, 0.1)
In [36]:
print(t)
In [37]:
print(type(t))
title(value) : 타이틀
xlabel(value) : x축 라벨
ylabel(value) : y축 라벨
figsize=(x_size_value,y_size_value) :
In [38]:
plt.figure(figsize=(10,5))
plt.plot(t)
plt.grid()
plt.xlabel("시간")
plt.ylabel("value")
plt.title("Example ~~~")
plt.show()
In [73]:
t = np.arange(0, 5, 0.5)
print(t)
plt.figure()
plt.grid()
plt.title("Example")
plt.xlabel("x축")
plt.ylabel("y축")
plt.plot(t, t, t, t**2, t, t**3)
# plt.plot(t,t, t,t**2)
plt.show()
In [71]:
x = [1,2,3,4,5]
y = [1,4,9,16,25]
plt.figure(figsize=(4,4))
plt.plot(x,y)
plt.grid()
plt.show()
In [68]:
t= np.arange(0,5,0.5)
plt.figure()
plt.plot(t,t, 'r--', t, t**2, 'bs', t, t**3, 'g^')
plt.show()
In [89]:
t = np.arange(10,101, 0.01)
plt.figure()
plt.plot(t,t*50,t,t**2,'g--',t,((t**2)*-1),"r--")
plt.grid()
plt.show()
In [93]:
t = np.arange(0,5,0.1)
plt.figure(figsize=(10,10))
plt.plot(t,t)
plt.plot(t,t**2,"r--")
plt.plot(t,t**3)
plt.title("Sample")
plt.xlabel("시간")
plt.ylabel("값")
plt.grid()
plt.show()
In [ ]: