下載本文檔
版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
第利用Matlab繪制好看的弦圖obj.chordTable.Variables=obj.dataMat;
obj.chordTable.Properties.VariableNames=obj.colName;
obj.chordTable.Properties.RowNames=obj.rowName;
helpchordChart
functionobj=draw(obj)
obj.ax.XLim=[-1.38,1.38];
obj.ax.YLim=[-1.38,1.38];
obj.ax.XTick=[];
obj.ax.YTick=[];
obj.ax.XColor='none';
obj.ax.YColor='none';
obj.ax.PlotBoxAspectRatio=[1,1,1];
%計(jì)算繪圖所用數(shù)值
tDMat=obj.chordTable.Variables;
tDFrom=obj.chordTable.Properties.RowNames;
tDTo=obj.chordTable.Properties.VariableNames;
tDMatUni=tDMat-min(min(tDMat));
tDMatUni=tDMatUni./max(max(tDMatUni));
sep1=1/20;
sep2=1/40;
ratioF=sum(tDMat,2)./sum(tDMat,[1,2]);
ratioF=[0,ratioF'];
ratioT=[0,sum(tDMat,1)./sum(tDMat,[1,2])];
sepNumF=size(tDMat,1);
sepNumT=size(tDMat,2);
sepLen=pi*(1-2*sep1)*sep2;
baseLenF=(pi*(1-sep2)-(sepNumF-1)*sepLen);
baseLenT=(pi*(1-sep2)-(sepNumT-1)*sepLen);
tColor=[6196137;7610386]./255;
%繪制下方方塊
fori=1:sepNumF
theta1=2*pi-pi*sep1/2-sum(ratioF(1:i))*baseLenF-(i-1)*sepLen;
theta2=2*pi-pi*sep1/2-sum(ratioF(1:i+1))*baseLenF-(i-1)*sepLen;
theta=linspace(theta1,theta2,100);
X=cos(theta);Y=sin(theta);
obj.squareFHdl(i)=fill([1.05.*X,1.15.*X(end:-1:1)],[1.05.*Y,1.15.*Y(end:-1:1)],...
tColor(1,:),'EdgeColor','none');
theta3=(theta1+theta2)/2;
FHdl(i)=text(cos(theta3).*1.28,sin(theta3).*1.28,tDFrom{i},'FontSize',12,'FontName','Arial',...
'HorizontalAlignment','center','Rotation',-(1.5*pi-theta3)./pi.*180);
obj.RTickFHdl(i)=plot(cos(theta).*1.17,sin(theta).*1.17,'Color',[0,0,0],'LineWidth',.8,'Visible','off');
%繪制上方放塊
forj=1:sepNumT
theta1=pi-pi*sep1/2-sum(ratioT(1:j))*baseLenT-(j-1)*sepLen;
theta2=pi-pi*sep1/2-sum(ratioT(1:j+1))*baseLenT-(j-1)*sepLen;
theta=linspace(theta1,theta2,100);
X=cos(theta);Y=sin(theta);
obj.squareTHdl(j)=fill([1.05.*X,1.15.*X(end:-1:1)],[1.05.*Y,1.15.*Y(end:-1:1)],...
tColor(2,:),'EdgeColor','none');
theta3=(theta1+theta2)/2;
THdl(j)=text(cos(theta3).*1.28,sin(theta3).*1.28,tDTo{j},'FontSize',12,'FontName','Arial',...
'HorizontalAlignment','center','Rotation',-(.5*pi-theta3)./pi.*180);
obj.RTickTHdl(j)=plot(cos(theta).*1.17,sin(theta).*1.17,'Color',[0,0,0],'LineWidth',.8,'Visible','off');
colorFunc=colorFuncFactory(flipud(summer(50)));
%繪制弦
fori=1:sepNumF
forj=sepNumT:-1:1
theta1=2*pi-pi*sep1/2-sum(ratioF(1:i))*baseLenF-(i-1)*sepLen;
theta2=2*pi-pi*sep1/2-sum(ratioF(1:i+1))*baseLenF-(i-1)*sepLen;
theta3=pi-pi*sep1/2-sum(ratioT(1:j))*baseLenT-(j-1)*sepLen;
theta4=pi-pi*sep1/2-sum(ratioT(1:j+1))*baseLenT-(j-1)*sepLen;
tRowV=tDMat(i,:);tRowV=[0,tRowV(end:-1:1)./sum(tRowV)];
tColV=tDMat(:,j)';tColV=[0,tColV./sum(tColV)];
%貝塞爾曲線斷點(diǎn)計(jì)算
theta5=(theta2-theta1).*sum(tRowV(1:(sepNumT+1-j)))+theta1;
theta6=(theta2-theta1).*sum(tRowV(1:(sepNumT+2-j)))+theta1;
theta7=(theta3-theta4).*sum(tColV(1:i))+theta4;
theta8=(theta3-theta4).*sum(tColV(1:i+1))+theta4;
tPnt1=[cos(theta5),sin(theta5)];
tPnt2=[cos(theta6),sin(theta6)];
tPnt3=[cos(theta7),sin(theta7)];
tPnt4=[cos(theta8),sin(theta8)];
ifj==sepNumT,obj.thetaSetF(i,1)=theta5;end
obj.thetaSetF(i,j+1)=theta6;
ifi==1,obj.thetaSetT(1,j)=theta7;end
obj.thetaSetT(i+1,j)=theta8;
%計(jì)算曲線
tLine1=bezierCurve([tPnt1;0,0;tPnt3],200);
tLine2=bezierCurve([tPnt2;0,0;tPnt4],200);
tline3=[cos(linspace(theta6,theta5,100))',sin(linspace(theta6,theta5,100))'];
tline4=[cos(linspace(theta7,theta8,100))',sin(linspace(theta7,theta8,100))'];
obj.chordMatHdl(i,j)=fill([tLine1(:,1);tline4(:,1);tLine2(end:-1:1,1);tline3(:,1)],...
[tLine1(:,2);tline4(:,2);tLine2(end:-1:1,2);tline3(:,2)],...
colorFunc(tDMatUni(i,j)),'FaceAlpha',.3,'EdgeColor','none');
iftDMat(i,j)==0
set(obj.chordMatHdl(i,j),'Visible','off')
end
%繪制刻度線
tX=[cos(obj.thetaSetF(i,:)).*1.17;cos(obj.thetaSetF(i,:)).*1.19;nan.*ones(1,sepNumT+1)];
tY=[sin(obj.thetaSetF(i,:)).*1.17;sin(obj.thetaSetF(i,:)).*1.19;nan.*ones(1,sepNumT+1)];
obj.thetaTickFHdl(i)=plot(tX(:),tY(:),'Color',[0,0,0],'LineWidth',.8,'Visible','off');
forj=1:sepNumT
tX=[cos(obj.thetaSetT(:,j)').*1.17;cos(obj.thetaSetT(
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年高職(工業(yè)分析技術(shù))食品成分檢驗(yàn)綜合測(cè)試試題及答案
- 2025年大學(xué)通識(shí)選修(藝術(shù)鑒賞)試題及答案
- 2025年高職建筑工程技術(shù)(模板支護(hù)工藝)試題及答案
- 2025年高職航空裝備類(lèi)(航空裝備基礎(chǔ))試題及答案
- 2025年高職水路運(yùn)輸與海事管理(海事管理實(shí)務(wù))試題及答案
- 2025 小學(xué)四年級(jí)思想品德下冊(cè)公共場(chǎng)合優(yōu)化禮儀學(xué)習(xí)效果反饋課件
- 養(yǎng)老院老人心理健康制度
- 養(yǎng)老院康復(fù)設(shè)備管理制度
- 2026年學(xué)生檔案管理崗位面試指南含答案
- 2026年鄉(xiāng)村醫(yī)生信息化小測(cè)含答案
- 2026年蘇州高博軟件技術(shù)職業(yè)學(xué)院?jiǎn)握芯C合素質(zhì)筆試備考試題帶答案解析
- 2026年張家界航空工業(yè)職業(yè)技術(shù)學(xué)院?jiǎn)握新殬I(yè)技能考試參考題庫(kù)附答案詳解
- 北師大版(2024)三年級(jí)數(shù)學(xué)上冊(cè) 期末專(zhuān)項(xiàng)復(fù)習(xí)一-數(shù)與代數(shù)(含答案)
- 校長(zhǎng)在期末教師大會(huì)上精彩發(fā)言:2026先善待自己再照亮學(xué)生的路
- 2026屆1月浙江鎮(zhèn)海中學(xué)首考模擬英語(yǔ)試卷
- 重慶酒吧市場(chǎng)行業(yè)分析報(bào)告
- 優(yōu)衣庫(kù)的論文
- 《企業(yè)會(huì)計(jì)準(zhǔn)則應(yīng)用指南(2025年版)》
- 請(qǐng)做飯人員合同協(xié)議
- 學(xué)生體檢結(jié)果反饋家長(zhǎng)通知制度
- 雨課堂學(xué)堂在線學(xué)堂云《C語(yǔ)言程序設(shè)計(jì)精髓(哈工 )》單元測(cè)試考核答案
評(píng)論
0/150
提交評(píng)論