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:
fiugures are interchanged in subplot

Subject: fiugures are interchanged in subplot

From: Hermano Cappa

Date: 25 Mar, 2010 17:01:05

Message: 1 of 2

Hi,

I plot two figures with a subplot. But the figure of "P_ss_700" is placed on the buttom instead of on top. The title of the figures stands good. How does it come thate the two figures are interchanged?

path(path,'C:\Documents and Settings\u0064377\Desktop\doctoraat\matlab\roundness model\dynamic model\results\pressure distribution\measured profile\12 x 1 d700')

%data without the profile
load GEO_without_profile.mat
load CALC_ENV_without_profile.mat
load WORK_COND_without_profile.mat
load BEARING_CHAR_without_profile.mat

P_ss_without = BEARING_CHAR.P_ss;

%data with the profile
load GEO_with_profile.mat
load CALC_ENV_with_profile.mat
load WORK_COND_with_profile.mat
load BEARING_CHAR_with_profile.mat

P_ss_with = BEARING_CHAR.P_ss;

P_ss_700 = P_ss_without - P_ss_with;

        x_700 = CALC_ENV.GRID.x;
        y_700 = CALC_ENV.GRID.y;

        
path(path,'C:\Documents and Settings\u0064377\Desktop\doctoraat\matlab\roundness model\dynamic model\results\pressure distribution\measured profile\12 x 1 d100')

%data without the profile
load GEO_without_profile.mat
load CALC_ENV_without_profile.mat
load WORK_COND_without_profile.mat
load BEARING_CHAR_without_profile.mat

P_ss_without = BEARING_CHAR.P_ss;

%data with the profile
load GEO_with_profile.mat
load CALC_ENV_with_profile.mat
load WORK_COND_with_profile.mat
load BEARING_CHAR_with_profile.mat

P_ss_with = BEARING_CHAR.P_ss;

P_ss_100 = P_ss_without - P_ss_with;


        x = CALC_ENV.GRID.x;
        y = CALC_ENV.GRID.y;
        
        figure;
        subplot(211);
        contourf(x_700,y_700,P_ss_700)
        title('Pressure variation induced by the shape error "d=700"','fontsize',12,'FontWeight','bold')
        xlabel('circumferential direction [m]','FontWeight','bold');
        ylabel('axial direction [m]','FontWeight','bold');
        xlim([min(x_700(:)) max(x_700(:))]);
        ylim([min(y_700(:)) max(y_700(:))]);
        set(gca,'DataAspectRatio',[1 1 1],'FontWeight','bold');
        colorbar;
        
        subplot(212);
        contourf(x,y,P_ss_100)
        title('Pressure variation induced by the shape error "d=100"','fontsize',12,'FontWeight','bold')
        xlabel('circumferential direction [m]','FontWeight','bold');
        ylabel('axial direction [m]','FontWeight','bold');
        xlim([min(x(:)) max(x(:))]);
        ylim([min(y(:)) max(y(:))]);
        set(gca,'DataAspectRatio',[1 1 1],'FontWeight','bold');
        colorbar;

Subject: fiugures are interchanged in subplot

From: mat001

Date: 25 Mar, 2010 17:12:06

Message: 2 of 2

"Hermano Cappa" <cappasteven@gmail.com> wrote in message <hog4sh$pro$1@fred.mathworks.com>...
> Hi,
>
> I plot two figures with a subplot. But the figure of "P_ss_700" is placed on the buttom instead of on top. The title of the figures stands good. How does it come thate the two figures are interchanged?
>
> path(path,'C:\Documents and Settings\u0064377\Desktop\doctoraat\matlab\roundness model\dynamic model\results\pressure distribution\measured profile\12 x 1 d700')
>
> %data without the profile
> load GEO_without_profile.mat
> load CALC_ENV_without_profile.mat
> load WORK_COND_without_profile.mat
> load BEARING_CHAR_without_profile.mat
>
> P_ss_without = BEARING_CHAR.P_ss;
>
> %data with the profile
> load GEO_with_profile.mat
> load CALC_ENV_with_profile.mat
> load WORK_COND_with_profile.mat
> load BEARING_CHAR_with_profile.mat
>
> P_ss_with = BEARING_CHAR.P_ss;
>
> P_ss_700 = P_ss_without - P_ss_with;
>
> x_700 = CALC_ENV.GRID.x;
> y_700 = CALC_ENV.GRID.y;
>
>
> path(path,'C:\Documents and Settings\u0064377\Desktop\doctoraat\matlab\roundness model\dynamic model\results\pressure distribution\measured profile\12 x 1 d100')
>
> %data without the profile
> load GEO_without_profile.mat
> load CALC_ENV_without_profile.mat
> load WORK_COND_without_profile.mat
> load BEARING_CHAR_without_profile.mat
>
> P_ss_without = BEARING_CHAR.P_ss;
>
> %data with the profile
> load GEO_with_profile.mat
> load CALC_ENV_with_profile.mat
> load WORK_COND_with_profile.mat
> load BEARING_CHAR_with_profile.mat
>
> P_ss_with = BEARING_CHAR.P_ss;
>
> P_ss_100 = P_ss_without - P_ss_with;
>
>
> x = CALC_ENV.GRID.x;
> y = CALC_ENV.GRID.y;
>
> figure;
> subplot(211);
> contourf(x_700,y_700,P_ss_700)
> title('Pressure variation induced by the shape error "d=700"','fontsize',12,'FontWeight','bold')
> xlabel('circumferential direction [m]','FontWeight','bold');
> ylabel('axial direction [m]','FontWeight','bold');
> xlim([min(x_700(:)) max(x_700(:))]);
> ylim([min(y_700(:)) max(y_700(:))]);
> set(gca,'DataAspectRatio',[1 1 1],'FontWeight','bold');
> colorbar;
>
> subplot(212);
> contourf(x,y,P_ss_100)
> title('Pressure variation induced by the shape error "d=100"','fontsize',12,'FontWeight','bold')
> xlabel('circumferential direction [m]','FontWeight','bold');
> ylabel('axial direction [m]','FontWeight','bold');
> xlim([min(x(:)) max(x(:))]);
> ylim([min(y(:)) max(y(:))]);
> set(gca,'DataAspectRatio',[1 1 1],'FontWeight','bold');
> colorbar;


Its too larger , I am not going to read first.

I have some advice

Read doc subplot

also use some test then think what you have to do.(try)

income = [3.2 4.1 5.0 5.6];
outgo = [2.5 4.0 3.35 4.9];
subplot(2,1,1); plot(income)
title('Income')
subplot(2,1,2); plot(outgo)
title('Outgo')

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