我的问题很简单。我使用imshow()可视化二维数组,并修改其轴标记和标签。现在,如果我需要在“新”原点上放置一个标记,我该怎么做?如您所见,标记仍然位于原始原点的上方
plt.imshow(vel_meshXY) #vel_meshXY is a 2D array. Image shown below.
# Manipulating the axis ticks and axis tick labels here.
ax=plt.gca()
ax_labelLoc = np.arange(0,num_steps, 40); ax.set_xticks(ax_labelLoc); ax.set_yticks(ax_labelLoc)
ax.set_xticklabels(np.linspace(turbine_origin[0]-minusX, turbine_origin[0]+plusX, num_steps)[ax_labelLoc])
ax.set_yticklabels(np.linspace(turbine_origin[1]+plusY, turbine_origin[1]-minusY, num_steps)[ax_labelLoc])
# trying to put a marker wrt the 'new' origin
ax.plot(10, 10, 'o', markersize= 10, color = 'r')
目前没有回答
相关问题 更多 >
编程相关推荐