subramv / helixvis

Visualize alpha-helical peptide sequences in Python using helical wheels and wenxiang diagrams

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Figure legend is cut off using pyplot.show()

subramv opened this issue · comments

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')
commented

Cool! How'd you fix this? (I have no clue how Python plotting works)