Jul-29-2022, 04:05 PM
(This post was last modified: Jul-29-2022, 04:05 PM by deanhystad.)
Why? Normally axis labels indicate range with maybe some subdivisions to give approximate value. If you want the real value you click on the plot.
You can tell matplotlib where to put tickmarks like this:
You can tell matplotlib where to put tickmarks like this:
import numpy as np import matplotlib.pyplot as plt from math import sin x = np.linspace(0.0, np.pi * 2, 100) x1 = 1 y1 = sin(1) x2 = 5 y2 = sin(5) fig, ax = plt.subplots() plt.plot(x, np.sin(x)) ax.set_xticks((x1, x2)) ax.set_yticks((y1, y2)) ax.grid(True) plt.show()