clear all

% Create a qualitative energy vs reaction coordinate plot.
%
% Executes properly on MATLAB version 9.4.0.813654 (R2018a).
% Executes mostly properly on OCTAVE version 4.2.1.
% Joshua C. Vaughan 5/8/2020

x = linspace(-0.83,0.9,2^10);

y_offsets = 20;
scale = 10;
peak_amp = 1;
k = 0.7;
red_fac = 0.6;
y1 = y_offsets + scale*( peak_amp*cos(2*pi*k*x) - x );
%y2 = y_offsets + scale*( red_fac*peak_amp*cos(2*pi*k*x) - x - (1-red_fac) );

figure(1); clf
ax_lw = 2;
pl_lw = 2;
ax_fs = 24;
la_fs = 24;
ti_fs = 24;
fontname = 'Arial';

plot(x,y1,'k','linewidth',pl_lw)
xlabel('reaction coordinate','fontsize',la_fs)
ylabel('energy','fontsize',la_fs)
title(['A + B \rightarrow C'],'fontsize',ti_fs)
set(gca,'fontsize',la_fs)
set(gca,'linewidth',ax_lw)
set(gca,'tickdir','out')
set(gcf,'color',[1 1 1])
set(gca,'fontname',fontname)
set(gca,'xtick',[-0.664 0.76])
set(gca,'xticklabel',{'A+B','C'})
set(gca,'yticklabel',{'','','',''})
xlim([-0.9 1])
dy = diff(minmax([y1]));
ylim([min([y1])-dy*0.1 max([y1])+dy*0.1])
%set(gca,'LooseInset',get(gca,'TightInset'));

% Annotate plot. Draw object in MATLAB, then get properties and and
axp = 0.33;
annotation('doublearrow',[axp axp],[0.83 0.56],'color','r','Linewidth',1.5)
text(-0.6,24,'{\itE}_a','fontsize',la_fs,'color','r')






%