2016-12-12 2 views
0

는 주어진 다음의 :하기 matplotlib 플롯 점선 원

import matplotlib.pyplot as plt 
import numpy as np 

x = np.random.randn(60) 
y = np.random.randn(60) 
x2 = np.random.randn(60) 
y2 = np.random.randn(60) 

plt.scatter(x, y, s=80, facecolors='none', edgecolors='r') 
plt.scatter(x2, y2, s=80, facecolors='none', edgecolors='r') 
plt.show() 

어떻게 × 2 만 Y2 대신 (각 원의 윤곽이 점선 대신 고체) 점선 원이 동일한 데이터를 플롯 것?

미리 감사드립니다.

업데이트 :이 here에서와 같이 패치를 수행 할 수 있습니다,하지만 난 가능하면 나는 또한 같은 플롯 원의 또 다른 세트를 플로팅 및 사용되기 때문에이 plt.scatter을 통해 수행 될 필요가 알고 차트 치수가 엉망인 패치 (너무 얇 았음).

답변

2

패스 linestyle='--'에서 scatter.

차라리하지만 linestyle=':'을 사용하는 마커 크기에 대한

enter image description here

plt.scatter(x, y, s=80, facecolors='none', edgecolors='r') 
plt.scatter(x2, y2, s=80, facecolors='none', edgecolors='r', 
      linestyle='--') 
.

+0

감사합니다. Goyo. 여기에 내가 먼저 물어 봐야 할 질문이있다. http://stackoverflow.com/questions/41108055/matplotlib-plot-dashed-circles-using-plt-plot-instead-of-plt-scatter –