2016-11-08 1003 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