-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Simplify ribbon_box example. #14117
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify ribbon_box example. #14117
Conversation
examples/misc/demo_ribbon_box.py
Outdated
|
||
fmt = ScalarFormatter(useOffset=False) | ||
ax.xaxis.set_major_formatter(fmt) | ||
heights = [7900, 8100, 7900, 6900, 9800] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heights = [7900, 8100, 7900, 6900, 9800] | |
heights = [7900, 8100, 7900, 6900, 9200] |
With 9800, the label slips out of the axes:
https://6974-7439715-gh.circle-artifacts.com/0/home/circleci/project/doc/build/html/gallery/misc/demo_ribbon_box.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
examples/misc/demo_ribbon_box.py
Outdated
|
||
patch_gradient = BboxImage(ax.bbox, interpolation="bicubic", zorder=0.1) | ||
gradient = np.zeros((2, 2, 4)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment # background gradient
.
Even though the example could use a bit more explanation, I'm not enforcing it as part of this PR, because this is an incremental improvement. However, adding this small comment at least helps to understand what this code segment is about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just renamed the variable.
- Use AxesImage instead of the more obscure BboxImage. - Just hardcode the data instead of random-generating it and rounding it to hundreds when displaying. - Misc cleanups.
…117-on-v3.1.x Backport PR #14117 on branch v3.1.x (Simplify ribbon_box example.)
to hundreds when displaying.
Inspired by #14057 (thanks @timhoffm)
PR Summary
PR Checklist