MATLAB: Does changing the ‘EraseMode’ property of a three-dimensional velocity plot created by QUIVER3 make the plot disappear in MATLAB 7.0 (R14)

backgrounderasemodehggroupMATLABquiverquiver3

I initially plot a sphere in three-dimensional space. I have the 'NextPlot' property of the axes set to 'add'. I then create a three-dimensional velocity plot using the QUIVER3 function. However, when I change the 'EraseMode' property of the QUIVER3 plot to anything other than 'normal', it disappears, leaving only the sphere in the figure. For example,
vecLt = [-83.5,-47,-26.8]';
set(gca,'nextplot','add');
%Creating the sphere.
[x,y,z]=sphere;
x = x*5+vecLt(1);
y = y*5+vecLt(2);
z = z*5+vecLt(3);
hSphere = mesh(x,y,z);
wcx = -134.1483;
wcy = -64.5183;
wcz = -23.3965;
ax = 19.6097;
ay = 2.3364;
az = -1.5741;
%Creating the quiver3 plot
hArrow = quiver3(wcx,wcy,wcz,ax,ay,az,0);
%Changing the EraseMode property.
set(hArrow,'EraseMode','background','Marker','o','MarkerSize',10,'LineWidth',3);

Best Answer

We have verified that there is a bug in MATLAB 7.0 (R14) when displaying QUIVER3 plots. To work around this issue, find the handles of the lines that compose the QUIVER3 plot and set their 'EraseMode' property to 'background', as in the following code:
vecLt = [-83.5,-47,-26.8]';
set(gca,'nextplot','add');
% Plotting the Sphere.
[x,y,z]=sphere;
x = x*5+vecLt(1);
y = y*5+vecLt(2);
z = z*5+vecLt(3);
hSphere = mesh(x,y,z);
wcx = -134.1483;
wcy = -64.5183;
wcz = -23.3965;
ax = 19.6097;
ay = 2.3364;
az = -1.5741;
% The QUIVER3 plot
hArrow = quiver3(wcx,wcy,wcz,ax,ay,az,0);
hchild = get(hArrow,'children'); %Obtaining the child handles of quiver3 plot.
set(hArrow,'EraseMode','background','Marker','o','MarkerSize',10,'LineWidth',3);
set(hchild,'EraseMode','background');
Thus, to change the 'EraseMode' property of the QUIVER3 plot to 'background', the 'EraseMode' property of its children has to be also changed to 'background'.
Note that the documentation of the QUIVER3 function mentions that it returns a vector of line handles. However, from the example above,
hArrow = quiver3(wcx,wcy,wcz,ax,ay,az,0);
returns only a single scalar value.