Does the capability exist in matplotlib to use patterns
> rather than colors to fill polygons, contours etc.? This
> ability comes in handy when one wants to distinguish
> various regions in a plot but needs to restrict the plot to
> black and white. The page charges are sometimes much
> larger for colored graphics and reproduction costs are
> likewise reduced for B/W.
Recent versions of matplotlib support hatching in the PS backend only
-- it would be nice to support general pattern fills in *Agg and
others too....
import matplotlib
matplotlib.use('PS')
from pylab import figure
fig = figure()
ax = fig.add_subplot(111)
bars = ax.bar(range(1,5), range(1,5), color='gray', ecolor='black')
patterns = ('/', '+', 'x', '\\')
for bar, pattern in zip(bars, patterns):
bar.set_hatch(pattern)
fig.savefig('hatch4.ps')