📄 contour3draw27.m
字号:
function contour3draw27(z,ch)
% input z, draw x-y-z 3d picture at 27 points,
% 'ch' is the title of z, a character string
% a subroutine programm. fan xiushan edited on 2000. 6.1
% 27 points for NaCl-HCl-H2O system 00.07.18 19:02
x1=[50 45 55 40 50 60 30 50 70 20 30 40 60 80 10 30 50];
x2=[70 90 5 0 10 20 40 60 80 100];
y1=[86.60 77.94 77.94 69.28 69.28 69.28 51.96 51.96 51.96 34.64 34.64 34.64 34.64 34.64];
y2=[17.32 17.32 17.32 17.32 17.32 8.66 0 0 0 0 0 0 0];
x=[x1 x2];
y=[y1 y2];
xlin=linspace(0,100,100); % devided into 100 from 0 to 100
ylin=linspace(0,86.6,100); % devided into 100 from 0 to 86.6
% 27 z values have been existed in main program
[X,Y]=meshgrid(xlin,ylin); % produce tiny lattice (100X100)
Z=griddata(x,y,z,X,Y,'cubic'); % interpolation of Z by the known x,y,z
% colormap(bone);
contour3(X,Y,Z,70) %draw 3D picture
hold on % keep the picture
%plot(x,y,'.','Markersize',5) % dotted 27 points
% zlabel(ch); % z content
title(ch) % the title
text(-10,0,'H2O') % peak 1
text(102,0,'NaCl') % peak 2
text(50,89,'NaH2PO4') % peak 3
x0=[0 100 50 0];
y0=[0 0 86.6 0];
c=[0.4 0.8 0.4]; % color
plot(x0,y0); % 3 lines of the bottom
% patch(x0,y0,c); % fill in the triangle with mixed color c
plot(x,y,'.','Markersize',5) % dotted 27 points
% colorbar % a color indicator of z value
axis equal
axis off
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -