5

Xcode 7 プレイグラウンドで正弦波をプロットしようとしています。次のコードがあります(この投稿から取得):

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私にこれを示しています:

ここに画像の説明を入力

しかし、次のような通常のグラフ(軸など)が必要です:

ここに画像の説明を入力

どうすればそれを達成できますか?

4

1 に答える 1

5

Unfortunately, it seems that Apple has removed robust graph labels in favor of unlabeled blue lines with tiny, tiny dots that a user has to click "just right" in order to display the value. From the clip I saw at the WWDC in which the speaker talks about Playground "improvements", he said that this unlabeled blue line is easier and more intuitive—in defiance of mathematics history. I can only hope that Apple will one day restore the features that they inexplicably removed (probably in an effort to make the software more stable).

于 2015-10-05T17:45:44.843 に答える