How do I turn off arrowhead using quiverm (Mapping Toolbox)

조회 수: 2 (최근 30일)
Mark Brandon
Mark Brandon 2022년 11월 2일
편집: Mark Brandon 2022년 11월 4일
I am trying to get quiverm (part of the Mapping Toolbox) to plot lines, without arrowheads. This option is available for quiver, but it is not clear if it can be done with quiverm.
  댓글 수: 1
Mark Brandon
Mark Brandon 2022년 11월 4일
편집: Mark Brandon 2022년 11월 4일
Thanks for Walter Robertson and Maik for very useful suggestions.
I am now using a slightly simplier approach, as illustrated by the following example;
hQ = quiverm(lat,lon,dlat,dlon);
delete(hQ(1)); % removes arrow line
delete(hQ(2)); % removes arrowhead
Best,
Mark
p.s. Matlab: PLEASE add this information to the description of the quiverm function.

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

채택된 답변

Walter Roberson
Walter Roberson 2022년 11월 2일
편집: Walter Roberson 2022년 11월 4일
If I read the code correctly, then if you pass a marker specification to quiverm as part of the linespec (expected to be the fifth parameter, after x y u v) then it will not draw arrows, and will instead draw the symbol at the appropriate locations. All of the symbols will be drawn in a single call, with nan having been inserted between the coordinates, and with the line portion of the linespec having been turned off. The handle to that line that draws markers will be returned as the last of the handles returned by quiverm.
So... you could take that last handle and delete() the line.
  댓글 수: 1
Mark Brandon
Mark Brandon 2022년 11월 4일
Thanks for the useful answer. It would help if the Matlab documentation for quiverm included an explaination about the function of the two line handles returned for each vector.

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

추가 답변 (1개)

Maik
Maik 2022년 11월 2일
You could change the marker shape and then delete it using findobj.
%% Sample Data From Mathworks Help Page
load("wind","x","y","u","v")
lat = y(11:22,11:22,1);
lon = x(11:22,11:22,1);
dlat = v(11:22,11:22,1);
dlon = u(11:22,11:22,1);
figure
[latlim,lonlim] = geoquadline(lat,lon);
usamap(latlim,lonlim)
%% With the Arrows
quiverm(lat,lon,dlat,dlon)
figure
[latlim,lonlim] = geoquadline(lat,lon);
usamap(latlim,lonlim)
%% Without The Arrows
quiverm(lat,lon,dlat,dlon,'-b+')
delete(findobj(gca, 'Marker', '+'))

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by