필터 지우기
필터 지우기

Changing color map to show different points in a matrix

조회 수: 2 (최근 30일)
Raza
Raza 2019년 2월 17일
댓글: Raza 2019년 2월 17일
I have a matrix of size a = (45x45), I am trying to plot it using contourf(). I am having a problem when I apply colorbar and colormap to my data because it does not represent all the values present in the data, instead it just shows the highest and lowest value. If my data is in the range [-1 1], it just shows that every thing is just -1 or 1. I am using 'jet' colormap. Whenever I plot it using surf() function it shows all the different values with different colors which is what i want but I want it in 2D and also I dont want the mesh in it.
here is the code I have:
contourf(a);
title('a');
colormap(jet(128));
caxis([-1 1]);
colorbar;
Any help would be appreciated.
Thank you.
  댓글 수: 4
Walter Roberson
Walter Roberson 2019년 2월 17일
h = pcolor(a); h.EdgeColor = 'none'
Raza
Raza 2019년 2월 17일
Thank you for your help Walter, I will try that.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by