Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
ENH: Add option to relpace text with boxes in image_comparision test#29871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -97,6 +97,13 @@ class Text(Artist): | ||||||
zorder = 3 | ||||||
_charsize_cache = dict() | ||||||
_draw_bbox_only = False | ||||||
""" | ||||||
A helper flag to replace texts by a bounding box. This is primarily | ||||||
intended for use in figure comparison tests. | ||||||
For sipmlicity, the flag is evaluated at draw time and thus applies | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. There is a spelling error in the word 'sipmlicity'; consider correcting it to 'simplicity'. Suggested change
Copilot uses AI. Check for mistakes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Ok, just wanted to try what copilot review suggested. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. It didn't even manage to catch the typos in the PR title... | ||||||
to all drawn text. | ||||||
""" | ||||||
def __repr__(self): | ||||||
return f"Text({self._x}, {self._y}, {self._text!r})" | ||||||
@@ -778,6 +785,9 @@ def draw(self, renderer): | ||||||
# Update the location and size of the bbox | ||||||
# (`.patches.FancyBboxPatch`), and draw it. | ||||||
if self._draw_bbox_only: | ||||||
self.set_bbox(dict(facecolor='none', edgecolor='red', pad=0)) | ||||||
if self._bbox_patch: | ||||||
self.update_bbox_position_size(renderer) | ||||||
self._bbox_patch.draw(renderer) | ||||||
@@ -793,6 +803,9 @@ def draw(self, renderer): | ||||||
for line, wh, x, y in info: | ||||||
if self._draw_bbox_only: | ||||||
break | ||||||
mtext = self if len(info) == 1 else None | ||||||
x = x + posx | ||||||
y = y + posy | ||||||
Uh oh!
There was an error while loading.Please reload this page.