'Clipping' the quiver plot

조회 수: 35 (최근 30일)
Peng
Peng 2014년 11월 25일
댓글: William Thielicke 2025년 11월 28일 12:34
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.

채택된 답변

Sean de Wolski
Sean de Wolski 2014년 11월 25일
편집: Sean de Wolski 2014년 11월 25일
In R2014b, turning the clipping off works as I would expect:
quiver(0.5,0.5,1,1)
axis([0 1 0 1])
ax = gca;
ax.Clipping = 'off';

추가 답변 (2개)

Peng
Peng 2014년 11월 27일
The problem was I'm using 2013, and after switching to 2014, it works. Thanks.
  댓글 수: 1
Sean de Wolski
Sean de Wolski 2014년 12월 1일
A lot of the legacy clipping issues were fixed in 14b.

댓글을 달려면 로그인하십시오.


William Thielicke
William Thielicke 2021년 7월 16일
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
Bjorn Gustavsson
Bjorn Gustavsson 2022년 5월 25일
Definitely a "feature". Make a bug-report, or enhancement request, whatever it's called.
William Thielicke
William Thielicke 2025년 11월 28일 12:34
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

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by