2011-03-21 12 views
11

मैं एक ध्रुवीय साजिश के बजाय 180 डिग्री matplotlib MATLAB में http://www.mathworks.com/matlabcentral/fileexchange/27230-half-polar-coordinates-figure-plot-function-halfpolar के समान में 360 से चला जाता है कि बनाने के लिए कोशिश कर रहा हूँ। कोई विचार?Matplotlib में आधा या चौथाई ध्रुवीय भूखंड?

उत्तर

1

आधिकारिक matplotlib दस्तावेज में उदाहरण कोड बातें एक छोटा सा छंट जाते हैं अगर किसी को सिर्फ आधा साजिश का एक सरल तिमाही की जरूरत है। मैं एक कोड का टुकड़ा है कि कोई है जो कि AxisArtistshere से परिचित नहीं है मदद मिल सकती है लिखा था।

The output image of this code snippet

+0

लिंक केवल प्रदान नहीं करते कृपया answe रु। इसके बजाय यहां अपना कोड पोस्ट करें। – ImportanceOfBeingErnest

1

matplotlib 2.1 या बाद में निम्नलिखित काम करता है। Matplotlib पृष्ठ पर an example भी है।
आप एक सामान्य ध्रुवीय साजिश, ax = fig.add_subplot(111, polar=True) का उपयोग करें और थीटा रेंज सीमित कर सकते हैं। एक आधा ध्रुवीय साजिश

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

या एक तिमाही ध्रुवीय साजिश के लिए के लिए

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

पूरा उदाहरण:

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

संबंधित मुद्दे