Skip to content

Commit c4ded48

Browse files
committed
FIX: caching the transform does not work
1 parent be85e20 commit c4ded48

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

data_prototype/wrappers.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class _Axes(Protocol):
3030

3131
transData: _Transform
3232
transAxes: _Transform
33-
_axesfraction_to_data: _Transform
3433

3534
def get_xlim(self) -> Tuple[float, float]:
3635
...
@@ -108,17 +107,16 @@ def _query_and_transform(self, renderer, *, xunits: List[str], yunits: List[str]
108107
"""
109108
# extract what we need to about the axes to query the data
110109
ax = self.axes
111-
if getattr(ax, "_axesfraction_to_data", None) is None:
112-
ax._axesfraction_to_data = ax.transAxes - ax.transData
113110
# TODO do we want to trust the implicit renderer on the Axes?
114111
ax_bbox = ax.get_window_extent(renderer)
115112

116113
# actually query the underlying data. This returns both the (raw) data
117114
# and key to use for caching.
118115
bb_size = ax_bbox.size
119116
data, cache_key = self.data.query(
120-
# TODO do this need to be (de) unitized
121-
ax._axesfraction_to_data,
117+
# TODO do this needs to be (de) unitized
118+
# TODO figure out why caching this did not work
119+
ax.transAxes - ax.transData,
122120
# TODO find better way to placate mypy
123121
(int(round(bb_size[0])), int(round(bb_size[1]))),
124122
)

0 commit comments

Comments
 (0)