Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd412228

Browse files
authored
Merge pull request#8772 from anntzer/backends-cleanup
MNT: Backends cleanup - style and docs in backend_bases and backend_agg - style in backend_cairo - dropped unused private attribute in backend_gtk3, backend_gtk3agg, backend_gtk3cairo - unified 'normal' and 'blitting' code paths in backend_qt5agg - import cleanup and MRO tweaks it backend_qt5agg - import tweaks + MRO cleanup in backend_qt4agg
2 parentsc4e6388 +79cfe14 commitd412228

File tree

9 files changed

+176
-321
lines changed

9 files changed

+176
-321
lines changed

‎lib/matplotlib/backend_bases.py‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -694,17 +694,17 @@ def _draw_text_as_path(self, gc, x, y, s, prop, angle, ismath):
694694

695695
defget_text_width_height_descent(self,s,prop,ismath):
696696
"""
697-
get the width andheight, andtheoffset from the bottom to the
698-
baseline (descent), in display coords of the strings with
699-
:class:`~matplotlib.font_manager.FontProperties` prop
697+
Get the width,height, anddescent (offset from the bottom
698+
to the baseline), in display coords, of the string*s* with
699+
:class:`~matplotlib.font_manager.FontProperties`*prop*
700700
"""
701701
ifismath=='TeX':
702702
# todo: handle props
703703
size=prop.get_size_in_points()
704704
texmanager=self._text2path.get_texmanager()
705705
fontsize=prop.get_size_in_points()
706-
w,h,d=texmanager.get_text_width_height_descent(s,fontsize,
707-
renderer=self)
706+
w,h,d=texmanager.get_text_width_height_descent(
707+
s,fontsize,renderer=self)
708708
returnw,h,d
709709

710710
dpi=self.points_to_pixels(72)
@@ -2151,7 +2151,6 @@ def print_figure(self, filename, dpi=None, facecolor=None, edgecolor=None,
21512151
# the backend to support file-like object, i'm going
21522152
# to leave it as it is. However, a better solution
21532153
# than stringIO seems to be needed. -JJL
2154-
#result = getattr(self, method_name)
21552154
result=print_method(
21562155
io.BytesIO(),
21572156
dpi=dpi,
@@ -2203,7 +2202,6 @@ def print_figure(self, filename, dpi=None, facecolor=None, edgecolor=None,
22032202
_bbox_inches_restore=None
22042203

22052204
try:
2206-
#result = getattr(self, method_name)(
22072205
result=print_method(
22082206
filename,
22092207
dpi=dpi,

‎lib/matplotlib/backends/backend_agg.py‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,20 +212,17 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
212212

213213
defget_text_width_height_descent(self,s,prop,ismath):
214214
"""
215-
get the width and height in display coords of the string s
216-
with FontPropertry prop
217-
218-
# passing rgb is a little hack to make caching in the
219-
# texmanager more efficient. It is not meant to be used
220-
# outside the backend
215+
Get the width, height, and descent (offset from the bottom
216+
to the baseline), in display coords, of the string *s* with
217+
:class:`~matplotlib.font_manager.FontProperties` *prop*
221218
"""
222219
ifrcParams['text.usetex']:
223220
# todo: handle props
224221
size=prop.get_size_in_points()
225222
texmanager=self.get_texmanager()
226223
fontsize=prop.get_size_in_points()
227-
w,h,d=texmanager.get_text_width_height_descent(s,fontsize,
228-
renderer=self)
224+
w,h,d=texmanager.get_text_width_height_descent(
225+
s,fontsize,renderer=self)
229226
returnw,h,d
230227

231228
ifismath:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp