Browse Source

Do not hatch the background.

Carlos Garcia 6 years ago
parent
commit
96df5f8066
1 changed files with 7 additions and 3 deletions
  1. 7 3
      paper_plots.py

+ 7 - 3
paper_plots.py

@@ -122,9 +122,13 @@ def setFigLinesBW(fig):
 def setBarsBW(fig):
     patterns = ['0', '///', '---', '|||', '+++', '**', 'oo', '...']
     inx = 0
+    boxes = []
     for ax in fig.get_axes():
         for child in ax.get_children():
             if isinstance(child, matplotlib.patches.Rectangle):
-                child.set_hatch(patterns[inx])
-                inx += 1
-                if inx == len(patterns): inx = 0
+                boxes.append(child)
+    # Skip the last rectangle which should be the background
+    for box in boxes[:-1]:
+        box.set_hatch(patterns[inx])
+        inx += 1
+        if inx == len(patterns): inx = 0