pie_chart.py 414 B

1234567891011121314
  1. from vedo import settings, show
  2. from vedo.pyplot import pie_chart
  3. settings.default_font = "Komika"
  4. title = "A pie chart plot"
  5. fractions = [0.1, 0.2, 0.3, 0.1, 0.3]
  6. colors = [ 1, 2, 3, 4, 'white']
  7. labels = ["stuff_1 ", "stuff_2 ", "comp^A ", "comp^B ", ""]
  8. pc = pie_chart(fractions, c=colors, labels=labels, title=title)
  9. pc2d = pc.clone2d("top-left", size=0.975, ontop=False)
  10. show(pc2d).close()