我正在尝试重写这篇文章:我们画画,编程。从 Python 中的伪代码机器生成向量场(俄语)中的艺术图案。我是 ML 新手,因此出现以下问题:如何构建角度网格并通过 PyCharm 输出?我在这个阶段:
import numpy as np
import math
import matplotlib.pyplot as plt
width = 100
height = 100
left_x = int(width * -0.5)
right_x = int(width * 1.5)
top_y = int(height * -0.5)
bottom_y = int(height * 1.5)
resolution = int(width * 0.01)
num_columns = int((right_x - left_x) / resolution)
num_rows = int((bottom_y - top_y) / resolution)
grid=np.ndarray((num_columns, num_rows))
grid[:,:]=math.pi * 0.25
在这段代码中,我创建了一个 200 行和 200 列的网格数组,其中插入了角度“default_angle”。请告诉我我是否朝着正确的方向前进以及如何“绘制”网格,如附加链接中所示。到目前为止,我认为我需要使用 matplotlib。