python - plotting with pcolormesh, changing axis -
supppose plotting assymetric matrix pcolormesh:
import prettyplotlib ppl import matplotlib.pyplot plt import numpy np plt.figure() fig, ax = plt.subplots(1) ppl.pcolormesh(fig, ax, np.random.randn(10,80)) plt.show()
now want change x-axis such extents example -500 500 without changing plot, labels of x-axis, same y-axis. how can accomplish that?
after ppl.pcolormesh command can define ticklables directly using
ax.set_xticks(xticks) ax.set_xticklabels(xticklabels)
where xticklabels array of desired labels , xticks values @ labels should apply.
Comments
Post a Comment