Color a .ply according to Y value
조회 수: 1 (최근 30일)
이전 댓글 표시
I have the follwing plot that I generate:
Instead of having the background be white, i want the peaks of the curves to be white and as they increase in value, I want them to get darker. Does anyone have suggestions for this. The code and data file generates is linked HERE.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/275943/image.png)
댓글 수: 2
Ameer Hamza
2020년 3월 8일
where is the file 'MunkS_500Hz.shd.mat'? It is also needed to run that code.
답변 (1개)
Ameer Hamza
2020년 3월 8일
What is the current colormap, you can reverse it by flipping the colormap matrix.
figure
p = pcshow(ptCloud);
colormap(gray)
p.Colormap = flipud(p.Colormap);
댓글 수: 4
Ameer Hamza
2020년 3월 9일
You can create your own colormap. For example,
figure
colors = ...
[zeros(8, 3);
gray(10);
ones(12, 3)];
p = pcshow(ptCloud);
colormap(colors);
creates following figure
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/275982/image.png)
참고 항목
카테고리
Help Center 및 File Exchange에서 Colormaps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!