我尝试在 Xcode 7 操场上绘制 sin 波。我有以下代码(来自这篇文章):
import XCPlayground
let sineArraySize = 64
let frequency1 = 4.0
let phase1 = 0.0
let amplitude1 = 2.0
let sineWave = (0..<sineArraySize).map {
amplitude1 * sin(2.0 * M_PI / Double(sineArraySize) * Double($0) * frequency1 + phase1)
}
func plotArrayInPlayground<T>(arrayToPlot:Array<T>, title:String) {
for currentValue in arrayToPlot {
XCPCaptureValue(title, value: currentValue)
}
}
plotArrayInPlayground(sineWave, title: "Sine wave 1")
向我Assistant Editor
展示了这一点:
但我想要一个像这样的普通图(带轴等):
我怎样才能做到这一点?