Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

ax pie rounding

"""
Make a pie chart - see
http://matplotlib.sf.net/matplotlib.pylab.html#-pie for the docstring.

This example shows a basic pie chart with labels optional features,
like autolabeling the percentage, offsetting a slice with "explode",
adding a shadow, and changing the starting angle.

"""
from pylab import *

# make a square figure and axes
figure(1, figsize=(6,6))
ax = axes([0.1, 0.1, 0.8, 0.8])

# The slices will be ordered and plotted counter-clockwise.
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
fracs = [15, 30, 45, 10]
explode=(0, 0.05, 0, 0)

pie(fracs, explode=explode, labels=labels,
                autopct='%1.0f%%', shadow=True, startangle=90)
                # The default startangle is 0, which would start
                # the Frogs slice on the x-axis.  With startangle=90,
                # everything is rotated counter-clockwise by 90 degrees,
                # so the plotting starts on the positive y-axis.

title('Raining Hogs and Dogs', bbox={'facecolor':'0.8', 'pad':5})

show()
Comment

ax pie rounding

"""
Make a pie chart - see
http://matplotlib.sf.net/matplotlib.pylab.html#-pie for the docstring.

This example shows a basic pie chart with labels optional features,
like autolabeling the percentage, offsetting a slice with "explode",
adding a shadow, and changing the starting angle.

"""
from pylab import *

# make a square figure and axes
figure(1, figsize=(6,6))
ax = axes([0.1, 0.1, 0.8, 0.8])

# The slices will be ordered and plotted counter-clockwise.
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
fracs = [15, 30, 45, 10]
explode=(0, 0.05, 0, 0)

pie(fracs, explode=explode, labels=labels,
                autopct='%1.0f%%', shadow=True, startangle=90)
                # The default startangle is 0, which would start
                # the Frogs slice on the x-axis.  With startangle=90,
                # everything is rotated counter-clockwise by 90 degrees,
                # so the plotting starts on the positive y-axis.

title('Raining Hogs and Dogs', bbox={'facecolor':'0.8', 'pad':5})

show()
Comment

PREVIOUS NEXT
Code Example
Python :: containsDuplicate Set Solution 
Python :: parseint python equivalent 
Python :: knn.score sklearn 
Python :: merging results from model.predict() prediction with original pandas dataframe 
Python :: element tree no able to find tag 
Python :: ring Access List Items by String Index 
Python :: ring write the same example using normal for loop the Encrypt() and Decrypt() functions. 
Python :: while loop using increment 
Python :: for loop the string from reverse order and skipping last element in string python 
Python :: python run unix command 
Python :: notebook prevent cell output 
Python :: mehrzeiliges kommentar python 
Python :: get next element while looping 
Python :: tkinter trig calculator 
Python :: how to know google index of a page using python 
Python :: How to play audio in background 
Python :: alternatives for appending to numpy array 
Python :: phone no validate 
Python :: 2checkout ipn validation response python 
Python :: login system read data python 
Python :: how do i make snake game using python for beginners without pygame 
Python :: python check if not none or empty 
Python :: how to take matrix input in python 
Python :: python empty array length n grepper 
Python :: sending whatsapp message from python notebook 
Python :: fibonacci series stackoverflow 
Python :: python tuple first column 
Python :: trigger to print on python 
Python :: handling image files django aws 
Python :: Python Tkinter Canvas Widget Syntax 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =