Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
contourf

Subject: contourf

From: John Wise

Date: 5 Apr, 2012 13:34:35

Message: 1 of 2

Hi,
I am using contourf to plot 6 different variables on 6 different surfaces as follows:
figure (1)
% [xc1,yc1]=contourf(py2w,pz2w,irw2,20);
% colorbar;
% ylabel(colorbar,'Incident Radiant Heat (W/m^2)')
% xlabel('Distance on the (Y) Coordinate (m)');
% ylabel('Tank Hieght (m)');
% grid on

% figure (2)
% [xc2,yc2]=contourf(pxr2,pyr2,irr2,20);
% colorbar;
% ylabel(colorbar,'Incident Radiant Heat (W/m^2)')
% xlabel('Distance on the (Y) Coordinate (m)');
% ylabel('Distance on the (X) Coordinate (m)');
% grid on

% figure (3)
% [xc3,yc3]=contourf(px3w,pz3w,irw3,20);
% colorbar;
% ylabel(colorbar,'Incident Radiant Heat (W/m^2)')
% xlabel('Distance on the (X) Coordinate (m)');
% ylabel('Tank Hieght (m)');
% grid on
% %
% %
% figure (4)
% [xc4,yc4]=contourf(pxr3,pyr3,irr3,20);
% colorbar;
% ylabel(colorbar,'Incident Radiant Heat (W/m^2)')
% xlabel('Distance on the (X) Coordinate (m)');
% ylabel('Distance on the (Y) Coordinate (m)');
% grid on

% figure (5)
% [xc5,yc5]=contourf(px4w,pz4w,irw4,20);
% colorbar;
% ylabel(colorbar,'Incident Radiant Heat (W/m^2)')
% %title('Heat Received by the Adjacent Tank (D) Wall');
% xlabel('Distance on the (X) Coordinate (m)');
% ylabel('Tank Hieght (m)');
% grid on

% figure (6)
% [xc6,yc6]=contourf(pxr4,pyr4,irr4,20);
% colorbar;
% ylabel(colorbar,'Incident Radiant Heat (W/m^2)')
% xlabel('Distance on the (X) Coordinate (m)');
% ylabel('Distance on the (Y) Coordinate (m)');
% grid on


I want to compare the resuls of the six figures but with the same scale of colors for all of them. Also how to plot all the variables in one 3d figure. thanks alot

Subject: contourf

From: John Smith

Date: 10 Apr, 2012 16:44:12

Message: 2 of 2

"John Wise" wrote in message <jlk71b$890$1@newscl01ah.mathworks.com>...
> Hi,
> I am using contourf to plot 6 different variables on 6 different surfaces as follows:
> figure (1)
> % [xc1,yc1]=contourf(py2w,pz2w,irw2,20);
> % colorbar;
> % ylabel(colorbar,'Incident Radiant Heat (W/m^2)')
> % xlabel('Distance on the (Y) Coordinate (m)');
> % ylabel('Tank Hieght (m)');
> % grid on
>
> % figure (2)
> % [xc2,yc2]=contourf(pxr2,pyr2,irr2,20);
> % colorbar;
> % ylabel(colorbar,'Incident Radiant Heat (W/m^2)')
> % xlabel('Distance on the (Y) Coordinate (m)');
> % ylabel('Distance on the (X) Coordinate (m)');
> % grid on
>
> % figure (3)
> % [xc3,yc3]=contourf(px3w,pz3w,irw3,20);
> % colorbar;
> % ylabel(colorbar,'Incident Radiant Heat (W/m^2)')
> % xlabel('Distance on the (X) Coordinate (m)');
> % ylabel('Tank Hieght (m)');
> % grid on
> % %
> % %
> % figure (4)
> % [xc4,yc4]=contourf(pxr3,pyr3,irr3,20);
> % colorbar;
> % ylabel(colorbar,'Incident Radiant Heat (W/m^2)')
> % xlabel('Distance on the (X) Coordinate (m)');
> % ylabel('Distance on the (Y) Coordinate (m)');
> % grid on
>
> % figure (5)
> % [xc5,yc5]=contourf(px4w,pz4w,irw4,20);
> % colorbar;
> % ylabel(colorbar,'Incident Radiant Heat (W/m^2)')
> % %title('Heat Received by the Adjacent Tank (D) Wall');
> % xlabel('Distance on the (X) Coordinate (m)');
> % ylabel('Tank Hieght (m)');
> % grid on
>
> % figure (6)
> % [xc6,yc6]=contourf(pxr4,pyr4,irr4,20);
> % colorbar;
> % ylabel(colorbar,'Incident Radiant Heat (W/m^2)')
> % xlabel('Distance on the (X) Coordinate (m)');
> % ylabel('Distance on the (Y) Coordinate (m)');
> % grid on
>
>
> I want to compare the resuls of the six figures but with the same scale of colors for all of them. Also how to plot all the variables in one 3d figure. thanks alot

You can set the range of colors by setting caxis([cmin cmax]) for all of the figures.
For your second question are you asking to plot each figure separately on one single window (you would use subplot for that) or are you asking to plot every countour on one single figure?

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us