forked from alchemyst/ternplot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vertexlabel.m
35 lines (26 loc) · 1011 Bytes
/
vertexlabel.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
% VERTEXLABEL label ternary phase diagram at vertices
% VERTEXLABEL('ALABEL', 'BLABEL', 'CLABEL') puts labels at vertices of ternary phase diagrams created using TERNPLOT
%
% VERTEXLABEL('ALABEL','BLABEL','CLABEL',OFFSET) sets the labels OFFSET units away from the vertices.
% H = VERTEXLABEL('ALABEL', 'BLABEL', 'CLABEL') returns handles to the text objects created.
% with the labels provided. TeX escape codes are accepted.
%
% See also TERNLABEL TERNPLOT TERNCONTOUR TERNCONTOURF
% b
% / \
% / \
% c --- a
% Author: Peter Selkin 20030508 Modified from Carl Sandrock 20020827
% To Do
% Modifications
% Modifiers
function h = vertexlabel(A, B, C, offset)
if (nargin~=4)
offset=0.03;
end
r(1) = text(-offset, -offset, C, 'horizontalalignment', 'right');
r(2) = text(1+offset, -offset, A, 'horizontalalignment', 'left');
r(3) = text(0.5, sin(deg2rad(60))+offset, B, 'horizontalalignment', 'center');
if nargout > 0
h = r;
end;