# Radial Color Gradient For Polygon in Python

I'm trying to figure out how to color a Shapely polygon with a radial gradient. I start with some points and buffer them to circles. I used Grad from colorir to create a gradient of colors, but I want each circle to be a darker color at the center and fade to transparent at the edges. I looked at this post and am able to generate the image but I don't know how to apply it to my circles.

Here's my code so far:

``````import matplotlib.pyplot as plt
from shapely.geometry import Point, LineString

# functions for plotting

def plot_coords(coords, color):
pts = list(coords)
x, y = zip(*pts)
# print(color)
plt.plot(x,y, color="w", linewidth=.5)
plt.fill_between(x, y, facecolor=color, alpha = 0.4)

def plot_polys(polys, color):
for poly, color in zip(polys, color):
plot_coords(poly.exterior.coords, color)

x = 0
y = 0
h = 1.73205080757

# points

color_points = [
Point(x, y),
Point((x + 2), y),
Point((x - 2), y),
Point((x + 1), (y + h)),
Point((x - 1), (y + h)),
Point((x + 1), (y - h)),
Point((x - 1), (y - h))]

# buffer to circles
color_circles = []
for point in color_points:
color_circles.append(point.buffer(2))

fig = plt.figure()

ax.set_aspect('equal')

plt.show()
``````

My output looks like this: But I would like each circle to look more like this: Any help would be greatly appreciated!

🔴 No definitive solution yet