|
其实,画能量的拆线,方法很多。
rigin
http://sobereva.com/320
其它工具
http://bbs.keinsci.com/thread-9256-1-1.html
python
https://github.com/giacomomarchioro/PyEnergyDiagrams
效果都不错,只是这种线,不用matlab画一下,总感觉不舒服。
其实,具体的,就是分一小段线,一些字,分开画 。
通过设置字体的位置大小来进行标注。
- clear all
- clc
- clf
- %% outline
- % plot the energy profile 4 CHY, who plots the eng profile manully.
- %
- x = [ 1 2 3 4 5 ];
- y1 = [0 9.34 -15.06 -4.08 -15.7];
- y2 = [0 16.23 -5.49 11.59 -2.72];
- t2 ={'R''','TS1''','I1''','TS2''','P'''};
- t1 ={'R','TS1','I1','TS2','P'};
- col ='r';
- flg_ud='up';
- hold on
- [h1]=fun_mm_plot_eng_prof(x,y1,t1,'k','dn')
- flg_ud='dn';
- [h1]=fun_mm_plot_eng_prof(x,y2,t2,'r','up')
- axis equal
- set(gca,'fontsize',20,'xtick',[],'ytick',[-20:10:20],'linewidth',2)
- axis([5 55 -25 25])
- ylabel('Free energy (Kcal/mol)')
- xlabel('Reaction coordinate')
- h=gcf;
- fig_na = '../file_imgs/fig_eng_pro';
- %fun_work_li_035_myfig_out(h,fig_na,3);
- %% logs
- % mod : 2020年 6月 8日 星期一 13时10分15秒 CST
复制代码
fun_mm_plot_eng_prof.m
- function [h]=fun_mm_plot_eng_prof(x,y1,t1,col,flg_ud)
- n_p = length(y1);
- x_thr= 2.6;
- for i = 1:n_p
- plot([x(i)*10-x_thr, x(i)*10+x_thr],[y1(i), y1(i)],'-','linewidth',6,'color',col)
- end
- for i = 1:(n_p-1);
- plot([x(i)*10+x_thr x(i+1)*10-x_thr],[y1(i) y1(i+1)],':','linewidth',2,'color',col)
- end
- for i = 1:n_p
- if y1(i) > 0
- mm_str{i} = {t1{i};['+',num2str(y1(i),'%6.2f')]};
- elseif y1(i)<0
- mm_str{i} = {t1{i};[num2str(y1(i),'%6.2f')]};
- else
- mm_str{i} = {t1{i};num2str(y1(i))};
- end
- end
- if flg_ud=='up'
- for i = 1:n_p
- text(x(i)*10-x_thr+0.2,y1(i)+3,mm_str{i},'color',col,'fontsize',14)
- end
- else
- for i = 1:n_p
- text(x(i)*10-x_thr+0.2,y1(i)-3,mm_str{i},'color',col,'fontsize',14)
- end
- end
- h=gcf;
复制代码
|
|