# How to plot fewer arrows and increase their size on a quiver plot that is merged over another field?

64 views (last 30 days)
A LL on 6 Apr 2022
Commented: A LL on 7 Apr 2022
I am merging 3 fields together (land/ocean, pressure field and velocity field).
I manage to align all the fields together but I can't find a way to reduce the number of arrows I am plotting on my quiver plot. I also want to increase the size of my arrows. When I tried to plot only 1/4 of the quiver's arrows, the quiver plot disappeared. See the commented line above.
I have attached my data as "data2.mat".
Here is my code:
figure(1)
ax1 = axes;
pcolor(Land);
axis ij;
axis equal;
box on;
axis off;
ax2 = axes;
hold on;
axis ij;
axis equal;
box on;
axis off;
ax3 = axes;
id = 4 ; % plot every 4th value
h2 = quiver(Upos,Vpos,'k');
%I try to plot fewers arrows and increase the size of the arrows
%h2 = quiver(Upos(1:id:end,1:id:end),Vpos(1:id:end,1:id:end),'k');
set(h2,'AutoScale','on', 'AutoScaleFactor', 5)
axis ij;
axis equal;
box on;
axis off;
%%Hide the top axes
ax2.Visible = 'off';
ax2.XTick = [];
ax2.YTick = [];
%%Give each one its own colormap
colormap(ax1,cmap)
colormap(ax2,'parula')
%%Then add colorbars and get everything lined up
cb2 = colorbar(ax2,'Position',[0.8 0.11 0.05 0.815]);
ylabel(cb2,'sea level pressure (hPa)','Fontsize',18);
xlim([110 270]);
ylim([70 260]);
My actual figure:
I want my quiver plot to look more something like this:
Thank you

MJFcoNaN on 7 Apr 2022
Edited: MJFcoNaN on 7 Apr 2022
You may try this code:
id = 8 ; % plot every 4th value
ScaleFactor = 10;
Upos0 = Upos;
Vpos0 = Vpos;
Upos = NaN(size(Upos0));
Vpos = NaN(size(Vpos0));
Upos(1:id:end, 1:id:end)=Upos0(1:id:end, 1:id:end);
Vpos(1:id:end, 1:id:end)=Vpos0(1:id:end, 1:id:end);
h2 = quiver(Upos,Vpos,'k');
%I try to plot fewers arrows and increase the size of the arrows
%h2 = quiver(Upos(1:id:end,1:id:end),Vpos(1:id:end,1:id:end),'k');
set(h2,'AutoScale','on', 'AutoScaleFactor', ScaleFactor)
##### 3 CommentsShow 1 older commentHide 1 older comment
MJFcoNaN on 7 Apr 2022
Sorry I forgot a comma...It should be:
Upos(1:id:end, 1:id:end)=Upos0(1:id:end, 1:id:end);
Vpos(1:id:end, 1:id:end)=Vpos0(1:id:end, 1:id:end);
A LL on 7 Apr 2022
I ended up converting everthing on a lat/lon grid and using quivermc instead of quiver. Thank you for your time.

### Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

R2021a

### Community Treasure Hunt

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

Start Hunting!