-1

I have tried with your terndemo but I'm unable get a graphical data like you sir. My aim is to present that how, each formulation is responsible for different zetasizes in 3d ternary plot. I tried like editing the file of yours but the result is different.

%% Three D plot for ZetaSize of oil, surfactant and cosurfactant isotropic mixture blends
experimental = [...
   20    60   20
   20    50   30
   20    40   40
   20    30   50
   20    20   60
   25    60   15
   25    50   25
   25    40   35
   25    30   45
   25    20   55
   30    60   10
   30    50   20
   30    40   30
   30    30   40
   30    20   50
   35    55   10
   35    45   20
   35    35   30
   35    25   40];
data = [...
   252.2
   120.4
   165.7
   178.3
   158.9
   322
   294.8
   265.5
   160.7
   431.9
   225.2
   416.3
   484.9
   458.2
   765
   362.2
   526
   331
   743.7];

A = experimental(:, 1)';
B = experimental(:, 2)';
C = 1 - (A + B);

ternsurf(A, B, data); 
ternlabel('oil', 'surf', 'cosurf***strong text***');
James Z
  • 12,209
  • 10
  • 24
  • 44
  • Could You please explain, what exactly are You trying to do and show what have done so far? Because it's really unclear. – Kamiccolo Oct 16 '16 at 16:06
  • Actually I need to plot 3d ternary phase diagram for emulsion which consists of three phases, formulated in different ratios gives different zetasizes. My plot should represent the influences of three mixtures on zetasize variances in 3d. I really want a plot like this link provided to me https://www.mathworks.com/matlabcentral/fileexchange/2299-alchemyst-ternplot – Sunitha Sunil Oct 17 '16 at 16:49
  • You need to be more clear about what data you have and what you have tried so far. The package you link to has a `ternsurf` command which does the kind of plot you seem to be looking for. Have a look a the `terndemo` file which produces the output in the package description. Update your question to indicate what you tried and what went wrong, then we can help you. – chthonicdaemon Oct 19 '16 at 03:39
  • @SunithaSunil You need to divide your coordinates by 100. They must be fractions. – chthonicdaemon Oct 30 '16 at 03:59
  • Hello carl, sorry for mistake in my data, but the last row of my coordinates were equal to 100. I really need a 3D surface area to demonstrate my values at our seminars. – Sunitha Sunil Oct 31 '16 at 15:40
  • @chthonicdaemon I need the file that you have developed to plot tern plot. Actually when I'm trying to edit the file of yours in matlab, it is showing a error message like, Undefined function or variable 'ternsurf'. Error in Untitled (line 47) ternsurf(A, B, data); and also like Undefined function or variable 'ternplot'. Error in terndemo (line 10) ternplot(dataA, dataB, dataC, 'r.', 'majors', 5); – Sunitha Sunil Oct 31 '16 at 16:34
  • @SunithaSunil you need to download all the files from [the github repository](https://github.com/alchemyst/ternplot). To keep things easy, just run my code below in the same directory. If you want the 3d effect just replace `ternpcolor(A, B, data);` with `ternsurf(A, B, data/3000);` but note that I think the top view is easier to interpret. – chthonicdaemon Oct 31 '16 at 17:15
  • @chthonicdaemon I have downloaded all the files from the github repository but it is showing an error message while performing the process. I'm unable to make it. Can you please send me a video of that or any other means to follow. – Sunitha Sunil Nov 02 '16 at 11:38
  • Do this. 1. Download the ternplot files by clicking [this link](http://www.mathworks.com/matlabcentral/mlc-downloads/downloads/submissions/2299/versions/2/download/zip). 2. Unzip the files. 3. Open Matlab and navigate to the folder where you unzipped the files. 4. Create a new file and copy-paste the code I posted. 5. Run the code. – chthonicdaemon Nov 02 '16 at 11:48
  • Undefined function or variable 'extractpositional'. Error in ternplot (line 56) @chthonicdaemon while performing the process, error messages are coming like [varargin, majors] = extractpositional(varargin, 'majors', 10); Error in terndemo (line 10) ternplot(dataA, dataB, dataC, 'r.', 'majors', 5) – Sunitha Sunil Nov 02 '16 at 11:49
  • It seems like you are not changing the current directory to the folder where you unzipped the files. You can see how to change the current directory in [this video](https://youtu.be/RAyumqQAtKc) – chthonicdaemon Nov 02 '16 at 12:21

1 Answers1

1

I've updated this to match your data. Note that the last row of your coordinates doesn't add to 100. I've divided it by 100 and plotted a pcolor plot rather than a 3D surface since I think it's clearer with your data. If you want a 3d surface, you just need to divide the data column by around 1000 to get the correct scale and use ternsurf.

%% Three D plot for ZetaSize of oil, surfactant and cosurfactant isotropic mixture blends
experimental = [...
   20    60   20
   20    50   30
   20    40   40
   20    30   50
   20    20   60
   25    60   15
   25    50   25
   25    40   35
   25    30   45
   25    20   55
   30    60   10
   30    50   20
   30    40   30
   30    30   40
   30    20   50
   35    55   10
   35    45   20
   35    35   30
   35    45   40   % this row doesn't add to 100 
]/100; 
data = [...
   252.2
   120.4
   165.7
   178.3
   158.9
   322
   294.8
   265.5
   160.7
   431.9
   225.2
   416.3
   484.9
   458.2
   765
   362.2
   526
   331
   743.7];

A = experimental(:, 1)';
B = experimental(:, 2)';
C = 1 - (A + B);

ternpcolor(A, B, data);
shading interp
ternlabel('oil', 'surf', 'cosurf');
colorbar

This results in the following plot:

Program output

chthonicdaemon
  • 19,180
  • 2
  • 52
  • 66