Open roberthsu2003 opened 3 months ago
import matplotlib.pyplot as plt
labels = ['Nokia', 'Samsung', 'Apple', 'Lumia']
values = [20, 30, 45, 10]
colors =['yellow', 'green', 'red', 'blue']
explode = [0.3, 0, 0, 0]
plt.pie(values, labels=labels, colors=colors, autopct='%1.1f%%', startangle=180,explode=explode)
plt.axis('equal')
plt.show()
import matplotlib.pyplot as plt
labels = ['Nokia', 'Samsung', 'Apple', 'Lumia']
values = [20, 30, 45, 10]
colors = ['yellow', 'green', 'red', 'blue']
figure = plt.figure()
axes = figure.add_subplot()
axes.pie(values, labels=labels, colors=colors, explode=(0.3,0,0,0), autopct='%1.1f%%',shadow=True, startangle=180)
plt.show()
import matplotlib.pyplot as plt
labels = ['Nokia', 'Samsung', 'Apple', 'Lumia']
values = [20, 30, 45, 10]
fig, ax = plt.subplots()
ax.pie(values, labels=labels,autopct='%1.1f%%',colors=['yellow', 'green', 'red', 'blue'])
plt.show()
import matplotlib.pyplot as plt
labels = ['Nokia', 'Samsung', 'Apple', 'Lumia']
values = [20, 30, 45, 10]
colors =['yellow', 'green', 'red', 'blue']
explode = (0, 0.1, 0, 0)
fig, ax = plt.subplots()
ax.pie(values, explode=explode, labels=labels, autopct='%1.1f%%',
shadow=True, startangle=90)
plt.show()
import matplotlib.pyplot as plt
labels = ['Nokia', 'Samsung', 'Apple', 'Lumia']
values = [20, 30, 45, 10]
explode = [0.1,0,0,0]
fig, ax = plt.subplots()
ax.pie(values, explode=explode, labels=labels, autopct='%1.1f%%',
shadow=True, startangle=90,colors =['yellow', 'green', 'red', 'blue'])
plt.show()
labels = ['Nokia', 'Samsung', 'Apple', 'Lumia']
values = [20, 30, 45, 10]
explode = [0.1,0,0,0]
fig, ax = plt.subplots()
ax.pie(values, explode=explode, labels=labels, autopct='%1.1f%%',
shadow=True, startangle=90,colors =['yellow', 'green', 'red', 'blue'])
plt.show()```