clear all; close all; clc;
load temperature.txt;
time = temperature(:,1);
x = temperature(:,2);
temperature_system = temperature(:,3);
pos = (temperature_system > prctile(temperature_system,97));
time(pos) = [];
x(pos) = [];
temperature_system(pos) = [];
X1 = [time x];
F = scatteredInterpolant(X1,temperature_system);
x1 = linspace(min(x),max(x),100);
x2 = linspace(min(time),max(time),100);
[X,Y] = meshgrid(x2,x1);
Z = F(X,Y);
emptyTime = all(Z<10,1);
emptySpace = all(Z<10,2);
[emptyTime, emptySpace] = meshgrid(emptyTime, emptySpace);
Z(emptyTime | emptySpace) = nan;
pos = find(Z<1);
Z(pos) = nan;
f1 = figure(1);
[C,h] = contourf(X,Y,Z, 'Linestyle', 'none');
set(f1,'renderer','opengl');
colormap(jet);
q = colorbar;
q.Label.String = 'Temperature(K)';
qpos = q.Position;
qpos(1) = 1.0*qpos(1);
q.Position = qpos;
map = colormap;
xlabel('Time (ps)','FontSize', 16, 'FontWeight', 'bold',...
'FontName', 'Helvetica', 'Color', 'Black');
ylabel('Length of box (A)','FontSize', 16, 'FontWeight', 'bold',...
'FontName', 'Helvetica', 'Color', 'Black');
set(gca,'YLim',[0 1400]);
set(gca,'YTick',[0:200:1400]);
set(gca,'LineWidth',3,'TickLength',[0.02 0.02]);
set(gca,'XMinorTick','on');
set(gca,'YMinorTick','on');
set(gca,'FontSize',12,'FontName','Helvetica');