This is the second tutorial on climate visualization using Matlab, particularly on plotting weather data on a psychrometric chart.
Although architects are most familiar with psychrometric chart to understand comfort zone and identify appropriate passive design strategies, psychrometrics is more commonly used by mechanical engineers to study air and water vapor mixture for active mechanical devices to condition air.
Tools like Autodesk’s Ecotect Weather Tool or Climate Consultant are typically sufficient for architects to study comfort zone and passive design strategies. However, for active applications, we need to be able to enter our own data points, such as ones that come from mechanical specs or material properties.
4 scripts 2 data files are included in this distribution.






If you get an error like this one
That means Matlab is not recognizing the folder of your EPW file. Go to File > Set Path and locate the folder.
To set a different color for each month and automatically save the charts, you can do the following.
%written and copyrighted by Ted Ngai www.tedngai.net
%version 0.1 Mar 2011
xSize = 6; %This is the horizontal size of the figure
ySize = 4; %This is the vertical size of the figure
months = {1:31, 32:59, 60:90, 91:120, 121:151, 152:181, 182:212, 213:243, 244:273, 274:304, 305:334, 335:365};
monthstr = {'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'};
figure;
c=0;
for x = 1:12
%get current month
month = cell2mat(months(x))';
%get min/max of month
maxmon=max(month);
minmon=min(month);
%set color value
nColor=[1,0.8-c,0.1+c];
c=c+0.07;
%plot graph
psychro(dbtMax(month),dbtMin(month),ahmMax(month),ahmMin(month),'line',nColor);
xlabel(cell2mat(monthstr(x))); %.. and label for the y axis
%ylabel('temperature (\circC)'); %Input the labels for the x axis
currentFig = gcf;
currentAxes = gca;
set(currentAxes,'FontSize',6);
set(currentFig, 'PaperUnits', 'inches'); %change paperspace units here (also line 25)
set(currentFig, 'PaperSize', [xSize ySize]);
set(currentFig, 'PaperPositionMode', 'manual');
set(currentFig, 'PaperPosition', [0 0 xSize ySize]);
set(currentFig, 'Units', 'inches'); %change paperspace units here too
set(currentFig, 'Position', [0, 0, xSize, ySize]);
axis([minmon maxmon 0 120]);
fn=['psychro_daily_',city,num2str(x),'.ai'];
hgexport(currentFig,fn); %Change the filename here
end
clear xSize ySize currentFig currentAxes fn temp maxmon minmon month ;
Hi,
This is brilliant. Thank you!
Kat
Dear ted,
May I ask the Matlab approach to color the dots as shown in your charts?
Thanks!
good nice
hello, its great, thanks for share this information. I have same ask like ji for you, how do you get the dots on color?
thanks