Create boxes from error bars using PatchCollection
In this example, we snazz up a pretty standard error bar plot by adding
a rectangle patch defined by the limits of the bars in both the x- and
y- directions. To do this, we have to write our own custom function
called make_error_boxes. Close inspection of this function will
reveal the preferred pattern in writing functions for matplotlib:
an
Axesobject is passed directly to the functionthe function operates on the
Axesmethods directly, not through thepyplotinterfaceplotting keyword arguments that could be abbreviated are spelled out for better code readability in the future (for example we use facecolor instead of fc)
the artists returned by the
plotting methods are then returned by the function so that, if desired, their styles can be modified later outside of the function (they are not modified in this example).
