Location: cellLib @ 4c30575094de / BG_fit / gate_plot.m

Author:
WeiweiAi <wai484@aucklanduni.ac.nz>
Date:
2021-11-15 14:51:39+13:00
Desc:
Move figure creation outside of the function
Permanent Source URI:
https://models.physiomeproject.org/workspace/6bc/rawfile/4c30575094ded8dd75c2af87e0f9f8c368fde0c4/BG_fit/gate_plot.m

function gate_plot(alpha,beta,g_ss,tau,params_vec,V,T)
tiledlayout(2,2);
g_ss_fit = p2gss(params_vec,V,T);
ax = nexttile;
plot(ax,V,g_ss,'k--','LineWidth',4);
hold (ax,'on');
plot(ax,V,g_ss_fit,'k','LineWidth',4);
xlabel('Voltage (mV)');
ylabel('m_{ss}');
set(gca,'FontSize',28);
xlim([-120 60]);
set(gca,'XTick',-120:30:60);
set(gca,'YTick',0:0.2:1);
xticklabels({-120,'',-60,'',0,'',60});
yticklabels({0,'','','','',1});
set(gca,'LineWidth',3);
grid on;

tau_fit = p2tau(params_vec,V,T);
ax = nexttile;
plot(ax,V,tau,'k--','LineWidth',4);
hold (ax,'on');
plot(ax,V,tau_fit,'k','LineWidth',4);
% legend('Luo and Rudy','Fitted');
xlabel('Voltage (mV)');
ylabel('\tau_m (ms)');
set(gca,'FontSize',28);
xlim([-120 60]);
set(gca,'XTick',-120:30:60);
% set(gca,'YTick',0:0.2:1);
xticklabels({-120,'',-60,'',0,'',60});
% yticklabels({0,'','','','',1});
set(gca,'LineWidth',3);
set(gca,'xgrid','on');

alpha_fit = calc_alpha(params_vec,V/1000,T);
ax = nexttile;
plot(ax,V,alpha,'k--','LineWidth',4);
hold (ax,'on');
plot(ax,V,alpha_fit,'k','LineWidth',4);
% legend('Luo and Rudy','Fitted');
xlabel('Voltage (mV)');
ylabel('\alpha_m (ms)');
set(gca,'FontSize',28);
xlim([-120 60]);
set(gca,'XTick',-120:30:60);
% set(gca,'YTick',0:0.2:1);
xticklabels({-120,'',-60,'',0,'',60});
% yticklabels({0,'','','','',1});
set(gca,'LineWidth',3);
set(gca,'xgrid','on');

beta_fit = calc_beta(params_vec,V/1000,T);
ax = nexttile;
plot(ax,V,beta,'k--','LineWidth',4);
hold (ax,'on');
plot(ax,V,beta_fit,'k','LineWidth',4);
% legend('Luo and Rudy','Fitted');
xlabel('Voltage (mV)');
ylabel('\beta_m (ms)');
set(gca,'FontSize',28);
xlim([-120 60]);
set(gca,'XTick',-120:30:60);
% set(gca,'YTick',0:0.2:1);
xticklabels({-120,'',-60,'',0,'',60});
% yticklabels({0,'','','','',1});
set(gca,'LineWidth',3);
set(gca,'xgrid','on');