-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix default parameters of FancyArrow #6583
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
Conversation
Make code consistent with documentation for FancyArrow
Probably should make the documentation consistent with the code? |
What does the default arrow now look like? I am mostly 👎 on this change, but am open to be convinced otherwise. The history of this seems to be, the default was changed to 20 (but the docs not updated) in 2013 in (7458091 / #1186) because the head was invisible. The default width of I think this either needs to also change the default width, or just update the docs to match the code. import matplotlib.patches as mpatches
fig, ax = plt.subplots()
scales = [3, 20]
widths = [0.001, .01, .05]
for k, scale in enumerate(scales):
ax.axvline(k, color='k', ls=':')
ax.axvline(k+.5, color='k', ls=':')
for j, width in enumerate(widths):
a = mpatches.FancyArrow(k, j, .5, 0, width=width, head_width=scale*width)
ax.add_patch(a)
ax.set_ylim(-1, j+1)
ax.set_xlim(-.25, k + 1)
ax.set_xticks(np.arange(len(scales)) + .25)
ax.set_xticklabels(map(str, scales))
ax.set_yticks(range(len(widths)))
ax.set_yticklabels(map(str, widths))
ax.set_xlabel('default scale')
ax.set_ylabel('default width')
attn @dmcdougall @pelson |
Part of the real problem is that |
What are the units for the width? It's clearly not pixels, but maybe it's time to increase the default, since it seems to be rounded up to one pixel anyway... |
After discussion with @efiring and @dopplershift we decided to merge this as-is and then deprecate this Artist. |
API: default parameters of FancyArrow
Backported to v2.x via 848cfe5. |
Make code consistent with documentation for FancyArrow