8000 More changes · matplotlib/matplotlib@0d2a7df · GitHub
[go: up one dir, main page]

Skip to content

Commit 0d2a7df

Browse files
committed
More changes
1 parent e765af0 commit 0d2a7df

File tree

11 files changed

+7
-625
lines changed

11 files changed

+7
-625
lines changed

doc/_templates/mpl_nav_bar.html

Lines changed: 0 additions & 24 deletions
This file was deleted.

doc/api/next_api_changes/behavior/21031-AL.rst

Lines changed: 0 additions & 3 deletions
This file was deleted.

doc/users/backmatter.rst

Lines changed: 0 additions & 11 deletions
This file was deleted.

doc/users/explain.rst

Lines changed: 0 additions & 10 deletions
This file was deleted.

doc/users/next_whats_new/fig_draw_without_rendering.rst

Lines changed: 0 additions & 12 deletions
This file was deleted.

lib/matplotlib/artist.py

8000
Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,17 +1328,6 @@ def set_mouseover(self, mouseover):
13281328
mouseover = property(get_mouseover, set_mouseover) # backcompat.
13291329

13301330

1331-
def _get_tightbbox_for_layout_only(obj, *args, **kwargs):
1332-
"""
1333-
Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1334-
*for_layout_only* kwarg; this helper tries to uses the kwarg but skips it
1335-
when encountering third-party subclasses that do not support it.
1336-
"""
1337-
try:
1338-
return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1339-
except TypeError:
1340-
return obj.get_tightbbox(*args, **kwargs)
1341-
13421331

13431332
def _get_tightbbox_for_layout_only(obj, *args, **kwargs):
13441333
"""

lib/matplotlib/backends/backend_gtk4.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def __init__(self, figure=None):
6767

6868
self.set_draw_func(self._draw_func)
6969
self.connect('resize', self.resize_event)
70+
self.connect('notify::scale-factor', self._update_device_pixel_ratio)
7071

7172
click = Gtk.GestureClick()
7273
click.set_button(0) # All buttons.

lib/matplotlib/backends/backend_gtk4cairo.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def set_context(self, ctx):
1111

1212
class FigureCanvasGTK4Cairo(backend_gtk4.FigureCanvasGTK4,
1313
backend_cairo.FigureCanvasCairo):
14+
_context_is_scaled = True
1415

1516
def __init__(self, figure):
1617
super().__init__(figure)
@@ -20,6 +21,9 @@ def on_draw_event(self, widget, ctx):
2021
with (self.toolbar._wait_cursor_for_draw_cm() if self.toolbar
2122
else nullcontext()):
2223
self._renderer.set_context(ctx)
24+
scale = self.device_pixel_ratio
25+
# Scale physical drawing to logical size.
26+
ctx.scale(1 / scale, 1 / scale)
2327
allocation = self.get_allocation()
2428
Gtk.render_background(
2529
self.get_style_context(), ctx,

lib/matplotlib/markers.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,6 @@ class MarkerStyle:
209209
CARETDOWNBASE: 'caretdownbase',
210210
"None": 'nothing',
211211
"none": 'nothing',
212-
<<<<<<< HEAD
213-
None: 'nothing',
214-
=======
215-
>>>>>>> main
216212
' ': 'nothing',
217213
'': 'nothing'
218214
}
@@ -231,12 +227,8 @@ class MarkerStyle:
231227

232228
_unset = object() # For deprecation of MarkerStyle(<noargs>).
233229

234-
<<<<<<< HEAD
235-
def __init__(self, marker=_unset, fillstyle=None):
236-
=======
237230
def __init__(self, marker=_unset, fillstyle=None,
238231
transform=None, capstyle=None, joinstyle=None):
239-
>>>>>>> main
240232
"""
241233
Parameters
242234
----------
@@ -273,15 +265,12 @@ def __init__(self, marker=_unset, fillstyle=None,
273265
"deprecated since %(since)s; support will be removed "
274266
"%(removal)s. Use MarkerStyle('') to construct an empty "
275267
"MarkerStyle.")
276-
<<<<<<< HEAD
277-
=======
278268
if marker is None:
279269
marker = ""
280270
_api.warn_deprecated(
281271
"3.6", message="MarkerStyle(None) is deprecated since "
282272
"%(since)s; support will be removed %(removal)s. Use "
283273
"MarkerStyle('') to construct an empty MarkerStyle.")
284-
>>>>>>> main
285274
self._set_marker(marker)
286275

287276
__init__.__signature__ = inspect.signature( # Only for deprecation period.

lib/matplotlib/tight_bbox.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ def restore_bbox():
5757
tr = Affine2D().scale(fixed_dpi)
5858
dpi_scale = fixed_dpi / fig.dpi
5959

60-
fig.bbox_inches = Bbox.from_bounds(0, 0,
61-
bbox_inches.width, bbox_inches.height)
60+
fig.bbox_inches = Bbox.from_bounds(0, 0, *bbox_inches.size)
6261
x0, y0 = tr.transform(bbox_inches.p0)
63-
w1, h1 = fig.bbox.width * dpi_scale, fig.bbox.height * dpi_scale
62+
w1, h1 = fig.bbox.size * dpi_scale
6463
fig.transFigure._boxout = Bbox.from_bounds(-x0, -y0, w1, h1)
6564
fig.transFigure.invalidate()
6665

0 commit comments

Comments
 (0)
0