Ich möchte eine Anmerkung machen, etwas wie here, aber ich muss einen Bereich in x anstelle eines einzelnen Punktes zeigen. Es ist so etwas wie die dimension lines in technischer Zeichnung. HierWie notieren Sie einen Bereich der x-Achse in Matplotlib?
ist ein Beispiel dafür, was ich suche:
import matplotlib.pyplot as plt
import numpy as np
xx = np.linspace(0,10)
yy = np.sin(xx)
fig, ax = plt.subplots(1,1, figsize=(12,5))
ax.plot(xx,yy)
ax.set_ylim([-2,2])
# -----------------------------------------
# The following block attempts to show what I am looking for
ax.plot([4,6],[1,1],'-k')
ax.plot([4,4],[0.9,1.1],'-k')
ax.plot([6,6],[0.9,1.1],'-k')
ax.annotate('important\npart', xy=(4, 1.5), xytext=(4.5, 1.2))
Wie mit Anmerkungen versehen ich einen Bereich in einem maplotlib Graph?
Ich verwende:
Python: 3.4.3 + numpy: 1.11.0 + matplotlib: 1.5.1