python - Dendrogram generated by scipy-cluster customisation -


यह एक अनुवर्ती कार्रवाई है

  से matplotlib.pyplot आयात शो से scipy.spatial.distance आयात pdist से scipy.cluster.hirarchy आयात लिंक, numpy.random आयात रैंड एक्स = रैंड (5, 3) एक्स से dendrogram [ 0: 5,:] * = 2 वाई = पीडीआईस्ट (एक्स) जेड = लिंक (वाई) डेन्ड्रोग्राम (जेड) शो ()   

जब डेंड्रोग्राम () कुंजी ivl, पत्ते, रंग_ सूची, icoord के साथ एक शब्दकोश देता है जो कि पाइपोट उठा रहा है pyplot

के पास जाने से पहले लेबल और पत्ती की लंबाई कैसे संशोधित कर सकते हैं

  d = dendrogram (Z ) डी ['पत्ते'] = ['लेबल 1', 'लेबल 2', 'लेबल 3', 'लेबल 4', 'लेबल 5']   

इसे प्रभावित नहीं करता है।

पत्ती की लम्बाई कुछ ऐसा होनी चाहिए:

के अनुसार, आपको लेबल को परिभाषित करने में सक्षम होना चाहिए जब आप इसे कॉल कर रहे हों (या तो लेबल या leaf_label_func आर्ग्स)। इसलिए लेबल के साथ बाद में छेड़छाड़ करने की कोई आवश्यकता नहीं है।

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -