// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // ! This script is provided "as is" by Applied Maths. ! // ! You are free to use and modify this script for your own needs. ! // ! Redistribution or reproduction of the script is prohibited. ! // ! DISCLAIMER: ! // ! Improper use of scripts may corrupt your database. ! // ! Running this script is entirely at your own responsibility. ! // ! Applied Maths accepts no lialibility for any consequences ! // ! resulting from its use. ! // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //$DISPLAY_COMPWIN string expername,st,st2; BRANCH root,bra; integer ok,nr,i; TABLE tb; float simil,x0,y0,xl,yl,xp,yp,minsim,maxsim; if not(CmpIsPresent) then CmpAttach; if not(CmpIsPresent) then { message("Unable to attach a comparison to this script"); stop; } expername=CluGetCurrent; ok=CluGetRoot(expername,root); if (expername="") or (not(ok)) then { message("There is currently no clustering displayed"); stop; } TableCreate(tb,"","1"); ok=CluEnumStart(root,bra); while ok do { CluGetInfo(bra,simil,0.1,nr,0,0); if nr>1 then { TableAddRow(tb); TableSetField(tb,TableGetRowCount(tb),1,str(simil,10,5)); } ok=CluEnumNext(bra); } TableSort(tb,1); minsim=val(TableGetField(tb,1,1)); maxsim=100; if minsim>=maxsim then minsim=maxsim-10; PrnStartScreen(12,12); x0=2;y0=1;xl=9;yl=9; PrnLinestyle(0.02,0,0,0); PrnPolygonPoint(x0-0.3,y0-0.3);PrnPolygonPoint(x0+xl+0.3,y0-0.3); PrnPolygonPoint(x0+xl+0.3,y0+yl+0.3);PrnPolygonPoint(x0-0.3,y0+yl+0.3); PrnPolygonDraw(100,100,100); for i=1 to TableGetRowCount(tb) do { xp=x0+i/TableGetRowCount(tb)*xl; simil=val(TableGetField(tb,i,1)); yp=y0+yl-(simil-minsim)/(maxsim-minsim)*yl; if i=1 then PrnMoveTo(xp,yp); else PrnLineTo(xp,yp); } PrnTextstyle("arial",0.3,0,0,0,0); st=PrnScaleDiv(0,TableGetRowCount(tb)); while st<>"" do { xp=x0+val(splitstring(st,";"))*xl; st2=splitstring(st," "); if st2="" then { PrnMoveto(xp,y0+yl+0.3);PrnLineto(xp,y0+yl+0.2); PrnMoveto(xp,y0-0.3);PrnLineto(xp,y0-0.2); } else { PrnMoveto(xp,y0+yl+0.3);PrnLineto(xp,y0+yl+0.1); PrnMoveto(xp,y0-0.3);PrnLineto(xp,y0-0.1); PrnText(xp-PrnTextSizeX(st2)/2,y0+yl+0.7,st2); } } PrnTextstyle("arial-bold",0.35,0,0,0,0); st2="Number of clusters";PrnText(x0+xl/2-PrnTextSizeX(st2)/2,y0+yl+1.1,st2); PrnTextstyle("arial",0.3,0,0,0,0); st=PrnScaleDiv(minsim,maxsim); while st<>"" do { yp=y0+yl-val(splitstring(st,";"))*yl; st2=splitstring(st," "); if st2="" then { PrnMoveto(x0-0.3,yp);PrnLineto(x0-0.2,yp); PrnMoveto(x0+xl+0.3,yp);PrnLineto(x0+xl+0.2,yp); } else { PrnMoveto(x0-0.3,yp);PrnLineto(x0-0.1,yp); PrnMoveto(x0+xl+0.3,yp);PrnLineto(x0+xl+0.1,yp); PrnTextRight(x0-0.4,yp+0.1,st2); } } PrnTextstyle("arial-bold",0.35,-90,0,0,0); st2="Similarity (%)";PrnText(x0-1.1,y0+yl/2+PrnTextSizeX(st2)/2,st2); PrnEnd;