필터 지우기
필터 지우기

Mark smallest bar in 3-D bar plot

조회 수: 1 (최근 30일)
Luc Kloosterman
Luc Kloosterman 2020년 9월 1일
답변: Dana 2020년 9월 1일
I have a 3d bar plot where the height of a bar resembles the mean squared error of a function estimator. Wit my code I find the combination of simplex and order which results in the lowest mean squared error which is 6 and 5 respectively. The color of the bars is already in corresponding to its height, however due to the small varaition it is not visible which is actually the smallest. Therefore, I would like to put a marker (arrow, diamond, etc) on the smallest bar.
figure(2)
bar = bar3(mse_mat);
for i = 1:size(mse_mat,2)
zdata = ones(6*size(mse_mat,1),4);
k = 1;
for j = 0:6:(6*size(mse_mat,1)-6)
zdata(j+1:j+6,:) = mse_mat(k,i);
k = k+1;
end
set(bar(i),'Cdata',zdata)
end
xlabel('Simplex order')
ylabel('Number of simplices')
yticks((2:2:max_simplices)/2)
yticklabels(split(num2str(2:2:max_simplices)))

답변 (1개)

Dana
Dana 2020년 9월 1일
My default built-in function for drawing arrows in plots is annotation but I believe that only works in 2-D. As a work-around for 3-D, you can probably make something happen with the text function (using the x,y,z syntax). You could also try the arrow function from the File Exchange.

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by