Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Polar plot without grid in matplotlib

Is there a way to turn of the grid for polar plots in matplotlib? I tried matplotlib.pyplot.rgrids([], []), but it doesn't work.

like image 303
mdm Avatar asked Jun 17 '11 12:06

mdm


People also ask

What is PLT grid false?

Plot x and y points using the plot() method with linestyle, labels. To hide the grid, use plt. grid(False). To hide the axes, use plt.axis('off') To activate the labels' legend, use the legend() method.

What does PLT grid () do in Python?

pyplot. grid() Function. The grid() function in pyplot module of matplotlib library is used to configure the grid lines.

How do you plot a polar graph in Python?

A point in polar co-ordinates is represented as (r, theta). Here, r is its distance from the origin and theta is the angle at which r has to be measured from origin. Any mathematical function in the Cartesian coordinate system can also be plotted using the polar coordinates.


1 Answers

From your axes instance, call grid(False).

import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.add_subplot(111, polar=True)
ax.grid(False)

r = np.arange(0,1,0.001)
theta = 2*2*np.pi*r

ax.plot(theta,r)
plt.show()
like image 130
Stephen Terry Avatar answered Oct 22 '22 13:10

Stephen Terry