├── .github └── workflows │ └── test.yml ├── .gitignore ├── Changes ├── LICENSE ├── META6.json ├── README.md ├── dist.ini ├── histogram.png ├── lib └── Chart │ ├── Gnuplot.pm6 │ └── Gnuplot │ ├── Arrow.pm6 │ ├── Border.pm6 │ ├── CustomBuilder.pm6 │ ├── Grid.pm6 │ ├── Label.pm6 │ ├── Legend.pm6 │ ├── Object.pm6 │ ├── Output.pm6 │ ├── Range.pm6 │ ├── Subset.pm6 │ ├── Terminal.pm6 │ ├── Tics.pm6 │ ├── Timestamp.pm6 │ ├── Title.pm6 │ └── Util.pm6 ├── notebooks └── synopsis.ipynb ├── recprec.png ├── sinx.png ├── surface.dem.00.png └── t ├── 01-basic.t ├── 02-terminal.t ├── 03-plot.t ├── 04-splot.t ├── 05-label.t ├── 06-range.t ├── 07-tics.t ├── 08-legend.t ├── 09-border.t ├── 10-grid.t ├── 11-timestamp.t ├── 12-rectangle.t ├── 13-ellipse.t ├── 14-circle.t ├── 15-polygon.t ├── 16-title.t ├── 17-arrow.t └── 18-multiplot.t /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: test 2 | 3 | on: 4 | push: 5 | branches: 6 | - '*' 7 | tags-ignore: 8 | - '*' 9 | pull_request: 10 | 11 | jobs: 12 | raku: 13 | strategy: 14 | matrix: 15 | os: 16 | - ubuntu-latest 17 | - macOS-latest 18 | raku-version: 19 | - 'latest' 20 | runs-on: ${{ matrix.os }} 21 | steps: 22 | - uses: actions/checkout@v2 23 | - uses: Raku/setup-raku@v1 24 | with: 25 | raku-version: ${{ matrix.raku-version }} 26 | - name: Install Dependencies 27 | run: zef install --/test --test-depends --deps-only . 28 | - name: Install App::Prove6 29 | run: zef install --/test App::Prove6 30 | - name: Build gnuplot 31 | run: zef build . 32 | - name: Run Tests 33 | run: prove6 -l t 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /blib/ 2 | /src/*.o 3 | /src/Makefile 4 | /.panda-work 5 | /resources/*.so 6 | /resources/*.dylib 7 | .precomp/ 8 | /Chart-Gnuplot-* 9 | /gnuplot-* 10 | /example/* 11 | *.svg 12 | /notebooks/.ipynb_checkpoints/ 13 | /notebooks/jupyter.log 14 | /notebooks/nohup.out 15 | -------------------------------------------------------------------------------- /Changes: -------------------------------------------------------------------------------- 1 | Revision history for Chart-Gnuplot 2 | 3 | {{$NEXT}} 4 | 5 | 0.0.21 2023-03-20T13:31:50+09:00 6 | - Fixes: 7 | - Fix debug option as it enables to output both user input and reply from gnuplot [#47] 8 | - Additions: 9 | - Efficiency: 10 | 11 | 0.0.20 2021-05-01T13:26:55+09:00 12 | - Fixes: 13 | - Set TEXDIR explicitly for removing dependence on kpsewhich [#44] 14 | - Use github actions instead of travis ci [#43] 15 | - Additions: 16 | - Efficiency: 17 | 18 | 0.0.19 2020-07-26T15:43:28+09:00 19 | - Fixes: 20 | - Set pt instead of lt for recall-precision curve plotting 21 | - Additions: 22 | - Efficiency: 23 | 24 | 0.0.18 2020-07-26T15:13:15+09:00 25 | - Fixes: 26 | - Additions: 27 | - Use travis-ci.com instead of travis-ci.org 28 | - Add recall-precision curve example 29 | - Efficiency: 30 | 31 | 0.0.17 2020-01-03T01:55:08+09:00 32 | - Fixes: 33 | - Additions: 34 | - Efficiency: 35 | - Make debug mode faster [dfcc8] 36 | 37 | 0.0.16 2019-12-24T00:56:00+09:00 38 | - Fixes: 39 | - Replace p6/perl6 with raku 40 | - Additions: 41 | - Efficiency: 42 | 43 | 0.0.15 2019-12-17T00:42:51+09:00 44 | - Fixes: 45 | - Add CustomBuilder to the build-depends 46 | - Additions: 47 | - Efficiency: 48 | 49 | 0.0.14 2019-11-15T08:16:21+09:00 50 | - Fixes: 51 | - Fix some build errors caused by zef changes 52 | - Additions: 53 | - Efficiency: 54 | 55 | 0.0.13 2019-11-14T23:09:50+09:00 56 | - Fixes: 57 | - Add missing build dependency 58 | - Additions: 59 | - Efficiency: 60 | 61 | 0.0.12 2019-11-14T22:17:47+09:00 62 | - Fixes: 63 | - Fix broken gnuplot download link [d2758] 64 | - Use CustomBuiler [d8cca] 65 | - Additions: 66 | - Efficiency: 67 | 68 | 0.0.11 2018-12-13T09:19:48+09:00 69 | - Fixes: 70 | - Fix delegation construction (tics, timestamp, title) [#39] 71 | - Additions: 72 | - Efficiency: 73 | 74 | 0.0.10 2018-12-13T08:20:16+09:00 75 | - Fixes: 76 | - Fix typo clabel -> cblabel [#38] 77 | - Additions: 78 | - Efficiency: 79 | 80 | 0.0.9 2018-12-13T08:04:14+09:00 81 | - Fixes: 82 | - Fix type constraint for tics [#36] 83 | - Use handles [#35] 84 | - Additions: 85 | - Add type constraint [#37] 86 | - Efficiency: 87 | 88 | 0.0.8 2018-12-04T22:41:01+09:00 89 | - Fixes: 90 | - Use AnyTicsTic instead of AnyTicsTics [#34] 91 | - Additions: 92 | - Efficiency: 93 | 94 | 0.0.7 2018-12-03T22:41:28+09:00 95 | - Fixes: 96 | - Use gnuplot 5.2.5 since it's 5.0.5 link is broken [#32] 97 | - Use the upstream Zef::Extract instead of an user-modified Zef::Extract [#32] 98 | - Additions: 99 | - Efficiency: 100 | 101 | 0.0.6 2018-07-23T01:31:44+09:00 102 | - Fixes: 103 | - Add --test-depends [a402011] 104 | - Additions: 105 | - Efficiency: 106 | 107 | 0.0.5 2018-07-19T22:44:12+09:00 108 | - Fixes: 109 | - Add missing num-plot increment [e613d9e] 110 | - Additions: 111 | - Efficiency: 112 | 113 | 0.0.4 2018-05-01T20:56:08+09:00 114 | - Fixes: 115 | - Add missing y2label method [#30] 116 | - Additions: 117 | - Efficiency: 118 | 119 | 0.0.3 2018-04-01T16:07:27+09:00 120 | - Fixes: 121 | - Make sure dispose correctly [#27] 122 | - Fix subset related portions of the code [#28] 123 | - Additions: 124 | - Add the user-defined subset description [#29] 125 | - Efficiency: 126 | 127 | 0.0.2 128 | - Fixes: 129 | - Use svg instead of png [#20] 130 | - Employ delegation [#21] 131 | - Fix Build.pm [#22] 132 | - Use a more practical example for synopsis [#23] 133 | - Additions: 134 | - Add aliases for pt, ps [#19] 135 | - Add smooth argument [c531dcb] 136 | - Efficiency: 137 | 138 | 0.0.1 139 | - Initial version 140 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | raku-Chart-Gnuplot -- A Raku Gnuplot bindings 2 | Copyright (C) 2017 titsuki 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | -------------------------------------------------------------------------------- /META6.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "cpan:TITSUKI", 3 | "authors": [ 4 | "Itsuki Toyota" 5 | ], 6 | "build-depends": [ 7 | "zef", 8 | "Distribution::Builder::MakeFromJSON", 9 | "Chart::Gnuplot::CustomBuilder" 10 | ], 11 | "builder": "Chart::Gnuplot::CustomBuilder", 12 | "depends": [ 13 | ], 14 | "description": "A Raku bindings for gnuplot", 15 | "license": "GPL-3.0", 16 | "name": "Chart::Gnuplot", 17 | "perl": "6.c", 18 | "provides": { 19 | "Chart::Gnuplot": "lib/Chart/Gnuplot.pm6", 20 | "Chart::Gnuplot::Arrow": "lib/Chart/Gnuplot/Arrow.pm6", 21 | "Chart::Gnuplot::Border": "lib/Chart/Gnuplot/Border.pm6", 22 | "Chart::Gnuplot::CustomBuilder": "lib/Chart/Gnuplot/CustomBuilder.pm6", 23 | "Chart::Gnuplot::Grid": "lib/Chart/Gnuplot/Grid.pm6", 24 | "Chart::Gnuplot::Label": "lib/Chart/Gnuplot/Label.pm6", 25 | "Chart::Gnuplot::Legend": "lib/Chart/Gnuplot/Legend.pm6", 26 | "Chart::Gnuplot::Object": "lib/Chart/Gnuplot/Object.pm6", 27 | "Chart::Gnuplot::Output": "lib/Chart/Gnuplot/Output.pm6", 28 | "Chart::Gnuplot::Range": "lib/Chart/Gnuplot/Range.pm6", 29 | "Chart::Gnuplot::Subset": "lib/Chart/Gnuplot/Subset.pm6", 30 | "Chart::Gnuplot::Terminal": "lib/Chart/Gnuplot/Terminal.pm6", 31 | "Chart::Gnuplot::Tics": "lib/Chart/Gnuplot/Tics.pm6", 32 | "Chart::Gnuplot::Timestamp": "lib/Chart/Gnuplot/Timestamp.pm6", 33 | "Chart::Gnuplot::Title": "lib/Chart/Gnuplot/Title.pm6", 34 | "Chart::Gnuplot::Util": "lib/Chart/Gnuplot/Util.pm6" 35 | }, 36 | "resources": [ 37 | ], 38 | "source-url": "git://github.com/titsuki/raku-Chart-Gnuplot.git", 39 | "tags": [ 40 | ], 41 | "test-depends": [ 42 | ], 43 | "version": "0.0.21" 44 | } 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Actions Status](https://github.com/titsuki/raku-Chart-Gnuplot/workflows/test/badge.svg)](https://github.com/titsuki/raku-Chart-Gnuplot/actions) 2 | 3 | NAME 4 | ==== 5 | 6 | Chart::Gnuplot - A Raku bindings for gnuplot 7 | 8 | SYNOPSIS 9 | ======== 10 | 11 | ### SOURCE 12 | 13 | use Chart::Gnuplot; 14 | use Chart::Gnuplot::Subset; 15 | my $gnu = Chart::Gnuplot.new(:terminal("png"), :filename("histogram.png")); 16 | 17 | my @data = (q:to/EOF/).split("\n", :skip-empty)>>.split(" ", :skip-empty); 18 | Year Male Female 19 | 1950 100 90 20 | 1960 100 90 21 | 1970 80 70 22 | 1980 130 140 23 | 1990 140 120 24 | 2000 200 210 25 | 2010 240 230 26 | 2020 400 420 27 | EOF 28 | 29 | my ($header, *@body) = @data; 30 | 31 | $gnu.command("set style histogram clustered"); 32 | $gnu.legend(:left); 33 | my AnyTicsTic @tics = (@body>>.[0]).pairs.map(-> (:key($pos), :value($year)) { %(:label($year), :pos($pos)) }); 34 | $gnu.xtics(:tics(@tics)); 35 | $gnu.xlabel(:label($header[0])); 36 | $gnu.plot(:vertices(@body), :using([2]), :style("histogram"), :title($header[1]), :fill("solid 1.0")); 37 | $gnu.plot(:vertices(@body), :using([3]), :style("histogram"), :title($header[2]), :fill("solid 1.0")); 38 | 39 | $gnu.dispose; 40 | 41 | ### OUTPUT 42 | 43 | histogram 44 | 45 | DESCRIPTION 46 | =========== 47 | 48 | Chart::Gnuplot is a Raku naive bindings for gnuplot. Chart::Gnuplot runs `gnuplot` using `Proc::Async` and enables you to plot chart or graph with Rakuish interface. 49 | 50 | SUBSET 51 | ------ 52 | 53 | Defined as: 54 | 55 | subset FalseOnly of Bool is export where { $_ ~~ Bool:U or $_ === False }; 56 | subset TrueOnly of Bool is export where { $_ ~~ Bool:U or $_ === True}; 57 | subset LabelRotate of Cool is export where { $_ ~~ Cool:U or $_ ~~ Real or $_ === False }; 58 | subset AnyLabelRotate of Cool is export where { $_ ~~ Cool:U or $_ eq "parallel" or $_ ~~ Real or $_ === False }; 59 | subset LegendMax of Cool is export where { $_ ~~ Cool:U or $_ eq "auto" or $_ ~~ Real }; 60 | subset AnyTicsRotate of Cool is export where { $_ ~~ Cool:U or $_ ~~ Real or $_ === False }; 61 | subset AnyTicsOffset of Mu is export where { $_ ~~ Mu:U or $_ ~~ FalseOnly or ($_ ~~ List and $_.all ~~ Pair|Real) }; 62 | subset AnyTicsTic of Mu is export where { $_ ~~ Mu:U or $_ ~~ Hash and .