2012-09-12 45 views

回答

0

您可以使用axes.get_xaxis().set_visible(False)或使用axis('off')來隱藏座標軸。

例子:

from pylab import * 

gca().get_xaxis().set_visible(False) # Removes x-axis from current figure 
gca().get_yaxis().set_visible(False) # Removes y-axis from current figure 

a = arange(10) 
b = sin(a) 
plot(a, b) 
show() # Plot has no x and y axes 
0

如果你不想軸,並且很高興在0-1範圍內的工作:

import matplotlib.pyplot as plt 
import matplotlib.patches as mpatches 

fig = plt.figure() 
fig.patches.append(mpatches.Circle([0.5, 0.5], 0.25, transform=fig.transFigure)) 
fig.show() 

有使用@達拉的幾個好處解。主要的是你可以使用一個數據座標系來自動擴展你的數據,但如果你只是想繪製幾個形狀,我的解決方案工作得很好。

一些有用的文檔,如果你走我已經解釋過的路線: