I have x, y, z independent data of same size . I also have a dependent data 'w' on these three xyz variables with same size. I want to plot a 2d ternary diagram wherein each side of the triangle depicts the variation of x y z,and inside of the triangle depicts the variation of w. Please help me with this regard. Thank you matlab community

5 Commenti

darova
darova il 25 Ago 2021
DO you have a picture?
Onkar Khadke
Onkar Khadke il 25 Ago 2021
Yes, sure I will share my data and the final figure as well I am looking for.
The file with the name A.mat contains the data, wherein the data in the first three columns should come on the three sides of the triangle. The data in the last(4th) column should be shown with different colors as a map, as shown in the attached figure demo_fig.fig.
Thank you
Onkar Khadke
Onkar Khadke il 25 Ago 2021
The final figure that I am looking for is attached in this message named as screenshot.png.
Sorry for the mistake
Onkar Khadke
Onkar Khadke il 26 Ago 2021
Thanks Chunru for your suggested links. However, implementing the code described in those links is challenging for a new user to MATLAB like me. If you can help me in understanding the scripts that are attached in those links, please help me with that regard. For your reference I am sharing my data file with you, so that you may give a try by implementing my data in those scripts. The filename A.mat contains my data, with first three columns should come on the three sides of the triangle and the fourth column in A.mat should vary inside the triangle with different colors. I hope that you will help me as I am a new user to MATLAB.
Also, sharing and helping improves us in some or the other way.
Thanks

Accedi per commentare.

 Risposta accettata

Read about delaunayTriangulation. This is your function.
Demo:
x = rand(10,1) ;
y = rand(10,1) ;
z = rand(10,1) ;
w = rand(10,1) ;
dt = delaunayTriangulation(x,y) ;
%
t = dt.ConnectivityList ;
trisurf(t,x,y,z,w) ;
shading interp ;
colorbar
If you are not able to get it, you may share your data.

5 Commenti

Onkar Khadke
Onkar Khadke il 26 Ago 2021
Thank you KSSV for your suggested code. I implemented your code using my data. I am attaching the result, code and data herein. code.m is the code implemented as per your suggested script. graph.m is the result that I got using your script. Filename A.mat contains my data with three independent variables in first three columns and the last fourth column is dependent on these three.
However, I am looking for a 2D triangular plot. For better understanding I am attaching the figure that I am looking for using my data. The plot that I am expecting using my data is attached with file name screenshot.png for your reference.
Thank you
Hoping to get your help KSSV
KSSV
KSSV il 26 Ago 2021
What you have is a curve.
How you are expecting a plot as attached?
Onkar Khadke
Onkar Khadke il 26 Ago 2021
I am expecting a 2D triangular plot, wherein each side of this 2D triangle depicts three axes. The file with the name A.mat has the data with 4 columns. The data present in the first three columns of A.mat file should come on the three sides of the 2D traingle, while the data in the 4th column is the variation with respect to these three variables present in the earlier three columns. Now, the data in the 4th column should come in a form of a color map inside the 2D triangle.
So basically I am looking for a 2D ternary color map. I am attaching reference figure of what exactly I am expecting from my data. The data file is named as A.mat and the 2D ternary plot that I am expecting is also attached for your reference with the name as screenshot.png
I hope now it is clear what I am looking for as a plot using my attached data.
Thank you
Hoping for your response
darova
darova il 29 Ago 2021
What about positions of triangles? Dimensions?
Onkar Khadke
Onkar Khadke il 29 Ago 2021
There will be just one triangle @darova. The dimensions of the triangle will be dictated by data points. Please refer to the attached figure .png file with the name screenshot in the earlier chats.

Accedi per commentare.

Più risposte (0)

Categorie

Community Treasure Hunt

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

Start Hunting!

Translated by