Figure legend is cut off using pyplot.show()
subramv opened this issue · comments
subramv commented
Steps to reproduce:
- Call draw_wheel or draw_wenxiang with legend = True
- Call plt.show()
Expected behavior
- Legend will fit inside plot window
Actual behavior
- Legend is placed outside plot window and is cut off by image boundary
Workaround
- Known issue with calling plt.show() and visualizing plot in interactive window
- Can get around this by expanding interactive window by clicking -> dragging it larger
- Legend is preserved correctly when calling savefig if bbox_inches is specified as tight:
fig, ax = helixvis.draw_wheel(Sequence, legend = True)
fig.savefig('wheel.png', bbox_inches = 'tight')
Raoul commented
Cool! How'd you fix this? (I have no clue how Python plotting works)
subramv commented
This is because of how matplotlib works, not helixvis itself. To get around
it I know of 3 options, all outside the helixvis call-
1) scale the axes by 0.8 or so to make room for the legend
2) drag the interactive window larger to fit the legend
3) save the image to a static figure with bbox_inches = 'tight'
…On Wed, May 20, 2020, 12:41 AM Raoul ***@***.***> wrote:
Cool! How'd you fix this? (I have no clue how Python plotting works)
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#3 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKPGRTLWYVOFFVACPBOG6RDRSNNORANCNFSM4MRPK65A>
.