change colormap of histogram2

조회 수: 57 (최근 30일)
arnold
arnold 2019년 5월 13일
편집: arnold 2019년 5월 13일
Hi,
I was looking for a way to change the colormap for histogram2 from parula to something else. Couldn't find it.
x = randn(5000);
y = randn(5000);
h = histogram2(test1, test2, 'DisplayStyle','tile');
again: I couldn't find any handle or option to change the colormap.I'd appreciate a hint.
kind regards
Arnold

채택된 답변

Steven Lord
Steven Lord 2019년 5월 13일
Use the colormap function. First let's make the histogram2 plot.
x = randn(5000);
y = randn(5000);
h = histogram2(x, y, 'DisplayStyle','tile');
Next, I'll enable the colorbar (so we can see the color scale.)
colorbar
Finally I'll change the colormap. I'll use jet but you can use one of the ones on the colormap documentation page or one of your own design.
colormap(jet)
  댓글 수: 1
arnold
arnold 2019년 5월 13일
ok, I should have guessed that. thanks

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

추가 답변 (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