MATLAB Answers

0

Removing Extreme Value from Colorbar

Hans123 님이 질문을 제출함. 31 Jan 2019
최근 활동 vik 님이 답변함. 1 Feb 2019
I am working with a 3D scatter plot that is mapping the X,Y, and Z positions of a certain body, the time spent at each point is represented by the the intensity of the color dictated by a colormap. My code works and the color bar also works, however there are few extreme values that skew the color bar thus reducing the usefulness of it.
How can I remove these extreme values from the colorbar yet plot them? I understand the sizes of the arrays should be the same, and I cannot remove the entries from my array as they are important to 3D scatter plot
scatter3(X , Y , Z ,15,time)
newmap = parula(100);
ncol = size(newmap,1);
zpos = 1 + floor(0);
newmap(zpos,:) = [1 0 0];
colormap(newmap);
h=colorbar;

  댓글 수: 0

로그인 to comment.

제품


릴리스

R2017b

답변 수: 1

vik 님의 답변 1 Feb 2019
 채택된 답변

You can set the colormap limits for the current axes by using caxis:
caxis([-5,50])
Values below or above these limits will be colored with the color according to the last or first value of your colormap.

  댓글 수: 0

로그인 to comment.



Translated by