| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -13,7 +13,7 @@ | |
|
|
||
| from matplotlib.offsetbox import ( | ||
| AnchoredOffsetbox, AnnotationBbox, AnchoredText, DrawingArea, OffsetBox, | ||
| OffsetImage, TextArea, _get_packed_offsets, HPacker, VPacker) | ||
| OffsetImage, PaddedBox, TextArea, _get_packed_offsets, HPacker, VPacker) | ||
|
|
||
|
|
||
| @image_comparison(['offsetbox_clipping'], remove_text=True) | ||
| Expand Down Expand Up | @@ -347,8 +347,9 @@ def test_packers(align): | |
| r1 = DrawingArea(x1, y1) | ||
| r2 = DrawingArea(x2, y2) | ||
|
|
||
| hpacker = HPacker(children=[r1, r2], pad=0, sep=0, align=align) | ||
| vpacker = VPacker(children=[r1, r2], pad=0, sep=0, align=align) | ||
| hpacker = HPacker(children=[r1, r2], align=align) | ||
| vpacker = VPacker(children=[r1, r2], align=align) | ||
|
|
||
| renderer = fig.canvas.get_renderer() | ||
|
|
||
| # HPacker | ||
| Expand Down Expand Up | @@ -378,3 +379,12 @@ def test_packers(align): | |
| x_height = (x2 - x1) / 2 | ||
| # x-offsets, y-offsets | ||
| assert_allclose([(x_height, 0), (0, -y2)], offset_pairs) | ||
|
|
||
|
|
||
| def test_paddedbox(): | ||
| # smoke test paddedbox for correct default value | ||
| fig, ax = plt.subplots() | ||
| at = AnchoredText("foo", 'upper left') | ||
| pb = PaddedBox(at, patch_attrs={'facecolor': 'r'}, draw_frame=True) | ||
|
Comment thread
Copy link
Copy Markdown
Member
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. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThis test passes on main as well. (As the fact that pad is None is not a problem until later on.) You need to do: ax.add_artist(pb) fig.draw_without_rendering() If you can also add a similar thing for one of the packers that would be great! Can go in the same test/figure. There is a previous test for the packers that you can just copy the relevant code from, but leave the pad and sep arguments out.
Sorry, something went wrong.
Krutarth-P reacted with thumbs up emoji
All reactions
|
||
| ax.add_artist(pb) | ||
| fig.draw_without_rendering() | ||
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.