How to plot data points above and below the surface in a ternary plot in 3D?

3 ビュー (過去 30 日間)
Emilie M
Emilie M 2017 年 8 月 11 日
コメント済み: Emilie M 2017 年 8 月 18 日
Hello, I have a question. Is there a way to plot, in addition to the surface, some data points in 3 D and not in 2D in a ternary plot? And also to plot them in different colors according if they are below or above the surface ? I successed to plot the surface:
ternsurf(XA,XB,XC,f3);ternlabel('Trifluoperazine', 'Gemcitabine', 'Paclitaxel');
c = colorbar();
but I cannot plot data points in 3 D, the data points were plotted on the base of the ternary plot in 2 D with the command below (figure attached):
ternplot(XA, XB, XC,'marker', 'd','markerfacecolor','yellow','markersize',5); ternlabel('Trifluoperazine', 'Gemcitabine', 'Paclitaxel');
And I would like them in 3D, so I tried the commands below, but it does not work. Do you have an idea ?
%%%%%%%%%points above the surface %%%%%%%%%%
above=datacombinationall(C>Cf3,:)
Xabove=((above(:,1))./IC50A)./TT;
Yabove=((above(:,2))./IC50B)./TT;
Zabove=((above(:,3))./IC50C)./TT;
%%%%%%%%%points below the surface %%%%%%%%%%
below=datacombinationall(C<Cf3,:)
Xbelow=((below(:,1))./IC50A)./TT;
Ybelow=((below(:,2))./IC50B)./TT;
Zbelow=((below(:,3))./IC50C)./TT;
% %
ternplot(Xabove, Yabove, Zabove, 'd','red'); ternlabel('TFP', 'GEM', 'PTX');
hold on
ternplot(Xbelow, Ybelow, Zbelow, 'd','green'); ternlabel('TFP', 'GEM', 'PTX');
Yours sincerely,

採用された回答

Faiz Gouri
Faiz Gouri 2017 年 8 月 16 日
'ternplot' is ternary version of 'plot' command. You can plot 3d points using 'plot3' after creating the ternary axis with a 'ternsurf' command as follows: ternsurf(XA, XB, XC, f3); [x, y] = terncoords(XA, XB, XC); hold on; plot3(x, y, f3); hold off;
  2 件のコメント
Emilie M
Emilie M 2017 年 8 月 18 日
Thank you very much!
Emilie M
Emilie M 2017 年 8 月 18 日
Hello, I have another question because it seems that the caculation of the surface is wrong with the ter n surf. I try with tersurf. Is it possible to plot some data points in 3D also with ternaryc function ?
My surface is defined :
[hg,htick,hcb]=tersurf(XA,XB,XC,f3);
and then I plot the points:
hold on
[h,hg,htick]=terplot;
colormap(jet)
hter=ternaryc(XA,XB,XC);
set(hter,'marker','o','markerfacecolor','yellow','markersize',4)
Yours sincerely,

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by