602be075297ae9b6b1ee172da4f52e64739cbd17,lib/matplotlib/tight_bbox.py,,adjust_bbox,#Any#Any#Any#,8
Before Change
fig.patch.set_bounds(x0 / w1, y0 / h1,
fig.bbox.width / w1, fig.bbox.height / h1)
return restore_bbox
def process_figure_for_rasterizing(fig, bbox_inches_restore, fixed_dpi=None):
After Change
def no_op_apply_aspect(position=None):
return
stack = contextlib.ExitStack()
stack.callback(fig.set_tight_layout, fig.get_tight_layout())
fig.set_tight_layout(False)
for ax in fig.axes:
pos = ax.get_position(original=False).frozen()
def _l(a, r, pos=pos):
return pos
stack.callback(ax.set_axes_locator, ax.get_axes_locator())
ax.set_axes_locator(_l)
// override the method that enforces the aspect ratio
// on the Axes
stack.enter_context(_setattr_cm(ax, apply_aspect=no_op_apply_aspect))
if fixed_dpi is not None:
tr = Affine2D().scale(fixed_dpi)
dpi_scale = fixed_dpi / fig.dpi
else:
tr = Affine2D().scale(fig.dpi)
dpi_scale = 1.
_bbox = TransformedBbox(bbox_inches, tr)
stack.enter_context(
_setattr_cm(fig, bbox_inches=Bbox.from_bounds(
0, 0, bbox_inches.width, bbox_inches.height)))
x0, y0 = _bbox.x0, _bbox.y0
w1, h1 = fig.bbox.width * dpi_scale, fig.bbox.height * dpi_scale
stack.enter_context(
_setattr_cm(fig.transFigure,
_boxout=Bbox.from_bounds(-x0, -y0, w1, h1)))
fig.transFigure.invalidate()
stack.callback(fig.transFigure.invalidate)
stack.enter_context(
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: matplotlib/matplotlib
Commit Name: 602be075297ae9b6b1ee172da4f52e64739cbd17
Time: 2020-06-09
Author: quantum.analyst@gmail.com
File Name: lib/matplotlib/tight_bbox.py
Class Name:
Method Name: adjust_bbox
Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 5674f7af85b212633236ec45683ba94c67dca779
Time: 2016-10-21
Author: ehankland@google.com
File Name: perfkitbenchmarker/configs/__init__.py
Class Name:
Method Name: _LoadUserConfig
Project Name: tyarkoni/pliers
Commit Name: de6d474bd667cc040856792cce62148691fbabda
Time: 2017-05-08
Author: quinten.mcnamara@gmail.com
File Name: pliers/extractors/api.py
Class Name: ClarifaiAPIExtractor
Method Name: _extract