Reverse/flip values in the colorbar axis
조회 수: 102 (최근 30일)
이전 댓글 표시
Hi,
In the attached figure, I have reverse the values in the color bar i.e. red to be positive and blue to be negative. Please help me with this. I have tried flipud, but it changes the color pattern in the contour.
댓글 수: 0
답변 (1개)
Bjorn Gustavsson
2020년 10월 15일
편집: Bjorn Gustavsson
2020년 10월 15일
If you want exactly that colormap, but flip it you can do this:
cmp = colormap;
cmp = flipud(cmp);
colormap(cmp);
You should be able to re-set the colormap to jet in one call:
colormap(jet)
HTH
댓글 수: 5
Bjorn Gustavsson
2022년 4월 28일
Not that I disagree with your request for additional colormap-utilities, but "teribly cumbersome" might be a bit of an exageration for what can be done with something as simple as a one-liner:
colormap(flipud(colormap))
that is only 26 characters...
Adi Purwandana
2023년 2월 25일
I tried some above codes... but I found working for me is:
colormap(flipud(jet))
참고 항목
카테고리
Help Center 및 File Exchange에서 Red에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!