본문 바로가기

python/Matplotlib

[<matplotlib.lines.Line2D object at 0x7f1c6c06dd30>]


import matplotlib.pyplot as plt
import numpy as np   #그림좌표
#fig, ax = plt.subplots() # 
x = np.linspace(0, 2, 100) # 0, 2사이를 100개의 동일한 간격으로 설정합니다.  (x2-x1)/(n-1)
#x = linspace(0, 2, 100)

#plot(x, x, label='linear')


def my_plotter(ax, data1, data2, param_dict):

  out = ax.plot(data1, data2, **param_dict)
  return out


data1, data2, data3, data4 = np.random.randn(4, 100)
fig, ax = plt.subplots(1, 1)
my_plotter(ax, data1, data2, {'marker': 'x'})
plt.legend()

plt.show()

 

'python > Matplotlib' 카테고리의 다른 글

pyplot  (0) 2021.07.19
Splitting lines into smaller chunk  (0) 2021.07.19
좌표 범례  (0) 2021.07.19
좌표 생성  (0) 2021.07.19
좌표 생성  (0) 2021.07.19