{"id":13489384,"url":"https://github.com/alejandro-isaza/PlotKit","last_synced_at":"2025-03-28T04:31:08.983Z","repository":{"id":62450859,"uuid":"43563221","full_name":"alejandro-isaza/PlotKit","owner":"alejandro-isaza","description":"OS X plotting framework","archived":false,"fork":false,"pushed_at":"2022-01-09T21:52:25.000Z","size":227,"stargazers_count":61,"open_issues_count":9,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-20T23:25:17.089Z","etag":null,"topics":["macos","plots","scatter-plots"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alejandro-isaza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-02T16:17:20.000Z","updated_at":"2023-08-22T17:30:46.000Z","dependencies_parsed_at":"2022-11-02T01:01:32.121Z","dependency_job_id":null,"html_url":"https://github.com/alejandro-isaza/PlotKit","commit_stats":null,"previous_names":["aleph7/plotkit"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandro-isaza%2FPlotKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandro-isaza%2FPlotKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandro-isaza%2FPlotKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandro-isaza%2FPlotKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alejandro-isaza","download_url":"https://codeload.github.com/alejandro-isaza/PlotKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245970489,"owners_count":20702425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["macos","plots","scatter-plots"],"created_at":"2024-07-31T19:00:25.498Z","updated_at":"2025-03-28T04:31:08.716Z","avatar_url":"https://github.com/alejandro-isaza.png","language":"Swift","readme":"# PlotKit\n\n[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/PlotKit.svg)](https://img.shields.io/cocoapods/v/PlotKit.svg)\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\nPlots made easy.\n\n![PlotKit Plot](example.png?raw=true \"PlotKit Plot\")\n\n## Features\n\n- [x] 2D line and scatter plots\n- [x] Multiple axes\n- [x] Custom tick marks\n\n\n## Usage\n\nTo 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:\n\n\n```swift\nimport PlotKit\n\n// Generate some data to plot\nlet count = 1024\nlet t = (0..\u003ccount).map({ 2*M_PI * Double($0) / Double(count-1) })\nlet y = t.map({ sin($0) })\n\n// Create a PlotView\nlet plotView1 = plotPoints((0..\u003ccount).map{ Point(x: t[$0], y: y[$0]) }, hTicks: .fit(6), vTicks: .fit(4))\n```\n\n### Multiple point sets\n\nYou can have multiple curves or scatter plots in the same `PlotView`.\n\n```swift\nlet plotView = PlotView()\n\nlet pointSet1 = PointSet(values: values1)\npointSet1.pointType = .disk(radius: 2)\npointSet2.pointColor = .red\npointSet1.lineColor = nil\nplotView.addPointSet(pointSet1)\n\nlet pointSet2 = PointSet(values: values2)\npointSet2.pointType = .none\npointSet2.lineColor = .blue\nplotView.addPointSet(pointSet2)\n```\n\n\n### Axes\n\nYou can customize your plot axes. You can have as many axis lines as you want on the same plot.\n\n```swift\nlet plotView = PlotView()\n\nvar xaxis = Axis(orientation: .horizontal, ticks: .fit(5))\nxaxis.position = .value(0) \nxaxis.color = .blue\nxaxis.labelAttributes = [NSForegroundColorAttributeName: NSColor.blue]\nplotView.addAxis(xaxis)\n\nvar yaxis = Axis(orientation: .vertical, ticks: .distance(1))\nyaxis.lineWidth = 2\nplotView.addAxis(yaxis)\n```\n\nYou can specify ticks in one of three ways:\n * `fit(n)`: Say how many tick marks you want. **PlotKit** will space them evenly.\n * `distance(d)`: Say how far appart to place tick marks.\n * `list(l)`: Specify exactly the tick marks you want. This is the most flexible. You get to decide where to put the tick marks and also what their labels, line length and line thickness are.\n\n\n## Using PlotKit with Storyboards\n\nIf you want to use a PlotView in a Storyboard add an `NSView` and then change the class name and module like so\n\n![](https://cloud.githubusercontent.com/assets/167236/15224508/a5f79d96-182e-11e6-8a1c-00b197042470.png)\n\n---\n\n## License\n\nPlotKit is available under the MIT license. See the LICENSE file for more info.\n","funding_links":[],"categories":["Libs","Swift"],"sub_categories":["Math"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falejandro-isaza%2FPlotKit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falejandro-isaza%2FPlotKit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falejandro-isaza%2FPlotKit/lists"}