Pandas DataFrame: plot.pie() function
DataFrame.plot.pie() function
The plot.pie() function is used to generate a pie plot
A pie plot is a proportional representation of the numerical data in a column. This function wraps matplotlib.pyplot.pie() for the specified column. If no column reference is passed and subplots=True a pie plot is drawn for each numerical column independently.
Syntax:
DataFrame.plot.pie(self, **kwargs)
Parameters:
Name | Description | Type/Default Value | Required / Optional |
---|---|---|---|
y | Label or position of the column to plot. If not provided, subplots=True argument must be passed. | int or label | Optional |
**kwds | Keyword arguments to pass on to DataFrame.plot(). | Required |
Returns: matplotlib.axes.Axes or np.ndarray of them
A NumPy array is returned when subplots is True.
Example:
Download the Pandas DataFrame Notebooks from here.
Previous: DataFrame.plot.line() function
Next: DataFrame.plot.scatter() function
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework