PlotKit

CocoaPods Compatible Carthage Compatible

Plots made easy.

PlotKit Plot

Features

  • 2D line and scatter plots
  • Multiple axes
  • Custom tick marks

Usage

To start using PlotKit quickly use the plotPoints helper function. It takes a list of points and returns a view that you can use in your app:

<div class="highlight highlight-source-swift position-relative" data-snippet-clipboard-copy-content="import PlotKit

// Generate some data to plot
let count = 1024
let t = (0..<count).map({ 2*M_PI * Double($0) / Double(count-1) })
let y = t.map({ sin($0) })

// Create a PlotView
let plotView1 = plotPoints((0..

import PlotKit

// Generate some data to plot
let count = 1024
let t = (0..<count).map({ 2*M_PI * Double($0) / Double(count-1) })
let y = t.map({ sin($0) })

// Create a PlotView
let plotView1 = plotPoints((0..<count).map{ Point(x: t[$0], y: y[$0]) }, hTicks: .fit(6), vTicks: .fit(4))