# MATLAB ternary plot **Repository Path**: bldc888/matlab-ternary-plot ## Basic Information - **Project Name**: MATLAB ternary plot - **Description**: MATLAB ternary plot (三元相图) - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 3 - **Created**: 2023-11-13 - **Last Updated**: 2023-11-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # MATLAB ternary plot #### 介绍 MATLAB ternary plot (三元相图) Copyright (c) 2023, Zhaoxu Liu / slandarer Zhaoxu Liu / slandarer (2023). ternary (https://www.mathworks.com/matlabcentral/fileexchange/127958-ternary), MATLAB Central File Exchange. 检索来源 2023/4/18. **免登录下载:** 链接:https://pan.baidu.com/s/14xaTd8RalZTJc4hHqm_USw?pwd=slan \ 提取码:slan #### 基本使用 ```matlab % 初始化三元相图(Init ternary plot) STA=STernary(); % 随机构造数据(Randomly generated data) A=rand(1,50); B=rand(1,50); C=rand(1,50); sz=rand(1,50); % 绘制气泡图(Draw bubble chart) STA.SBubblechart(A,B,C,sz,'CData',A); ``` ![输入图片说明](demo4.png) ```matlab % 初始化三元相图(Init ternary plot) STA=STernary(); % 随机构造数据(Randomly generated data) A=rand(1,30); B=rand(1,30); C=rand(1,30); % STA.SContourf(A,B,C,[],15,'LineWidth',1); % 获取核密度范围并等分(Obtain the range of ksdensity and divide it equally) [~,Z]=STA.SContourf(A,B,C,[],15,'Visible','off'); levels=linspace(.5,max(max(Z)),15); % 依据等值线绘制等高线及等高线填充(Draw contour and contourf by levels) CfHdl=STA.SContourf(A,B,C,[],levels,'LineWidth',1); CHdl=STA.SContour(A,B,C,[],levels,'LineWidth',1,'EdgeColor',[0,0,0]); SHdl=STA.SScatter(A,B,C,40,'filled','CData',[0,0,0]); % 绘制图例(Draw legend) legend([CfHdl,CHdl,SHdl],{'contourf','contour','scatter'},'FontSize',14,'FontName','Cambria') colormap(turbo) ``` ![输入图片说明](demo3_5.png) ```matlab % 随机构造数据(Randomly generated data) A=rand(1,500); B=rand(1,500); C=rand(1,500); STA.SPcolor(A,B,C,10) % STA.SScatter(A,B,C,5,'filled','CData',[0,0,0]); colormap(summer) ``` ![输入图片说明](demo7_2.png) ![输入图片说明](demo7_1.png)