FaceAlpha of bar3 plot smaller than 1 ruins rest of the plot

조회 수: 2 (최근 30일)
Sven Schulze
Sven Schulze 2016년 6월 16일
댓글: Sven Schulze 2016년 6월 17일
Hello,
I am trying to generate the same plot as shown in the picture under 1). I got as far as shown under 2a) on the right hand side of the picture. As soon as I change the FaceAlpha of the surface of the bar3 plot the rest of the plot (area and contour) gets shaded as well (see 2b).
I create the figure as followed:
contourf(n_ICE_map_neu,Tq_ICE_map,bsfc_ICE_map,'Fill','on')
hold all
area(n_ICE_map_neu,Tq_ICE_max_map,'BaseValue',2400,'FaceColor',[1 1 1]);
plot(n_ICE_map_neu,Tq_ICE_max_map)
bar3(Tq_vector,matrix_pct)
I use MATLAB 2016a. Does anybody can help me to fix that problem?
Best regards
Sven

답변 (1개)

Sven
Sven 2016년 6월 16일
Hi Sven,
We don't have your data (and we don't even know which of your variables are matrices, which are vectors etc.), so we can't make your figure. But it looks like you're having trouble getting all of the bars to be transparent. Try this:
N = 12;
Z = peaks(N);
figure
contourf(1:N,1:N,Z,'Fill','on')
hold on
b = bar3(Z);
set(b,'FaceAlpha',0.15,'FaceColor',[1 1 1]*0.9)
view(3)
Did that help?
  댓글 수: 1
Sven Schulze
Sven Schulze 2016년 6월 17일

Hi Sven,

thanks for your answer. I changed the FaceAlpha for all the bars according to you answer but the problem still remains...I attached all the required data. The matfile dataset contains all the matrices and vectors. The script create_figure generates the figure shown below based on the data. It seems that the problem occurs due to the overlaying of the contour plot and the area plot.

Is there a way of fixing it?

Best regards

Sven

댓글을 달려면 로그인하십시오.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by