- 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
How to plot sine curve on polar axes using Matplotlib?
To plot the sine curve on polar axes, we can take the following steps −
- Set the figure size and adjust the padding between and around the subplots.
- Create a new figure or activate an existing figure using figure() method
- Add an '~.axes.Axes' to the figure as part of a subplot arrangement.
- Get x and y data points using numpy.
- Plot x and y data points using plot() 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 fig = plt.figure() ax = fig.add_subplot(projection='polar') x = np.linspace(-5, 5, 100) y = np.sin(x**2) ax.plot(x, y, color='red', lw=3) plt.show()
Output
- Related Articles
- How to curve text in a polar plot in matplotlib?
- How to animate a sine curve in Matplotlib?
- How to plot a point on 3D axes in Matplotlib?
- How to make a quiver plot in polar coordinates using Matplotlib?
- Plot scatter points on polar axis in Matplotlib
- Rotate theta=0 on a Matplotlib polar plot
- Plot a polar color wheel based on a colormap using Python/Matplotlib
- Plot scatter points on 3d plot without axes and grids in Matplotlib
- How to plot half or quarter polar plots in Matplotlib?
- How to get a matplotlib Axes instance to plot to?
- How to create minor ticks for a polar plot in matplotlib?
- How to plot events on time using Matplotlib?
- Plot 3D bars without axes in Matplotlib
- How to plot multiple histograms on same plot with Seaborn using Matplotlib?
- How to change the curve using radiobuttons in Matplotlib?

Advertisements