You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, thank you for your contact.
Can you give me your data or code to reproduce the error. I was expecting that some one might get this error. This error comes from a mismatch between leaves' label number and those located at zero position. Probably, having very similar samples may cause this mismatch.
For the moment, I have changed the code to silence the error (still printing a warning).
I may find a solution. It is not a beautiful solution, but providing radial tree with xticks may solve your issue.
import scipy.cluster.hierarchy as sch
import numpy as np
import radialtree as rt
np.random.seed(1)
numleaf=20
_alphabets=[chr(i) for i in range(97, 97+24)]
labels=sorted(["".join(list(np.random.choice(_alphabets, 10))) for i in range(numleaf)])
x = np.random.rand(numleaf)
D = np.zeros([numleaf,numleaf])
D[0,0]=1
D[5,10]=1
Y = sch.linkage(D, method='ward')
_fig, _ax=plt.subplots()
Z2 = sch.dendrogram(Y,labels=labels, ax=_ax) #this is important point. you need to remove "no_plot" option
xticks=set(_ax.get_xticks())
plt.close(_fig)
type_num=6
type_list=["ex"+str(i) for i in range(type_num)]
sample_classes={"example_color": [np.random.choice(type_list) for i in range(numleaf)]}
rt.plot(Z2, sample_classes=sample_classes, xticks=xticks)
You could also try omniplot.
It has the same functionality with more user friendly functions, if you are familiar with pandas dataframe.
Hello,
First of all, thank you for your work! It has saved me a lot of time.
I have the error in the title at line 149 in radialtree.py and I cannot figure out what might cause it.
The specific difference between labels in my case is "Internal error, label numbers 211 and 255 must be equal!"
Thank you in advance!
The text was updated successfully, but these errors were encountered: