2016-11-08 996 views
2

我想繪製一個基於ab-initio能量輸入的三元相圖。在那裏,我發現了一個有用的工具,它可以幫助我:使用MATLAB繪製三元相圖

https://de.mathworks.com/matlabcentral/fileexchange/2299-alchemyst-ternplot

有幾個問題我需要改變:

  1. 我喜歡看到我的輸入階段「名稱標籤」上情節,我在哪裏輸入數據中的座標。 (不僅僅是單獨的數字中的藍點)

  2. 我在terndemo.m中輸入了正能量值,如下所示。儘管如此,它們實際上是負值,當我輸入負值時表面沒有正確顯示。

  3. 我需要給熱譜的標籤?

  4. 最後,我的軸標籤沒有開始正確。例如0不在三角形的邊緣點。

我還附上了關於該圖的所有問題。

有人可以對這個問題提出一些意見嗎?

---這是我demotern.m輸入:

%% Ti Ce Fe 
% Name of the phases in coordinates below: Ti, Ce, Fe, FeTi, Fe2Ti, 
% CeFe2,CeFe5, Ce2Fe17 and CeFe11Ti 
experimental = [... 

    1.000 0.000 0.000 
    0.000 1.000 0.000 
    0.000 0.000 1.000 
    0.500 0.000 0.500 
    0.340 0.000 0.660 
    0.000 0.340 0.660 
    0.000 0.160 0.840 
    0.000 0.110 0.890 
    0.0765 0.0765 0.847 
    ]; 
% data values are actually negative, here I enter positive value 
data = [... 

    0.0 
    0.0 
    0.0 
    0.419 
    0.273 
    0.090 
    0.014 
    0.010 
    0.068 
    ]; 

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

figure 
subplot(2, 2, 1) 
ternplot(A, B, C, '.'); ternlabel('Content of Titanium', 'Content of Cerium', 'Content of Iron'); 
subplot(2, 2, 2) 
ternpcolor(A, B, data); ternlabel('Content of Titainum', 'Content of Cerium', 'Content of Iron'); 
shading interp 
subplot(2, 2, 3) 
terncontour(A, B, data); ternlabel('Content of Titanim', 'Content of Cerium', 'Content of Iron'); 
subplot(2, 2, 4) 
ternsurf(A, B, data); 

Here is the image

+0

我的答案中有什麼不是你需要的嗎? – chthonicdaemon

回答

0

我ternplot的作者

這裏是最好的,我可以這樣做:

  1. 向地塊添加標籤
  2. 我在ternpcolor中繪製曲面圖的方式使得很難使用負值。有一個解決方案,涉及從下面查看數字,但我會留下的另一個問題
  3. 向顏色條添加標籤
  4. 在我的情節標籤是正確的。檢查你有最新版本。

-

names = {'Ti', 'Ce', 'Fe', 'FeTi', 'Fe2Ti', 'CeFe2', 'CeFe5', ... 
     'Ce2Fe17', 'CeFe11Ti'}; 
figure 
ternpcolor(A, B, data); 
vertexlabel('Titainum', 'Cerium', 'Iron'); 
shading interp 
c = colorbar(); 
ylabel(c, 'Formation energy per atom (eV)') 
hold on 
for i = 1:length(names) 
    [x, y] = terncoords(experimental(i, 1), experimental(i, 2)); 
    z = data(i); 

    scatter3(x, y, z+0.4, 100, 'filled', 'ks'); 
    t = text(x + 0.01, y-0.02, z+0.03, names{i}, 'fontsize', 20); 
end 
hold off 

它下面出來,沒有手動編輯:

Output with no editing

但稍加調整(實際上只是走動標籤),這是相當可用:

Output hand-edited