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

  • SEARCH
  • Home
  • 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 5991179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:21:00+00:00 2026-05-22T23:21:00+00:00

I am trying to plot a matrix where each element is in one out

  • 0

I am trying to plot a matrix where each element is in one out of two states. (ising model..)

Now, I would like to have one state colored and the other one white. That works using

[i,j] = find(S);
figure(gcf);
plothandle = scatter(i,j);
axis([0 nNodes+1 0 nNodes+1]);

when S holds the Spins and one state is equal to 0. (find returns a matrix of only non-zero elements)

To have a useful plot, the sizes of the markers should be 1×1 in RELATIVE coordinates. So if the whole matrix S would be in a state non-zero, everything would be colored.

However, it seems like Matlab only allows MarkerSizes in points or inches. How could I solve this?

One idea I had was, that I find out the point-size of the axes and then can easily calculate how big my markers should be. Then I would have to create a callback function if I want to zoom in and so on. Also, I have not yet found a way (without the image acq. toolbox) to find out the absolute size of my axes.

To clarify what I want: How could I plot a chessboard using a matrix with 1 for black and 0 for white fields?

  • 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-05-22T23:21:00+00:00Added an answer on May 22, 2026 at 11:21 pm

    For displaying data of this sort I generally prefer IMAGE or IMAGESC to PCOLOR since PCOLOR won’t display the last row and column of the matrix when using faceted shading (the default). Also, IMAGE and IMAGESC flip the y axis so the image more intuitively matches what you think of when looking at a matrix (i.e. rows start from 1 at the top). You can visualize your matrix like this:

    S = round(rand(20));       %# Sample 20-by-20 matrix of ones and zeroes
    imagesc(S);                %# Plot the image
    colormap([1 1 1; 0 0 0]);  %# Set the colormap to show white (zero elements) and
                               %#   black (non-zero elements)
    

    And here’s a sample image:

    enter image description here

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

Sidebar

Related Questions

Trying to work out distance between two points (lat & lng) I have an
I'm trying to plot out GPS data that is given to me in Hour
I'm trying to plot lines between two or more addresses in Google Maps. The
I'm trying to group one variable of my data by another and then plot
I'm working with core plot on iPhone now, and I'm trying to set up
I am trying to plot two data series in an MSChart. I am using
I am trying to plot a and b, each consisting of 7500 data points.
I have been trying to plot these on a scatter chart using google api.
Trying to get my css / C# functions to look like this: body {
Trying to do this sort of thing... WHERE username LIKE '%$str%' ...but using bound

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.