visualize_5_39.py 618 B

12345678910111213141516
  1. def screeplot(obj="pcascree", axlabelfontsize=9, axlabelfontname="Arial", axxlabel=None,
  2. axylabel=None, figtype='png', r=300, show=False, dim=(6, 4), theme=None):
  3. if theme == 'dark':
  4. general.dark_bg()
  5. y = [x * 100 for x in obj[1]]
  6. plt.subplots(figsize=dim)
  7. plt.bar(obj[0], y)
  8. xlab='PCs'
  9. ylab='Proportion of variance (%)'
  10. if axxlabel:
  11. xlab = axxlabel
  12. if axylabel:
  13. ylab = axylabel
  14. plt.xticks(fontsize=7, rotation=70)
  15. general.axis_labels(xlab, ylab, axlabelfontsize, axlabelfontname)
  16. general.get_figure(show, r, figtype, 'screeplot', theme)