Skip to content

Commit b1cbcd3

Browse files
authored
Merge pull request #279 from nschloe/small-fixes
remove superfluous Spines
2 parents c36823d + d3819ba commit b1cbcd3

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

matplotlib2tikz/save.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,11 @@ def _recurse(data, obj):
321321
"""
322322
content = _ContentManager()
323323
for child in obj.get_children():
324+
# Some patches are Spines, too; skip those entirely.
325+
# See <https://github.com/nschloe/matplotlib2tikz/issues/277>.
326+
if isinstance(child, mpl.spines.Spine):
327+
continue
328+
324329
if isinstance(child, mpl.axes.Axes):
325330
# Reset 'extra axis parameters' for every new Axes environment.
326331
data["extra axis options"] = data["extra axis options [base]"].copy()
@@ -384,7 +389,7 @@ def _recurse(data, obj):
384389
elif isinstance(child, (mpl.text.Text, mpl.text.Annotation)):
385390
data, cont = text.draw_text(data, child)
386391
content.extend(cont, child.get_zorder())
387-
elif isinstance(child, (mpl.axis.XAxis, mpl.axis.YAxis, mpl.spines.Spine)):
392+
elif isinstance(child, (mpl.axis.XAxis, mpl.axis.YAxis)):
388393
pass
389394
else:
390395
warnings.warn(

test/test_fillstyle_reference.tex

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,6 @@
2525
0.888888888888889 8
2626
1 9
2727
};
28-
\path [draw=black, fill opacity=0]
29-
(axis cs:0,-0.45)
30-
--(axis cs:0,9.45);
31-
\path [draw=black, fill opacity=0]
32-
(axis cs:1,-0.45)
33-
--(axis cs:1,9.45);
34-
\path [draw=black, fill opacity=0]
35-
(axis cs:-0.05,0)
36-
--(axis cs:1.05,0);
37-
\path [draw=black, fill opacity=0]
38-
(axis cs:-0.05,1)
39-
--(axis cs:1.05,1);
4028
\end{axis}
4129

4230
\end{tikzpicture}

0 commit comments

Comments
 (0)