Swiftpack.co - Package - jantomec/PlotKit

PlotKit

Swift package for ploting. Works on MacOS and on iOS. Main function plot creates a CGImage that can be used then as the data source for UIImage.

Demo:

let x: [[CGFloat]] = [linspace(from: 0, to: 10, n: 31), linspace(from: 5, to: 15, n: 31)]
let y0 = x[0].map { pow($0, 2) }
let y1 = x[1].map { 90-400*pow($0, -1) }
        
let opts: [PKPlotOption : Any] = [
    .connected : true,
    .xlimit : (CGFloat(0), CGFloat(18))
]
        
let graph = plot(x: x, y: [y0, y1], size: imageView!.frame.size, options: opts)
        
imageView.image = UIImage(cgImage: graph!)

Github

link
Stars: 1
Help us keep the lights on

Dependencies

Releases

v0.1.0 - Oct 30, 2019

v0.0.5 - Oct 30, 2019

v0.0.4 - Oct 30, 2019

v0.0.3 - Oct 29, 2019

v0.0.2 - Oct 29, 2019