top of page
Search

PYTHON CODING

  • Writer: waclaw_koscielniak
    waclaw_koscielniak
  • Jul 9
  • 1 min read

import numpy as np

import matplotlib.pyplot as plt

n = 5000

theta = np.linspace(0, 12 * np.pi, n)

r = np.linspace(0, 1, n) + 0.2 * np.sin(6 * theta)

x = r * np.cos(theta)

y = r * np.sin(theta)

colors = np.linspace(0, 1, n)

plt.figure(figsize=(8, 8))

plt.scatter(x, y, c=colors, cmap='viridis', s=2, alpha=0.8)

plt.axis('off')

plt.title("Peacock Tail Pattern", fontsize=14, fontweight='bold', color='darkblue')


[Running] python3 -u "/Users/name/test/peacock.py"

[Done] exited with code=0 in 61.422 seconds

Pretty Python.
Pretty Python.

















PythonCoding #VSC

 
 
 

1 Comment


Guest
Jul 09

You can modify and try it on your own.

Like
bottom of page