Subplot n pcolor matrixes

8 views (last 30 days)
Jose Andrés
Jose Andrés on 20 Sep 2015
Commented: Jose Andrés on 21 Sep 2015
Hello everyone,
I have to subplot n pcolor matrixes in a 1 x n figure, but I have several problems because I can't set the size of the matrixes in the subplot. All my matrixes have the same size (120 x 120) and I must do it without using the image() function.
Please, could you help me?
Thank you so much.

Accepted Answer

Image Analyst
Image Analyst on 21 Sep 2015
Then use imshow(). It's now in base MATLAB and doesn't chop off the last row and last column like pcolor() does.
  3 Comments
Jose Andrés
Jose Andrés on 21 Sep 2015
Yes, I have been thinking about what you said me and I think you are right, the imshow([]) method is much more effective. I have done my subplot with the imageshow(data,[]) function and I will show it to my superiors; I think they will like it.
Thank you so much one more time.

Sign in to comment.

More Answers (1)

Walter Roberson
Walter Roberson on 20 Sep 2015
n = length(AllMatrices);
for K = 1 : n
this_ax = subplot(1,n,K);
this_matrix = AllMatrices{K};
pcolor(this_ax, this_matrix);
title(sprintf('Matrix #%d', K));
end
  3 Comments
Jose Andrés
Jose Andrés on 21 Sep 2015
Yes, it worked and it really taught me a lot too, but I am sorry can only choose one answer.
Thank you so much anyway, Walter.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by