August 2017
Beginner to intermediate
334 pages
8h 22m
English
Here is another way to add arrows, which are more sophisticated than the single line we draw with pyplot.annotate().
Using the previous demand-supply example, substituting the annotation by pyplot.annotate() with the following code block will yield the blue arrow textbox as shown:
# Annotate the equilibrium point with arrow and textbbox_props = dict(boxstyle="rarrow", fc=(0.8, 0.9, 0.9), ec="b", lw=2)t = ax.text(2,5, "Equilibrium", ha="center", va="center", rotation=0, size=12,bbox=bbox_props)bb = t.get_bbox_patch()bb.set_boxstyle("rarrow", pad=0.6)

Read now
Unlock full access