Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8192525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:12:03+00:00 2026-06-07T04:12:03+00:00

I use the following lines of code to plot the images: for t=1:subplotCol subplot(subplotRow,subplotCol,t)

  • 0

I use the following lines of code to plot the images:

for t=1:subplotCol
    subplot(subplotRow,subplotCol,t)
    imagesc([1 100],[1 100],c(:,:,nStep*t));
    colorbar
    xlabel('X-axis')
    ylabel('Y-axis')
    title(['Concentration profile at t_{',num2str(nStep*t),'}'])

    subplot(subplotRow,subplotCol,subplotCol+t)
    hold on;
    plot(distance,gamma(:,1,t),'-ob');
    plot(distance,gamma(:,2,t),'-or');
    plot(distance,gamma(:,3,t),'-og');
    xlabel('h');ylabel('\gamma (h)');
    legend(['\Theta = ',num2str(theta(1))],...
        ['\Theta = ',num2str(theta(2))],['\Theta = ',num2str(theta(3))]);
end

I get the following subplot with images:

enter image description here

As you can see the images in first row are now scaled equally on X and Y axis (Y axis is longer than the X-axis) even though the size of the image matrix is 100×100 for each image on first row.

Can someone help with how to make images in first row look like squares than rectangles which I get currently. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:12:04+00:00Added an answer on June 7, 2026 at 4:12 am

    Use the dataAspectRatio properties of the axes, and set it to [1 1 1]

    %# create a test image
    imagesc(1:10,1:10,rand(10))
    

    enter image description here

    %# you should use the handle returned by subplot
    %# instead of gca
    set(gca,'dataAspectRatio',[1 1 1])
    

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use the following lines of code: $revTerm = . strrev($limitAry[term]); $revTerm = utf8_encode($revTerm);
I use the following code lines to initialize MEF container _mefContainer = new CompositionContainer(
In Matlab we can use the following code lines in order to set the
When plotting color-maps using gnuplot, I usually use the following lines: ... set palette
I use following code: Create a retry policy, when error, retry after 1 second,
I just use following code to add an image to my project, var paper
I've seen the following lines of code and I know what they do, but
I have the following lines of code: sql = source C:\\My Dropbox\\workspace\\projects\\hosted_inv\\create_site_db.sql cursor.execute (sql)
As question, I am trying to create a plot using the following code: chart.demo.sex.age
I'm using the following lines of code to call the web-service below: def wsdl

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.