For the following plots, colormap I have tried does not seem to be working.
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello,
I am trying to make a vector field plot using arrow3D. Here, I want the colormap on arrow to change with the variation in z-axis more like aplot of a magnetic skyrmion field. But the cmap is not wokring.
kindly don't post the entire code. A snippet of code for the understanding would be a great help!
Thanks.
댓글 수: 5
Image Analyst
2023년 5월 26일
Reconcile "colormap I have tried does seem to be working" with "the cmap is not wokring". Is it working or not, or sometimes working and sometimes not working?
답변 (1개)
Adam Danz
2023년 5월 26일
이동: Adam Danz
2023년 5월 26일
The question is about cmap but cmap doesn't exist in you code so I assume cmap is a variable (or function) in arrow3D but I don't know what arrow3D is so how is it possible to address the issue?
You're right that MATLAB's quiver3 does not support colormap mapping. You could plot each quiver arrow individually in which case each arrow could have its own color but depending on the number of arrows, this could make take up a lot of memory since you're creating many quiver objects that way. That method is demonstrated in the two answers below (in 2D).
- https://www.mathworks.com/matlabcentral/answers/598141-how-do-i-create-a-colour-quiver-plot-colquiver-on-top-of-a-pcolor-depth-map#answer_498724
- https://www.mathworks.com/matlabcentral/answers/828465-quiver-with-color-add-on#answer_698630
Maybe there's a 3D demo in the forum, I haven't checked.
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!