Color on Bar3
조회 수: 20 (최근 30일)
이전 댓글 표시
Hi everyone! I am a MATLAB newbie. I wanna ask why the color at the side of the bar is blue and does not correspond to the colorbar. Could you tell me how to fix? Thanks.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/452233/image.bmp)
댓글 수: 0
답변 (1개)
Nitin Kapgate
2020년 12월 16일
You can use colorbar function to have the same color on all the faces of the 3D bars as demonstrated by the following code snippet:
% Create a 3-D bar graph of data from the magic function.
Z = magic(5);
% Return the surface objects used to create the bar graph in array b.
b = bar3(Z);
% Add a colorbar to the graph.
colorbar
You an refer to this example that shows how to modify a 3-D bar plot by coloring each bar according to its height.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Colormaps에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!