Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pie chart from input
#1
Hi everyone hope you're all having a good day.


I am currently trying some stuff and i could need some help if possible.

I need help turning input to a pie chart, ive tried implementing "data" as a list with TGH, AN and KV but it's not working.

Here's the code.

TTG = int(input('TTG?'))
PN = int(input('PN?'))
SS = int(input('SS?'))

TC = int(input('TC?'))
VC = int(input('VC?'))
VP = int(input('VP?'))

PM = int(input('PM?'))
DP = int(input('DP?'))

# calc 1 of TGH
TG = TTG - PN
OT = TG - SS
TGH = OT / TG

# calc 2 of AN
UP = TC / VC
VU = VP / OT
AN = UP * VU

# calc 3 of KV
GP = PM - DP
KV = GP / PM

# calc 4 of RAW
RAW = TGH * AN * KV
Reply
#2
The function matplotlib.pyplot.pie() can draw a pie chart. You can save the plot as png or pdf or other formats.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Showing an empty chart, then input data via function kgall89 0 943 Jun-02-2022, 01:53 AM
Last Post: kgall89

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020