最小示例不實現它: [X,Y,Z] = peaks;
figure;
pcolor(X,Y,Z);
shading flat;
hold all;
axes;
contour(X,Y,Z);
colormap gray; % this should only apply to the contour plot axes...
axis off; % ... but it does
我想從均勻間隔的2D數據(類似圖像的數據)的單個輪廓中獲取數據。 基於類似的問題找到了例子:How can I get the (x,y) values of the line that is ploted by a contour plot (matplotlib)? >>> import matplotlib.pyplot as plt
>>> x = [1,2,3,4]
>>> y =