是否可以在屏幕上为TensorFlow绘制极坐标图,直方图和饼图,而不显示过程?
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.polar
和plt.polar
应该可以正常工作。