在matlab中以相同颜色绘制恒定轮廓

Ploting constant contours in the same color in matlab

[x,y] = meshgrid(-10:1:10,-10:1:10); 
idx = (x~=0)&(y~=0);     
contour(x(idx)/(x(idx).^2+y(idx).^2).^(3/2),y(idx)/(x(idx).^‌2+y(idx).^2).^(3/2))‌​;

输出为白页!

"delete"你不要的点数:

[x,y] = meshgrid(-10:0.1:10,-10:0.1:10);
Idontwantthis = (x.^2+y.^2)<1;
data= x./(x.^2+y.^2).^(3/2)+y./(x.^2+y.^2).^(3/2);
data(Idontwantthis)=NaN;
contourf(data,20);

请注意,我将 / 替换为 ./

我还添加了更多点,因为你的网格很小。

如果您使用 contourf 而不是 contour,这就是结果的样子(同样的东西,更好看):