Hier ist ein Skript, das ich in Python leite:benutzerdefinierte Etiketten pyplot matplotlib
import numpy as np
import matplotlib.pyplot as plt
t = np.linspace(0, 2*np.pi, 150)
plt.figure()
theGrid = np.outer(np.sin(t), np.sin(t))
plt.xlim(0, 2*np.pi) #forces an exact fit!
plt.ylim(0, 2*np.pi) #ditto!
plt.xticks(np.linspace(0, 2*np.pi, 5))
plt.yticks(np.linspace(0, 2*np.pi, 5))
plt.pcolormesh(t, t, theGrid)
Es ist ein schönes Grundstück, und sowohl der x- und y-Etiketten sind eindeutig ein Vielfaches von pi/2. Aber wie würde ich die x- und y-Bezeichnungen lesen, sagen wir, 0, pi/2, pi, 3 * pi/2 bzw. 2 * pi, insbesondere die Einführung von Text? (Das Mapping von sagen, die Zahl np.pi/2 auf den Text "pi/2" sollte nicht schwer sein, aber das Erhalten von Text-Etiketten ist im Grunde, was ich hier bin.)
http://matplotlib.org/examples/ticks_and_spines/spines_demo_bounds.html –