Plotting two contourf plots on the same plot
19 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Elie Hatem
el 20 de Jun. de 2020
Respondida: Long Hoang Van
el 24 de Sept. de 2021
Hello,
I am trying to plot two data matrices on the same plot. However, I do not know how to adjust the transparancy of one of the plots.
The code is shown below with the attached data of Z1 and Z2.
If I try to plot the on top of each other just like the code of figure (3), the data values of the Z1 will not fully be visible since the Z2 data will be on top of it.
Is there a way to adjust the transparency of the plotted Z2 data so that the the full Z1 data will be visible?
And, is there a possibility to change the color of each contourf plot?
Thank you for your time,
Elie Hatem
clear all;clc;
x=-pi:0.1:pi;
y=x;
[X,Y]=meshgrid(x,y);
load('motorization_data.mat','Z1','Z2')
figure(1)
contourf(X,Y,Z1,[0 0])
figure(2)
contourf(X,Y,Z2,[0 0])
figure(3)
contourf(X,Y,Z1,[0 0])
hold on
contourf(X,Y,Z2,[0 0])
hold off
5 comentarios
Respuesta aceptada
Más respuestas (1)
Long Hoang Van
el 24 de Sept. de 2021
clear all;clc;
x=-pi:0.1:pi;
y=x;
[X,Y]=meshgrid(x,y);
load('motorization_data.mat','Z1','Z2')
figure(1)
contourf(X,Y,Z1,[0 0])
figure(2)
contourf(X,Y,Z2,[0 0])
figure(3)
contourf(X,Y,Z1,[0 0])
hold on
contourf(X,Y,Z2,[0 0])
hold off
0 comentarios
Ver también
Categorías
Más información sobre Scatter Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!