MATLAB Answers

How to set 'ShowArrowHead' off in the legend of a quiver plot?

조회 수: 24(최근 30일)
Sean
Sean 2021년 6월 8일
댓글: Sean 2021년 8월 3일
In a quiver plot, there is a way to turn off arrow head by setting 'ShowArrowHead' off.
However the setting is not inherent by the associated legend. How to turn off arrow head for quiver plot legend?

답변(1개)

Shadaab Siddiqie
Shadaab Siddiqie 2021년 7월 29일
From my understanding you want to turn off the arrowhead from the quiver plot. For that you can set 'Marker' property of quiver to 'none'. Here is an example to illustrate it:
[X,Y] = meshgrid(-pi:pi/8:pi,-pi:pi/8:pi);
U = sin(Y);
V = cos(X);
q = quiver(X,Y,U,V);
q.ShowArrowHead = 'off';
q.Marker = 'none';
  댓글 수: 3
Sean
Sean 2021년 8월 3일
Thanks for your answer. That's also my current solution that manually creates the legend.
I do have other layers of other plot features 'hold on'. So I am looking for a consistent way of generating legends for all features.
I am still looking for an automated solution given that a legend of a plot should always be updated with the plot features it represents. Apparently, it's a bug that the quiver plot allows the user to turn off 'ShowArrowHead' but this modification is not updated in the corresponding legend.

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

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by