Zonova
Zonova

Reputation: 235

Matplotlib Polar scatter plot doesn't show all points

I'm trying to do a simple polar scatter plot in Matplotlib, here is my code:

import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111, polar = True)
c = ax.scatter([-1.3,.4,-.2],[1,1.5,2])

For some reason, the plot doesn't include all of the points, it only shows me the point with radius 1. How do I make it automatically show all of the points, or how can I fix the radius of the plot myself? I am running this in a Jupyter notebook, if that makes any difference.

Upvotes: 0

Views: 887

Answers (1)

Vedant Desai
Vedant Desai

Reputation: 51

This is what I suggest if I understand your question correctly this code plots all the points automatically

Here I am just using for loop to loop through all the points

import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111, polar = True)
a = [1,1.5,2]
for idx, i in enumerate([-1.3,.4,-.2]):
    c = ax.scatter([i],[a[idx]])
plt.show()

Upvotes: 1

Related Questions