Skip to content

Commit 636fde8

Browse files
committed
respect extra axis options
1 parent 079e28c commit 636fde8

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

matplotlib2tikz/save.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ def save(filepath,
115115
data['font size'] = textsize
116116
data['custom colors'] = {}
117117
# rectangle_legends is used to keep track of which rectangles have already
118-
# had \addlegendimage added. There should be only one \addlegenimage per
118+
# had \addlegendimage added. There should be only one \addlegenimage per
119119
# bar chart data series.
120120
data['rectangle_legends'] = set()
121121
if extra:
122-
data['extra axis options'] = extra.copy()
122+
data['extra axis options [base]'] = extra.copy()
123123
else:
124-
data['extra axis options'] = set()
124+
data['extra axis options [base]'] = set()
125125

126126
if dpi is None:
127127
savefig_dpi = mpl.rcParams['savefig.dpi']
@@ -216,7 +216,7 @@ def _print_pgfplot_libs_message(data):
216216
return
217217

218218
class _ContentManager(object):
219-
""" Basic Content Manager for matplotlib2tikz
219+
""" Basic Content Manager for matplotlib2tikz
220220
221221
This manager uses a dictionary to map z-order to an array of content
222222
to be drawn at the z-order.
@@ -247,7 +247,8 @@ def _recurse(data, obj):
247247
for child in obj.get_children():
248248
if isinstance(child, mpl.axes.Axes):
249249
# Reset 'extra axis options' for every new Axes environment.
250-
data['extra axis options'] = set()
250+
data['extra axis options'] = \
251+
data['extra axis options [base]'].copy()
251252

252253
ax = axes.Axes(data, child)
253254
if not ax.is_colorbar:
@@ -258,7 +259,7 @@ def _recurse(data, obj):
258259
ax.axis_options.extend(data['extra axis options'])
259260
# populate content
260261
content.extend(
261-
ax.get_begin_code() +
262+
ax.get_begin_code() +
262263
children_content +
263264
[ax.get_end_code(data)], 0)
264265
elif isinstance(child, mpl.lines.Line2D):

test/show

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33
#
44
import argparse
5-
from matplotlib import pyplot as pp
5+
from matplotlib import pyplot as plt
66
from importlib import import_module
77

88
import testfunctions
@@ -16,7 +16,7 @@ def _main():
1616
test = import_module('testfunctions.' + test_name)
1717

1818
test.plot()
19-
pp.show()
19+
plt.show()
2020
return
2121

2222

test/testfunctions/fancybox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
desc = 'Fancybox'
1010
# phash = 'dd232dd0239dd85a'
11-
phash = '9d2327dc23cdd81a'
11+
phash = '9d2325dc23cdd85a'
1212

1313

1414
# Bbox object around which the fancy box will be drawn.

0 commit comments

Comments
 (0)