Setting specific colorbar limits using coneplot
Mostrar comentarios más antiguos
My purpose is to produce 2d plots of vector winds with the vectors size and colour representing the strength of the vector. I've got fairly far with it. Currently I am using coneplot and have the below image with vector winds plotted as cones with colour and size representing the vector.

My issue is that I want multiple plots to represent winds the same i.e. equal strength winds represented by the same colour and size cone across all plots. I use subplot with the below code to plot the 4 plots. I want to now normalise these plots so that the size and winds across all plots are the same. Notice how in the plot all the colorbar scales are different. Any ideas how to do this?
Here is my code below:
% Vector field
[X Y Z] = meshgrid(0:11,0:31,[0 1]);
W = zeros(size(X)); % the third dim, unused here
% We do not want anything for Z=1
figure(100)
subplot(1,4,1)
U(:,:,1) = bias_U_amps_land_day(1:32,:);
V(:,:,1) = bias_V_amps_land_day(1:32,:);
U(:,:,2) = 0;V(:,:,2)=0;
coneplot(X,Y,Z,U,V,W,X,Y,Z,sqrt(U.^2+V.^2),1.5)
% view(2)
shading interp
colorbar
ylim([-1 32])
xlim([-1 11])
axis equal
set(gca,'FontSize',fonts,'FontName',fontn)
t = title('Land/Day');
set(t,'FontSize',fonts,'FontName',fontn)
y = ylabel('Model Level');
set(y,'FontSize',fonts,'FontName',fontn)
h = xlabel('Leadtime');
set(h,'FontSize',fonts,'FontName',fontn)
ylim([-1 32])
figure(100)
subplot(1,4,2)
U(:,:,1) = bias_U_amps_land_night(1:32,:);
V(:,:,1) = bias_V_amps_land_night(1:32,:);
U(:,:,2) = 0;V(:,:,2)=0;
coneplot(X,Y,Z,U,V,W,X,Y,Z,sqrt(U.^2+V.^2),1.5)
% view(2)
shading interp
colorbar
ylim([-1 32])
xlim([-1 11])
axis equal
set(gca,'FontSize',fonts,'FontName',fontn)
t = title('Land/Night');
set(t,'FontSize',fonts,'FontName',fontn)
h = xlabel('Leadtime');
set(h,'FontSize',fonts,'FontName',fontn)
ylim([-1 32])
figure(100)
subplot(1,4,3)
U(:,:,1) = bias_U_amps_ocean_day(1:32,:);
V(:,:,1) = bias_V_amps_ocean_day(1:32,:);
U(:,:,2) = 0;V(:,:,2)=0;
coneplot(X,Y,Z,U,V,W,X,Y,Z,sqrt(U.^2+V.^2),1.5);
% view(2)
shading interp
colorbar
ylim([-1 32])
xlim([-1 11])
axis equal
set(gca,'FontSize',fonts,'FontName',fontn)
t = title('Ocean/Day');
set(t,'FontSize',fonts,'FontName',fontn)
h = xlabel('Leadtime');
set(h,'FontSize',fonts,'FontName',fontn)
ylim([-1 32])
figure(100)
subplot(1,4,4)
U(:,:,1) = bias_U_amps_ocean_night(1:32,:);
V(:,:,1) = bias_V_amps_ocean_night(1:32,:);
U(:,:,2) = 0;V(:,:,2)=0;
c = coneplot(X,Y,Z,U,V,W,X,Y,Z,sqrt(U.^2+V.^2),1.5);
% view(2)
shading interp
colorbar
ylim([-1 32])
xlim([-1 11])
axis equal
set(gca,'FontSize',fonts,'FontName',fontn)
t = title('Ocean/Night');
set(t,'FontSize',fonts,'FontName',fontn)
h = xlabel('Leadtime');
set(h,'FontSize',fonts,'FontName',fontn)
ylim([-1 32])
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Vector Fields en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!