ENH: Add option to relpace text with boxes in image_comparision test#29871
ENH: Add option to relpace text with boxes in image_comparision test#29871timhoffm wants to merge 1 commit intomatplotlib:mainfrom
Conversation
This should be the right level of simplification when text is relevant in image comparision tests but the exact characters do not matter. The drawn bboxes only rely on font metrics and thus give accurate sizes, while being insensitive to rendering details. This is a minimal proof-of-concept. Exact implementation may be improved .
|
Looks like we crossed with #29872.
Unfortunately, relying on font metrics is not safe to avoid changes in test images. For example, if you change the hinting settings in |
|
Superseeded by #29872. |
| """ | ||
| 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.
There is a spelling error in the word 'sipmlicity'; consider correcting it to 'simplicity'.
| For sipmlicity, the flag is evaluated at draw time and thus applies | |
| For simplicity, the flag is evaluated at draw time and thus applies |
There was a problem hiding this comment.
Ok, just wanted to try what copilot review suggested.
There was a problem hiding this comment.
It didn't even manage to catch the typos in the PR title...
This should be the right level of simplification when text is relevant in image comparision tests but the exact characters do not matter. The drawn bboxes only rely on font metrics and thus give accurate sizes, while being insensitive to rendering details.
Alternative to #29833.
This is a minimal proof-of-concept. Exact implementation may be improved: