overlaying graph contourf (or pcolor)

4 visualizaciones (últimos 30 días)
Andrea Cesaro
Andrea Cesaro el 9 de Oct. de 2023
Comentada: Andrea Cesaro el 9 de Oct. de 2023
I wrote some code that represents this figure:
The code is this:
%% errori relativi
% tau1
figure(2)
sgtitle('ERRORI RELATIVI ')
subplot(1,3,1)
pcolor(a1/l1, y/l1, delta_tau1./abs(tau1)*100);
contourf(a1/l1, y/l1, delta_tau1./abs(tau1)*100)
title('$\Delta \tau_{\%} \ [\%]$');
colorbar('southoutside')
xlabel('$\frac{x}{l}$')
ylabel('$\frac{y}{l}$')
axis equal
xlim([min(min(a1/l1)), max(max(a1/l1))]);
ylim([min(min(y/l1)), max(max(y/l1))]);
grid on
% Q1
subplot(1,3,2)
pcolor(a1/l1, y/l1, delta_Q./abs(Q)*100);
contourf(a1/l1, y/l1, delta_Q./abs(Q)*100)
title('$\Delta Q_{\%} \ [\%]$');
colorbar('southoutside')
xlabel('$\frac{x}{l}$')
ylabel('$\frac{y}{l}$')
axis equal
xlim([min(min(a1/l1)), max(max(a1/l1))]);
ylim([min(min(y/l1)), max(max(y/l1))]);
grid on
% Ek1
subplot(1,3,3)
pcolor(a1/l1, y/l1, delta_Ek./abs(Ek)*100);
contourf(a1/l1, y/l1, delta_Ek./abs(Ek)*100)
title('$\Delta E_{k\%} \ [\%]$');
colorbar('southoutside')
xlabel('$\frac{x}{l}$')
ylabel('$\frac{y}{l}$')
axis equal
xlim([min(min(a1/l1)), max(max(a1/l1))]);
ylim([min(min(y/l1)), max(max(y/l1))]);
grid on
I want to overlay the three graphs and make evident the common area under the 10% error (dark blue area). How can I do this?

Respuesta aceptada

Adam Danz
Adam Danz el 9 de Oct. de 2023
It sounds like you want to overlay three contours in one axes while being able to see through the 3 layers. Since all 3 of your contours have the same x and y extents, you can simply plot all three to the same axes and set the Face and Edge Alpha properties to add partial transparency.
figure()
axes()
contour(__,'FaceAlpha',0.33,'EdgeAlpha',0.33)
hold on
contour(__,'FaceAlpha',0.33,'EdgeAlpha',0.33)
contour(__,'FaceAlpha',0.33,'EdgeAlpha',0.33)
  1 comentario
Andrea Cesaro
Andrea Cesaro el 9 de Oct. de 2023
Thank you, it isn't what I thought, but it is a good idea.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Lighting, Transparency, and Shading en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by