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 8829643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:52:54+00:00 2026-06-14T07:52:54+00:00

I am trying to create a simple heatmap using MATLAB/Octave: As you can see

  • 0

I am trying to create a simple heatmap using MATLAB/Octave:
Heatmap plot

As you can see I have a lot of rows, each of which represents a separate category.

I am using the imagesc function and I would like to be able to scale the image/plot so that each of the y-axis labels could be printed properly (instead of having the mess that can be seen in the image below).

Here is a sample code that I would like to modify:

A = randi(100, 200, 3);
imagesc(A, limit = [0, 100]);
set(gca, 'xtick', [1:3]);
set(gca, 'xticklabel', { "1,000", "2,000", "3,000" });
set(gca, 'ytick', [1:200]);

Edit: I am attaching the solution to the proposed problem, reached thanks to EitanT’s advice as well as the useful information at http://nibot-lab.livejournal.com/73290.html?nojs=1:

paperWidth = 16.5;
paperHeight = 11.7;

set(gcf, 'Position', get(0,'Screensize'));
set(gcf, 'PaperUnits', 'inches');
set(gcf, 'PaperSize', [paperHeight paperWidth]);
set(gcf, 'PaperPositionMode', 'manual');
set(gcf, 'PaperPosition', [0 0 paperWidth paperHeight]);
set(gcf, 'renderer', 'painters'); figure(gcf);

A = randi(100, 200, 3);
imagesc(A, limit = [0, 100]);
set(gca, 'FontSize', 5);
set(gca, 'FontWeight', 'light');
set(gca, 'xtick', [1:3]);
set(gca, 'xticklabel', { "1,000", "2,000", "3,000" });
set(gca, 'ytick', [1:200]);
  • 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-14T07:52:55+00:00Added an answer on June 14, 2026 at 7:52 am

    There are a few possible solutions to this:

    Resizing the figure window

    If the figure is not maximized already, you can do it using:

    set(gcf, 'Position', get(0, 'ScreenSize'))
    

    Instead of get(0, 'ScreenSize') you can, of course, specify any desired dimensions with a custom vector (as described here).

    Reducing the font size

    You can also make the label text smaller simply by decreasing the font size:

    set(gca, 'FontSize', 5)
    

    Note that this, however, affects all text in the current axes.

    Reducing the number of displayed ticks

    As a last resort, you can reduce the number of displayed ticks in the y-axis, i.e increase the tick interval. Instead of 1:200, try playing with other intervals, for instance:

    set(gca, 'YTick', [1:20:200])
    

    Try a combination of the solutions described above, for better visualization.

    You can read more about axis control in the official documentation. Also, as suggested by you in one of the comments, this page contains a lot of additional useful tricks for displaying plots in MATLAB.

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

Sidebar

Related Questions

Im trying to create a simple callback using blocks. I have a MainViewController which
I'm trying to create simple login/registration page. I'm using index.php which includes login.php in
I'm trying to create simple blob tracking using OpenCV. I have detected the blobs
I'm trying to create a simple looping feature using HTML5 audio and have a
I am trying to create a simple heatmap in R, using a diverging colour
Im trying to create a simple pan and zoom app using silverlight 4, but
I'm trying to create a simple widget to retrieve a users feeds, I have
I am trying to create a simple program using Gstreamer to take the input
Im trying to create a simple image resize feature, can you tell me where
I'm trying to create a simple dynamic gallery with a radio button under each

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.