快速绘制Tensorflow的极坐标图和饼图

问题描述 投票:0回答:1

是否可以在屏幕上为TensorFlow绘制极坐标图,直方图和饼图,而不显示过程?

arrays swift3 tensorflow2.0
1个回答
0
投票

TensorFlow的Swift包含python互操作性。

https://www.tensorflow.org/swift/tutorials/python_interoperability

查看他们如何使用matplotlib:

let np = Python.import("numpy")
let plt = Python.import("matplotlib.pyplot")

let time = np.arange(0, 10, 0.01)
let amplitude = np.exp(-0.1 * time)
let position = amplitude * np.sin(3 * time)

plt.figure(figsize: [15, 10])

plt.plot(time, position)
plt.plot(time, amplitude)
plt.plot(time, -amplitude)

plt.xlabel("Time (s)")
plt.ylabel("Position (m)")
plt.title("Oscillations")

plt.show()

plt.polarplt.polar应该可以正常工作。

© www.soinside.com 2019 - 2024. All rights reserved.