{"id":17220844,"url":"https://github.com/kojix2/nuplot","last_synced_at":"2025-04-13T23:46:50.970Z","repository":{"id":94131626,"uuid":"121018576","full_name":"kojix2/nuplot","owner":"kojix2","description":"Running Gnuplot with Crystal.","archived":false,"fork":false,"pushed_at":"2018-03-17T09:51:45.000Z","size":47,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T13:51:26.670Z","etag":null,"topics":["crystal","gnuplot"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/kojix2.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-10T13:40:28.000Z","updated_at":"2021-09-20T00:45:45.000Z","dependencies_parsed_at":"2023-03-08T16:30:40.346Z","dependency_job_id":null,"html_url":"https://github.com/kojix2/nuplot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fnuplot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fnuplot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fnuplot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fnuplot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kojix2","download_url":"https://codeload.github.com/kojix2/nuplot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799697,"owners_count":21163398,"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":["crystal","gnuplot"],"created_at":"2024-10-15T03:53:23.301Z","updated_at":"2025-04-13T23:46:50.961Z","avatar_url":"https://github.com/kojix2.png","language":"Crystal","readme":"# nuplot\n\nThis is a minimum tool for running Gnuplot with Crystal. \n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  nuplot:\n    github: kojix2/nuplot\n```\n\n## Usage\n\n```crystal\nrequire \"nuplot\"\n```\n![sin(x)](https://raw.githubusercontent.com/kojix2/nuplot/master/img/sin.png)\n```crystal\nGnuplot.plot do |s|\n  s \u003c\u003c \"plot sin(x)\"\nend\n```\n![scatter plot](https://raw.githubusercontent.com/kojix2/nuplot/master/img/scatter2d.png)\n```crystal\nx = Array(Float64).new(100){ rand(10.0..20.0) }\ny = Array(Float64).new(100){ rand(100.0..200.0) }\n\nGnuplot.plot do |s|\n  s \u003c\u003c \"set title 'SCATTER'\"\n  s \u003c\u003c \"plot '-' pt 6 lt rgb 'red' t 'circle'\"\n  s \u003c\u003c to_gp([x, y])\nend\n```\n![lines plot](https://raw.githubusercontent.com/kojix2/nuplot/master/img/lines.png)\n```crystal\nmemo = 0\nx = Array(Float64).new(100,0.0)\n\n# Optimistic random walk\n100.times do |i|\n  memo = memo + rand(-0.9..1.0)\n  x[i] = memo\nend\n\nGnuplot.plot do |s|\n  s \u003c\u003c \"set title 'LINES'\"\n  s \u003c\u003c \"plot '-' with lines title 'x'\"\n  s \u003c\u003c to_gp(x)\nend\n```\n![scatter plot 3d](https://raw.githubusercontent.com/kojix2/nuplot/master/img/scatter3d.png)\n```crystal\nx = Array(Float64).new(1000){ rand(-10.0..10.0) }\ny = Array(Float64).new(1000){ rand(-10.0..10.0) }\nz = Array(Float64).new(1000){ |i| x[i]**2 + y[i]**2 }\n\nGnuplot.plot do |s|\n  s \u003c\u003c \"set title 'SCATTER 3D'\"\n  s \u003c\u003c \"splot '-' pt 6 t 'z=x^2+y^2'\"\n  s \u003c\u003c to_gp([x,y,z])\nend\n```\n\n## Development\nWhat I do not do\n- Replacing the gnuplot idiom with a new Crystal object.\n\n## Contributing\n- bird1079s\n\nPull requests are always welcome.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkojix2%2Fnuplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkojix2%2Fnuplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkojix2%2Fnuplot/lists"}