matplotlib - Plotting Unit Circle in Python with contour -
I am trying to plot a circle with flat function. PTT DER circle (X, Y): Returns (x * x + y * y) xx = np.linspace as my code adheres,
NMP as importation Import (-2,2,400) yy = np.linspace (-2,2,400) [x, y] = np. Mcegrid (XX, or Z) = Circle (X, Y) platform () plt.contour (x, y, z, 1) plt.show () I'm thinking contour function I'll just give the cross section of x ^ 2 + y ^ 2 = 1, but it gives me a circle with 1.5 different radii. Why is it like this? Thanks,
Change it:
plt.contour (x, Y, Z, 1) In:
plt.contour (x, y, z, [1]) If the fourth argument is an integer, then it determines the number of the level for which there is a contour draw, and contour chooses the value for those levels if the fourth argument is a sequence , Then the values in the sequence are the level of equality.
Comments
Post a Comment