|
别人的问题,记录一下。
这是个记录的帖子:
等我不在这个世界上的时候,希望有人能通过这个帖子的内容,少走些弯路,多学些。
用surf画势能面。分别调整透明程度。
用surf画原子。
用text标注。
设置其它。
- clear all
- clc
- clf
- %% outline
- % plot diff layer potential surfs
- %% main
- % the x,y
- x=[1:10];
- y=[0:8];
- [X,Y]=meshgrid(x,y);
- % your potential values,
- Z1 = sin(0.2*X+0.7*Y );
- Z2 = exp(0.1*X.*cos(0.5*Y.^1.1))+3;
- Z3 = 0.1*((X-5).^2 + (Y-6).^2)+7;
- % atom x,y,z
- [s_x,s_y,s_z]=sphere(50);
- x_shift = 3;
- y_shift = 2;
- z_shift = 12;
- r=0.6;
- %% plot
- hold on
- % surf 3 layers
- h1=surf(X,Y,Z1);
- h2=surf(X,Y,Z2,Z2+10); % you can modify 10 to change the color of the layer
- h3=surf(X,Y,Z3,Z3+20); % you can modify 20 to change the color of the layer
- alpha(h1,0.95);
- alpha(h2,0.9);
- alpha(h3,0.8);
- % plot atom
- surf(r*s_x+x_shift,r*s_y+y_shift,r*s_z+z_shift,'edgecolor','none','markerfacecolor','w')
- % Text
- text(3,4,10,'S_2','fontsize',16)
- % plot point on surf
- plot3(X(6,5),Y(6,5),Z3(6,5),'yo','markerfacecolor','y','markersize',10);
- % other settings
- view(150,30);
- axis off
- axis equal
- camlight
- h=gcf;
- fi_na = 'fig_3layers_pot'
- fun_work_li_035_myfig_out(h,fi_na,3)
- %% logs
- % mod : 2018年 11月 21日 星期三 08:52:09 CST
- % mod by mm
- % contact : meatball1982@163.com
复制代码
|
|