在以下代码中,我想将标签+ x-axis分配为h1,将-x_axis分配为h2,将+ y_axis分配为g1,将-y_axis分配为g2。我怎样才能做到这一点。我试图使用set_xlabel,但是没有提供期望的结果。
#data
[[ 2.00770169e-01, 2.65030622e-01],
[ 2.36049309e-01, 2.38303691e-01],
[ 3.41338187e-01, 1.51106402e-01],
[ 4.91086543e-01, 3.75933386e-02],
[ 4.90885198e-01, 3.61222774e-02]]`
c1 = data[:,0]
c2 = data[:,1]
a= np.amax(c1)
b= np.amax(c2)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.scatter(c1,c2)
ax.spines['left'].set_position('zero')
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.spines['bottom'].set_position('zero')
ax.set_xlim([-0.5,0.5])
ax.set_ylim([-0.5,0.5])
ax.set_xlabel("C1")
ax.set_ylabel("C2")