사용자 도구

사이트 도구


matplotlib

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판이전 판
다음 판
이전 판
matplotlib [2020/01/29 05:11] – [Seaborn] rex8312matplotlib [2024/03/23 02:38] (현재) – 바깥 편집 127.0.0.1
줄 3: 줄 3:
 ===== Animation ===== ===== Animation =====
  
-  http://jakevdp.github.io/blog/2012/08/18/matplotlib-animation-tutorial/+  http://jakevdp.github.io/blog/2012/08/18/matplotlib-animation-tutorial/ 
 +  * [[https://towardsdatascience.com/animate-your-graphs-in-python-in-4-easy-steps-243dccad9a7|Animate your Graphs in Python in 4 Easy Steps! (GIF 파일 만들기)]]
  
  
줄 76: 줄 77:
   * https://towardsdatascience.com/everything-you-need-to-know-about-scatter-plots-for-data-visualisation-924144c0bc5   * https://towardsdatascience.com/everything-you-need-to-know-about-scatter-plots-for-data-visualisation-924144c0bc5
  
-====== imshow ======+===== imshow =====
  
 <code python> <code python>
줄 92: 줄 93:
     else:     else:
         c = (1 - min_diff) * w         c = (1 - min_diff) * w
 +    c = np.clip(c, 0, 1)
     cs.append(c)     cs.append(c)
     ax1.text(0,      ax1.text(0, 
줄 103: 줄 105:
 plt.show() plt.show()
 </code> </code>
 +
 +===== Radar chart =====
 +
 +  * https://matplotlib.org/3.1.1/gallery/specialty_plots/radar_chart.html#sphx-glr-gallery-specialty-plots-radar-chart-py
 +
 +<code python>
 +kvs = dict(a=1.0, b=0.2, c=0.4, d=0.5, e=0.7)
 +fig = plt.figure()
 +ax = fig.add_subplot(111, projection='polar')
 +ax.set_title(f'Radar chart')
 +ax.set_ylim([0, 1.0])
 +theta = np.linspace(0.0, 2 * np.pi, len(kvs) + 1, endpoint=True)
 +ax.set_xticks(theta)
 +ax.set_xticklabels([f'{k}' for k in kvs])
 +vs = np.hstack([list(kvs.values()), [list(kvs.values())[0]]])
 +ax.plot(theta, vs)
 +ax.fill_between(theta, 0, vs)
 +plt.show()
 +plt.close()
 +</code>
 +
 +===== Subplot =====
 +
 +  * https://matplotlib.org/3.1.1/gallery/recipes/create_subplots.html#sphx-glr-gallery-recipes-create-subplots-py
 +
 +===== Embedded plot =====
 +
 +<code python>
 +fig, ax = plt.subplots(1, 1, figsize=(12.8, 9.6))
 +
 +data = np.array([
 +  np.random.random(2),
 +  np.random.random(2),
 +  np.random.random(2),
 +])
 +
 +subdata = np.array([
 +  np.random.random(3),
 +  np.random.random(3),
 +  np.random.random(3),
 +])
 +
 +scatter = ax.scatter(data[:, 0], data[:, 1], cmap='jet')
 +ax.set_xlim([-0.2, 1.2])
 +ax.set_ylim([-0.2, 1.2])
 +
 +for idx, (x, y) in enumerate(data):
 +    subdata_ = subdata[idx]
 +    box = ax.get_position()
 +    width = box.width * 0.2
 +    height = box.height * 0.2
 +    xmin, xmax, ymin, ymax = ax.axis()
 +    nx = (x - xmin) / (xmax - xmin) - width / 2
 +    ny = (y - ymin) / (ymax - ymin) - height / 2
 +    inax_position  = ax.transAxes.transform([nx, ny])
 +    transFigure = fig.transFigure.inverted()
 +    infig_position = transFigure.transform(inax_position)  
 +    x = infig_position[0]
 +    y = infig_position[1]
 +    subax = fig.add_axes([x, y, width, height])
 +    subax.get_xaxis().set_visible(False)
 +    subax.get_yaxis().set_visible(False)
 +    subax.plot(subdata_)
 +plt.show()
 +</code>
 +
 +
 +
 +===== Neural Net Weights/Activation =====
 +
 +  * [[https://matplotlib.org/3.1.1/gallery/specialty_plots/hinton_demo.html#sphx-glr-gallery-specialty-plots-hinton-demo-py|hinton diagram]]
  
  
matplotlib.1580274692.txt.gz · 마지막으로 수정됨: (바깥 편집)