- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Plot scatter points on polar axis in Matplotlib
To plot scatter points on polar axis in Matplotlib, we can take the following steps −
- Set the figure size and adjust the padding between and around the subplots.
- Initialize a variable, N, for number of sample data.
- Get r, theta, area and color data using numpy
- Create a new figure or activate an existing figure.
- Plot theta, r, colors and area, using scatter() method.
- To display the figure, use show() method.
Example
import numpy as np import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True N = 150 r = 2 * np.random.rand(N) theta = 2 * np.pi * np.random.rand(N) area = 200 * r**2 colors = theta fig = plt.figure() ax = fig.add_subplot(projection='polar') c = ax.scatter(theta, r, c=colors, s=area, cmap='hsv', alpha=0.75) plt.show()
Output
- Related Articles
- Plot scatter points using plot method in Matplotlib
- Plot scatter points on 3d plot without axes and grids in Matplotlib
- How to plot additional points on the top of a scatter plot in Matplotlib?
- Connecting two points on a 3D scatter plot in Python and Matplotlib
- Plot scatter points on a 3D projection with varying marker size in Matplotlib
- How to annotate the points on a scatter plot with automatically placed arrows in Matplotlib?
- Rotate theta=0 on a Matplotlib polar plot
- Adding caption below X-axis for a scatter plot using Matplotlib
- How to plot scatter points with increasing size of marker in Matplotlib?
- How to plot sine curve on polar axes using Matplotlib?
- How to plot scatter points in a 3D figure with a colorbar in Matplotlib?
- How to use different markers for different points in a Pylab scatter plot(Matplotlib)?
- How to shade points in a scatter based on colormap in Matplotlib?
- How to animate a scatter plot in Matplotlib?
- How to plot scatter masked points and add a line demarking masked regions in Matplotlib?

Advertisements