pcolor gridding, grid not match

1 view (last 30 days)
Ilham
Ilham on 12 Mar 2013
Hi. I have a 15 X 15 matrix, and each value in the matrix represents a specific gridblock value. For example if AmountOfRock(1,1) = 300, then gridblock(1,1) with an area of A X A meters in real life have 300 rocks in it, and so on. The problem is, when I use
pcolor(AmountOfRock)
there are only 14 gridblocks, with 15 grid intersections in both X and Y axis. Apparently, pcolor creates a plot in which it assigns each value in AmountOfRocks to grid intersections, not to gridblock. Is there any way to make pcolor assign each value in a matrix to its respective gridblock location and NOT to grid intersection?

Answers (2)

Walter Roberson
Walter Roberson on 12 Mar 2013
No, there is not. Use image() or imagesc() instead of pcolor().
  1 Comment
Image Analyst
Image Analyst on 12 Mar 2013
Common problem. Unfortunately way too common. It should really be explained better or made more obvious in the help. Actually I wonder how so many people, to their detriment, stumble upon pcolor(). I would think they would have encountered image(), imshow(), or imagesc() before pcolor() in their search for a method to display images.

Sign in to comment.


Ilham
Ilham on 12 Mar 2013
Edited: Ilham on 12 Mar 2013
Not a single way? Ok then, I guess I'll just create one additional empty gridblock at the end of the matrix and modify the axes in paint or something...
edit: image() and imagesc() don't work. I guess I'll stick to paint to edit the axes...
  1 Comment
Walter Roberson
Walter Roberson on 12 Mar 2013
Creating an empty gridblock will not solve the problem that your points are going to be interpolated.
What result did you get with imagesc() that was different from what you hoped for?

Sign in to comment.

Categories

Find more on Graphics Performance in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!