2011-03-21 2 views

cevap

1

birisi sadece yarım arsa basit ihtiyaçlarından eğer şeyler biraz gizleyebilir resmi matplotlib belgelerinde örnek kodu. AxisArtistshere ile tanıdık olmayan birine yardımcı olabilecek bir kod parçacığı yazdım.

The output image of this code snippet

+0

bağlantı salt vermeyin lütfen answe rs. Bunun yerine kodunuzu buraya gönderin. – ImportanceOfBeingErnest

1

matplotlib 2.1 veya üstü aşağıdaki çalışır. Matplotlib sayfasında an example da var.
Her zamanki kutup çizimini, ax = fig.add_subplot(111, polar=True) kullanabilir ve theta aralığını sınırlandırabilirsiniz. Bir yarım kutup arsa

ax.set_thetamin(0) 
ax.set_thetamax(180) 

veya çeyrek kutup arsa için için

ax.set_thetamin(0) 
ax.set_thetamax(90) 

Komple örnek:

import matplotlib.pyplot as plt 
import numpy as np 

theta = np.linspace(0,np.pi) 
r = np.sin(theta) 

fig = plt.figure() 
ax = fig.add_subplot(111, polar=True) 
c = ax.scatter(theta, r, c=r, s=10, cmap='hsv', alpha=0.75) 

ax.set_thetamin(0) 
ax.set_thetamax(180) 

plt.show() 

enter image description here