python - Adding a crosshair or marker to a matplotlib contour plot -
i plotting numpy array contour plot using matplotlib:
import numpy np import matplotlib.pyplot plt plt.contour(array, linewidths = 1, colors = 'k') plt.contourf(array, cmap = plt.cm.jet) plt.colorbar() plt.show()
i add 'crosshair' or other marker denote maximum value in array given by:
maxi = np.max(array)
how should go doing this?
thanks.
you can plot cross if know position.
[row, col] = numpy.where(array==np.max(array)) plt.plot(col, row, 'b+')
Comments
Post a Comment