How do i create a colour quiver plot (colquiver) on top of a pcolor depth map?
Show older comments
I want to create a figure with a depth map (using pcolor) with coloured vectors on top (using the function colquiver). Using only quiver this was easy but I cant mannage to fit the coloured vectors on top.
I tried to make 2 axes (because i want to use 2 colourmaps) but the colquiver function does nog alow 'ax' in the function. How can I combine the figures and use 2 colourmaps and have 2 colourbars?
The function colquiver and the figures are attached.
This is the script so far (not working and without my attempts) :
figure,
%depth map script
pcolor( x2, y2, depth2_rev'); hold on
shading flat; axis equal;
colormap(cmap.map{1,5});
c1 = colorbar; hold on;
caxis([-12 0]); hold on;
c1.Label.String = 'water depth (m)';
%colour vector plot
scale =1;
colquiver(quiver(x2(1:4:end),y2(1:4:end),U2Mean(1:4:end), V2Mean(1:4:end), scale),sqrt(U2Mean(1:4:end).^2+V2Mean(1:4:end).^2));
colormap(jet);
c2 = colorbar; hold on;
hold off, axis image
set(gca,'FontSize',15);
xlim([startx2 (startx2+(gridsize2*(xloc2-1)))]);
ylim([starty2 (starty2+(gridsize2*(yloc2-1)))]);
xlabel('x-UTM (km)');
ylabel('y-UTM (km)');
Accepted Answer
More Answers (0)
Categories
Find more on Color and Styling in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!