'Clipping' the quiver plot
Ältere Kommentare anzeigen
I have a quiver plot in which some of the arrows are on the edge of the plot and pointing outwards. The portion of quiver arrows that are outside of the plot limit are invisible. I want to make that visible.
My research shows that there is a 'Clipping' option for quiver, it seems that by turning the 'Clipping' off, I will get what I want. However 'Clipping' off does not make any difference? What do I miss? Thanks.
Akzeptierte Antwort
Weitere Antworten (2)
Peng
am 27 Nov. 2014
0 Stimmen
1 Kommentar
Sean de Wolski
am 1 Dez. 2014
A lot of the legacy clipping issues were fixed in 14b.
William Thielicke
am 16 Jul. 2021
When anything uses "axis image", then it is not possible to disable clipping anmore... Is this desired behaviour?
figure;
imagesc(rand(100,100));hold on;
quiver(rand(100,100),rand(100,100)*20,'Autoscale','off');hold off;
axis off;
axis image;
set(gca,'Clipping','on')
This doesn't work. It only works like this:
figure;
imagesc(rand(100,100));hold on;
quiver(rand(100,100),rand(100,100)*20,'Autoscale','off');hold off;
axis off;
%axis image;
set(gca,'Clipping','on')
7 Kommentare
William Thielicke
am 6 Mai 2022
This issue is still bothering me, and I can't believe that it is expected behaviour... Any input on this? Or ideas for a workaround?
William Thielicke
am 25 Mai 2022
No one annoyed by this issue except me?
Bjorn Gustavsson
am 25 Mai 2022
Do you get the same clipping-disabling if you manually set the y-dir to reverse,
set(gca,'ydir','reverse')
as you get with axis image?
William Thielicke
am 25 Mai 2022
No... With ydir reverse, the clipping works correctly. But aspect ratio is wrong, so this wouldn't work as a workaround.
William Thielicke
am 25 Mai 2022
Adding axis equal seems to be a workaround... So it is a bug?
Bjorn Gustavsson
am 25 Mai 2022
Definitely a "feature". Make a bug-report, or enhancement request, whatever it's called.
William Thielicke
am 28 Nov. 2025
Now in R2025b Update 1, vectors are clipped when they extend vertically over the image border. But when they horizontally extend over the image border, they are not clipped anymore. This makes it IMPOSSIBLE to render a movie (as the image size varies with each image).... Still driving me crazy...


f1=figure;
a1=axes;
set (a1, 'Clipping','on')
for i=1:numel(centroids)-1
rawimage=imread(['bubble_' sprintf('%3.3d',i) '.tif']);
imagesc(rawimage);colormap gray
set (a1, 'Clipping','on')
set (gca, 'Clipping','on')
hold on
quiver(a1,x{i},y{i},dx{i}*10,dy{i}*10,0,'r','LineWidth',2)
set (a1, 'Clipping','on')
set (gca, 'Clipping','on')
axis off;
axis equal
hold off
set (a1, 'Clipping','on')
set (gca, 'Clipping','on')
exportgraphics(f1,['tracked_' sprintf('%3.3d',i) '.jpg'])
end
Kategorien
Mehr zu Vector Fields finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!