rubyplot 0.0.1 → 0.1.pre.a1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +11 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +133 -0
  5. data/.travis.yml +18 -0
  6. data/CHANGELOG.md +9 -0
  7. data/CONTRIBUTING.md +48 -0
  8. data/Gemfile +6 -0
  9. data/README.md +47 -0
  10. data/Rakefile +32 -0
  11. data/ext/grruby/extconf.rb +6 -0
  12. data/ext/grruby/grruby.c +1163 -0
  13. data/ext/grruby/grruby.h +135 -0
  14. data/lib/rubyplot.rb +30 -1
  15. data/lib/rubyplot/artist.rb +13 -0
  16. data/lib/rubyplot/artist/axes.rb +328 -0
  17. data/lib/rubyplot/artist/axis.rb +3 -0
  18. data/lib/rubyplot/artist/axis/base.rb +34 -0
  19. data/lib/rubyplot/artist/axis/x_axis.rb +35 -0
  20. data/lib/rubyplot/artist/axis/y_axis.rb +40 -0
  21. data/lib/rubyplot/artist/base.rb +14 -0
  22. data/lib/rubyplot/artist/circle.rb +28 -0
  23. data/lib/rubyplot/artist/figure.rb +90 -0
  24. data/lib/rubyplot/artist/legend.rb +59 -0
  25. data/lib/rubyplot/artist/legend_box.rb +89 -0
  26. data/lib/rubyplot/artist/line2d.rb +24 -0
  27. data/lib/rubyplot/artist/plot.rb +9 -0
  28. data/lib/rubyplot/artist/plot/area.rb +38 -0
  29. data/lib/rubyplot/artist/plot/bar.rb +69 -0
  30. data/lib/rubyplot/artist/plot/bar_type.rb +31 -0
  31. data/lib/rubyplot/artist/plot/base.rb +67 -0
  32. data/lib/rubyplot/artist/plot/bubble.rb +41 -0
  33. data/lib/rubyplot/artist/plot/line.rb +61 -0
  34. data/lib/rubyplot/artist/plot/multi_bars.rb +75 -0
  35. data/lib/rubyplot/artist/plot/multi_stacked_bar.rb +78 -0
  36. data/lib/rubyplot/artist/plot/scatter.rb +29 -0
  37. data/lib/rubyplot/artist/plot/stacked_bar.rb +69 -0
  38. data/lib/rubyplot/artist/polygon.rb +21 -0
  39. data/lib/rubyplot/artist/rectangle.rb +39 -0
  40. data/lib/rubyplot/artist/text.rb +49 -0
  41. data/lib/rubyplot/artist/tick.rb +3 -0
  42. data/lib/rubyplot/artist/tick/base.rb +35 -0
  43. data/lib/rubyplot/artist/tick/x_tick.rb +25 -0
  44. data/lib/rubyplot/artist/tick/y_tick.rb +24 -0
  45. data/lib/rubyplot/backend.rb +2 -0
  46. data/lib/rubyplot/backend/gr_wrapper.rb +7 -0
  47. data/lib/rubyplot/backend/magick_wrapper.rb +141 -0
  48. data/lib/rubyplot/color.rb +992 -0
  49. data/lib/rubyplot/figure.rb +2 -0
  50. data/lib/rubyplot/spi.rb +8 -0
  51. data/lib/rubyplot/subplot.rb +4 -0
  52. data/lib/rubyplot/themes.rb +47 -0
  53. data/lib/rubyplot/utils.rb +14 -0
  54. data/lib/rubyplot/version.rb +1 -1
  55. data/rubyplot.gemspec +10 -0
  56. data/spec/axes_spec.rb +477 -0
  57. data/spec/figure_spec.rb +12 -0
  58. data/spec/spec_helper.rb +62 -0
  59. data/spec/spi/multi_plot_graph_spec.rb +33 -0
  60. data/spec/spi/single_plot_graph_spec.rb +227 -0
  61. data/spec/spi/subplots_spec.rb +55 -0
  62. metadata +166 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 639c57379a8378ca0c29f5bfa14e9620de09f7af8ad22aaa9d8a6f6771d1bcb5
4
- data.tar.gz: ef60f9f61cdc243b7fbe55d5942017f8fcaed0d872225247d69f8442bf51e369
2
+ SHA1:
3
+ metadata.gz: dc90bf33dc77100546671c64d47e09168e9996c9
4
+ data.tar.gz: c282c146249cf467301e83a27de31cd95b4e72d6
5
5
  SHA512:
6
- metadata.gz: bc620bdd01e0942a809a1d6a23a95afba41c5aa430755ffa9b8e1f5b2a589d6cdd21274761b369a341ef3ff2e04628aedec3dc1ee89a578eb0707e56dffc9a2e
7
- data.tar.gz: 0175b10174716b6f09d58d4554059728cffc9710fe9c0ea6ff6b07033178b5f8986b8f13b57324971d84692ee8499af4941219f926262aa0d3fc3319dc1647c4
6
+ metadata.gz: 63a02fdc4f793970d5bdd09eae66cc4547b43abd57a900212383d9ae9f1254cc4cfd4b90b6267486f405be2e36da73ef13c8cbb0713b952ea6fdbf1bdb0bfe38
7
+ data.tar.gz: 20c30b94e16dce5811a4087d5f5507bd4e5df71eb9739b8f3e5e35c11abffe6f91700b932ac584083b7394f37d326701c24d148b20249af5b4a6e2b3dea5fc70
data/.gitignore CHANGED
@@ -48,3 +48,14 @@ build-iPhoneSimulator/
48
48
 
49
49
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
50
  .rvmrc
51
+ spec/fixtures/
52
+ *.so
53
+ Gemfile.lock
54
+ spec/temp/
55
+ TAGS
56
+ c++
57
+ cc
58
+ g++
59
+ gcc
60
+ mpicc
61
+ mpicxx
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,133 @@
1
+ AllCops:
2
+ Include:
3
+ - 'lib/**/*'
4
+ Exclude:
5
+ - 'Rakefile'
6
+ - 'Guardfile'
7
+ - '**/*.erb'
8
+ - 'spec/*'
9
+ - 'spec/**/*'
10
+ - 'vendor/**/*'
11
+ - 'benchmarks/*'
12
+ - 'profile/*'
13
+ - 'tmp/*'
14
+ - '*.so'
15
+ DisplayCopNames: true
16
+ TargetRubyVersion: 2.2
17
+
18
+ # Preferred codebase style ---------------------------------------------
19
+ Layout/ExtraSpacing:
20
+ AllowForAlignment: true
21
+
22
+ Style/FormatString:
23
+ EnforcedStyle: percent
24
+
25
+ Style/AndOr:
26
+ EnforcedStyle: conditionals
27
+
28
+ Layout/SpaceAroundEqualsInParameterDefault:
29
+ EnforcedStyle: no_space
30
+
31
+ Layout/SpaceInsideBlockBraces:
32
+ EnforcedStyle: space
33
+
34
+ Layout/SpaceInsideHashLiteralBraces:
35
+ EnforcedStyle: no_space
36
+
37
+ Layout/AlignParameters:
38
+ EnforcedStyle: with_fixed_indentation
39
+
40
+ Style/EmptyElse:
41
+ EnforcedStyle: empty
42
+
43
+ Metrics/LineLength:
44
+ Max: 120
45
+
46
+ Metrics/ModuleLength:
47
+ Max: 200
48
+
49
+ Metrics/ClassLength:
50
+ Max: 200
51
+
52
+ Style/ParallelAssignment:
53
+ Enabled: false
54
+
55
+ Style/CommentedKeyword:
56
+ Enabled: false
57
+
58
+ Style/DoubleNegation:
59
+ Enabled: false
60
+
61
+ Style/SingleLineBlockParams:
62
+ Enabled: false
63
+
64
+ Style/PerlBackrefs:
65
+ Enabled: false
66
+
67
+ Layout/SpaceAfterComma:
68
+ Enabled: false
69
+
70
+ Layout/SpaceAroundOperators:
71
+ Enabled: false
72
+
73
+ Style/EmptyCaseCondition:
74
+ Enabled: false
75
+
76
+ Style/MultilineBlockChain:
77
+ Enabled: false
78
+
79
+ # See https://github.com/bbatsov/rubocop/issues/4429
80
+ Style/YodaCondition:
81
+ Enabled: false
82
+
83
+ Style/PercentLiteralDelimiters:
84
+ PreferredDelimiters:
85
+ '%i': '[]'
86
+ '%w': '[]'
87
+
88
+ # Neither of prefered styles are good enough :(
89
+ Style/BlockDelimiters:
90
+ Enabled: false
91
+
92
+ # Current preferred metrics --------------------------------------------
93
+ # Better values are encouraged, but not required.
94
+ Metrics/AbcSize:
95
+ Max: 20
96
+
97
+ Metrics/MethodLength:
98
+ Max: 15
99
+
100
+ Metrics/CyclomaticComplexity:
101
+ Max: 7
102
+
103
+ # TODO -----------------------------------------------------------------
104
+
105
+ Style/Documentation:
106
+ Enabled: false
107
+
108
+ # To discuss and decide ------------------------------------------------
109
+
110
+ # FIXME: in fact, rescue modifier is rarely a good choice.
111
+ # But currently I can't fully grasp the three places they are used.
112
+ # So, leaving them intact. - zverok, 2016-05-07
113
+
114
+
115
+ # FIXME: once we should enable and fix it - zverok, 2016-05-07
116
+ Style/Alias:
117
+ Enabled: false
118
+
119
+ # FIXME: should decide about this.
120
+ # Personally I prefer (as most of Ruby community) to use parens, but
121
+ # we also can enforce style to NOT using them. Yet it definitely should
122
+ # be only one style. Current codebase uses ~400 method defs without and
123
+ # ~ 100 method defs with them. - zverok, 2016-05-07
124
+ Style/MethodDefParentheses:
125
+ Enabled: false
126
+
127
+ # Should be fixed, but require change of public API --------------------
128
+
129
+ # Bans methods like `has_missing_data?`, `is_number?` and so on - started
130
+ # with unnecessary has_ or is_.
131
+
132
+
133
+
@@ -0,0 +1,18 @@
1
+ language:
2
+ ruby
3
+
4
+ rvm:
5
+ - '2.0'
6
+ - '2.1'
7
+ - '2.2'
8
+ - '2.3.0'
9
+ - '2.4.0'
10
+
11
+ script:
12
+ - bundle exec rspec
13
+ - bundle exec rubocop
14
+
15
+ install:
16
+ - gem install bundler
17
+ - gem install rainbow -v '2.2.1'
18
+ - bundle install
@@ -0,0 +1,9 @@
1
+ # 0.1-a1
2
+
3
+ Name: First alpha release.
4
+
5
+ Major updates:
6
+
7
+ * Integrate work from Arafat's magick-rubyplot into rubyplot after a full rewrite.
8
+ * Automated test suite.
9
+ * Integration with rubocop and Travis CI.
@@ -0,0 +1,48 @@
1
+ # Developer notes
2
+
3
+ ## Co-ordinate system
4
+
5
+ Rubyplot assumes that the co-ordinate system has the origin at the top left corner
6
+ of the graph. This helps in keeping all pixel co-ordinates positive values.
7
+
8
+ Each Artist contains a `(abs_x, abs_y)` pair that denotes the absolute position of the
9
+ Artist on the canvas. For `Figure` and `Axes` this pair denotes the top left corner.
10
+
11
+ The absolute co-ordinates are calculated during the draw phase. Therefore there
12
+ should be no code except in the `draw` methods where actual co-ordinates are calcualted.
13
+
14
+ Varible naming conventions:
15
+ * All values that are absolute values will be prefixed with `abs_**.
16
+ * Variables relating to positioning of the graph other than the absolute
17
+ variables are always ratios.
18
+
19
+ ## Drawing flow
20
+
21
+ When the `draw` method in `Axes` is called, the call sequence is as follows:
22
+ * Determine X and Y ranges.
23
+ * Normalize the data within these ranges.
24
+ * Assign defaults (if not assigned by user):
25
+ - Default label colors.
26
+ * Consolidate plots like bar plots into 'Multi-' plots.
27
+ * Figure out location of the Axes title.
28
+ * Figure out location of the legends.
29
+
30
+ ## Test infrastructure
31
+
32
+ Since it is quite tough to generate the exact same plot with the exact same
33
+ pixels on all systems, we perform automated testing by running the same
34
+ plotting code twice, saving the generated files of each run in separate files
35
+ then comparing them both pixel by pixel.
36
+
37
+ To make this as smooth as possible, we use the `RSpec.configure` method to define
38
+ an `after(:example)` block which will run each example twice, save the image generated
39
+ by each run to a separate file and then compare both the files.
40
+
41
+ The `after(:example)` block requires a `@figure` instance variable which it will use
42
+ for performing the plotting. A check will be performed for the `@figure` instance
43
+ variable before the example is run.
44
+
45
+ ## Artist defaults convention
46
+
47
+ Due to nature of a viz library, each Artist tends to have many instance variables
48
+ for storing various kinds of information about the Artist.
data/Gemfile CHANGED
@@ -1,2 +1,8 @@
1
1
  source 'https://rubygems.org'
2
+
2
3
  gemspec
4
+
5
+ group :test do
6
+ gem 'rake'
7
+ gem 'rspec'
8
+ end
data/README.md CHANGED
@@ -1,2 +1,49 @@
1
1
  # rubyplot
2
2
  An advanced plotting library for Ruby.
3
+
4
+ **Rubyplot aims to be the most advanced visualization solution for Rubyists.**
5
+
6
+ It aims to allow you to visualize anything, anywhere with a simple, Ruby-like API.
7
+
8
+ # Roadmap by priority
9
+ The release schedule and feature roadmap is as follows. Check issues labelled with
10
+ the version tags for knowing what we're working on currently. Listed by priority.
11
+
12
+ ## Release v0.1-a1
13
+ Deadline: 15 January 2019
14
+
15
+ * Support currently available plots fully with various customization options on Axes.
16
+ * Fully automated testing infrastructure. Travis integration with rubocop.xs
17
+
18
+ ## Release v0.1-a2
19
+ Deadline: 26 February 2019
20
+
21
+ * Integrate GR backend into existing API.
22
+ * Support multiple Axes on the same Figure.
23
+ * Support atleast 3 new kinds of plots.
24
+
25
+ ## Release v0.1-a3
26
+ Deadline: 15 April 2019
27
+
28
+ * Support atleast 3 new kinds of plots.
29
+ * Support Simple Plotting Interface.
30
+ * Move from using Ruby Arrays to a typed-array based system.
31
+
32
+ # Long term vision
33
+ Rubyplot's long term vision, by priority:
34
+
35
+ * Integrate the Rubyplot interface with the GR framework.
36
+ * Generate various types of publication quality plots.
37
+ * Interactive plotting using QT/GTK.
38
+ * Interactive or static plots for web backend.
39
+
40
+ # Release cycle
41
+
42
+ The library is currently in alpha stage. Version `0.1.0` is designated to be the
43
+ first 'final' release. Until then we will utilize various numbering schemes in the
44
+ third position of the version number to denote alpha, beta and RC releases. They
45
+ are as follows:
46
+
47
+ * `a` for `alpha`. For example `0.1-a1` is the first alpha release.
48
+ * `b` for `beta`. For example `0.1-b1` is the first beta release.
49
+ * `rc` for `RC`. For example `0.1-rc1` is the first RC release.
data/Rakefile CHANGED
@@ -0,0 +1,32 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake"
3
+
4
+ require 'bundler/setup'
5
+ require 'rubygems/tasks'
6
+ Gem::Tasks.new
7
+
8
+ require 'rspec/core/rake_task'
9
+ RSpec::Core::RakeTask.new
10
+
11
+ require 'rubocop/rake_task'
12
+ RuboCop::RakeTask.new
13
+
14
+ desc 'Default: run unit specs.'
15
+ task :default => %w[spec rubocop]
16
+
17
+ gemspec = eval(IO.read('rubyplot.gemspec'))
18
+
19
+ ext_name = 'grruby'
20
+ Rake::ExtensionTask.new(ext_name, gemspec) do |ext|
21
+ ext.ext_dir = "ext/#{ext_name}"
22
+ ext.source_pattern = '**/*.{c,h}'
23
+ end
24
+
25
+ def run(*cmd)
26
+ sh(cmd.join(' '))
27
+ end
28
+
29
+ task :pry do |_task|
30
+ cmd = ['pry', "-r './lib/rubyplot.rb' "]
31
+ run(*cmd)
32
+ end
@@ -0,0 +1,6 @@
1
+ require 'mkmf'
2
+
3
+ $CFLAGS << ' -I/usr/local/gr/include '
4
+ $LDFLAGS << ' -L/usr/local/gr/lib -lGR -lm -Wl,-rpath,/usr/local/gr/lib '
5
+
6
+ create_makefile('grruby/grruby')
@@ -0,0 +1,1163 @@
1
+ #include <ruby.h>
2
+ #include <gr.h>
3
+
4
+ double* rb_ar_2_dbl_ar(VALUE ar){
5
+ long ar_size=RARRAY_LEN(ar);
6
+ double *arc = (double *)malloc(ar_size * sizeof(double));
7
+ int i;
8
+ for (i=0; i<ar_size; i++){
9
+ arc[i] = NUM2DBL(rb_ary_entry(ar, i));
10
+ }
11
+ return arc;
12
+ }
13
+
14
+ int* rb_ar_2_int_ar(VALUE ar){
15
+ long ar_size=RARRAY_LEN(ar);
16
+ int *arc = (int *)malloc(ar_size * sizeof(int));
17
+ int i;
18
+ for (i=0; i<ar_size; i++){
19
+ arc[i] = NUM2INT(rb_ary_entry(ar, i));
20
+ }
21
+ return arc;
22
+ }
23
+
24
+ static VALUE opengks(VALUE self){
25
+ gr_opengks();
26
+ return Qtrue;
27
+ }
28
+
29
+ static VALUE closegks(VALUE self){
30
+ gr_closegks();
31
+ return Qtrue;
32
+ }
33
+
34
+ static VALUE inqdspsize(VALUE self,VALUE a,VALUE b,VALUE c,VALUE d){
35
+ double *ac = rb_ar_2_dbl_ar(a);
36
+ double *bc = rb_ar_2_dbl_ar(b);
37
+ int *cc = rb_ar_2_int_ar(c);
38
+ int *dc = rb_ar_2_int_ar(d);
39
+ gr_inqdspsize(ac,bc,cc,dc);
40
+ return Qtrue;
41
+ }
42
+
43
+ static VALUE openws(VALUE self,VALUE ws_id,VALUE connection, VALUE type){
44
+ int ws_idc=NUM2INT(ws_id);
45
+ char *connectionc=StringValueCStr(connection);
46
+ int typec=NUM2INT(type);
47
+ gr_openws(ws_idc,connectionc,typec);
48
+ return Qtrue;
49
+ }
50
+
51
+
52
+ static VALUE closews(VALUE self,VALUE ws_id){
53
+ int ws_idc=NUM2INT(ws_id);
54
+ gr_closews(ws_idc);
55
+ return Qtrue;
56
+ }
57
+
58
+ static VALUE activatews(VALUE self,VALUE ws_id){
59
+ int ws_idc=NUM2INT(ws_id);
60
+ gr_activatews(ws_idc);
61
+ return Qtrue;
62
+ }
63
+
64
+ static VALUE deactivatews(VALUE self,VALUE ws_id){
65
+ int ws_idc=NUM2INT(ws_id);
66
+ gr_deactivatews(ws_idc);
67
+ return Qtrue;
68
+ }
69
+
70
+ static VALUE clearws(VALUE self){
71
+ gr_clearws();
72
+ return Qtrue;
73
+ }
74
+
75
+ static VALUE updatews(VALUE self){
76
+ gr_updatews();
77
+ return Qtrue;
78
+ }
79
+
80
+ static VALUE polyline(VALUE self,VALUE x, VALUE y){
81
+ int x_size = RARRAY_LEN(x);
82
+ int y_size = RARRAY_LEN(y);
83
+ int size = (x_size <= y_size)?x_size:y_size;
84
+ double *xc = rb_ar_2_dbl_ar(x);
85
+ double *yc = rb_ar_2_dbl_ar(y);
86
+ gr_polyline(size,xc,yc);
87
+ return Qtrue;
88
+ }
89
+
90
+ static VALUE polymarker(VALUE self,VALUE x, VALUE y){
91
+ int x_size = RARRAY_LEN(x);
92
+ int y_size = RARRAY_LEN(y);
93
+ int size = (x_size <= y_size)?x_size:y_size;
94
+ double *xc = rb_ar_2_dbl_ar(x);
95
+ double *yc = rb_ar_2_dbl_ar(y);
96
+ gr_polymarker(size,xc,yc);
97
+ return Qtrue;
98
+
99
+ }
100
+
101
+ static VALUE text(VALUE self,VALUE x, VALUE y, VALUE string){
102
+ double xc=NUM2DBL(x);
103
+ double yc=NUM2DBL(y);
104
+ char *stringc=StringValueCStr(string);
105
+ gr_text(xc,yc,stringc);
106
+ return Qtrue;
107
+ }
108
+
109
+ static VALUE inqtext(VALUE self,VALUE a,VALUE b,VALUE c,VALUE d,VALUE e){
110
+ double ac = NUM2DBL(a);
111
+ double bc = NUM2DBL(b);
112
+ char *cc = StringValueCStr(c);
113
+ double *dc = rb_ar_2_dbl_ar(d);
114
+ double *ec = rb_ar_2_dbl_ar(e);
115
+ gr_inqtext(ac,bc,cc,dc,ec);
116
+ return Qtrue;
117
+ }
118
+
119
+ static VALUE fillarea(VALUE self,VALUE x, VALUE y){
120
+ int x_size = RARRAY_LEN(x);
121
+ int y_size = RARRAY_LEN(y);
122
+ int size = (x_size <= y_size)?x_size:y_size;
123
+ double *xc = rb_ar_2_dbl_ar(x);
124
+ double *yc = rb_ar_2_dbl_ar(y);
125
+ gr_fillarea(size,xc,yc);
126
+ return Qtrue;
127
+ }
128
+
129
+ static VALUE cellarray(VALUE self,VALUE xmin,VALUE xmax,VALUE ymin,VALUE ymax,VALUE dimx,VALUE dimy,VALUE scol,VALUE srow,VALUE ncol,VALUE nrow,VALUE color){
130
+ double xminc = NUM2DBL(xmin);
131
+ double xmaxc = NUM2DBL(xmax);
132
+ double yminc = NUM2DBL(ymin);
133
+ double ymaxc = NUM2DBL(ymax);
134
+ int dimxc = NUM2INT(dimx);
135
+ int dimyc = NUM2INT(dimy);
136
+ int scolc = NUM2INT(scol);
137
+ int srowc = NUM2INT(srow);
138
+ int ncolc = NUM2INT(ncol);
139
+ int nrowc = NUM2INT(nrow);
140
+ int *colorc = rb_ar_2_int_ar(color);
141
+ gr_cellarray(xminc,xmaxc,yminc,ymaxc,dimxc,dimyc,scolc,srowc,ncolc,nrowc,colorc);
142
+ return Qtrue;
143
+ }
144
+
145
+ static VALUE gdp(VALUE self,VALUE a,VALUE b,VALUE c,VALUE d,VALUE e,VALUE f){
146
+ int ac = NUM2INT(a);
147
+ double *bc = rb_ar_2_dbl_ar(b);
148
+ double *cc = rb_ar_2_dbl_ar(c);
149
+ int dc = NUM2INT(d);
150
+ int ec = NUM2INT(e);
151
+ int *fc = rb_ar_2_int_ar(f);
152
+ gr_gdp(ac,bc,cc,dc,ec,fc);
153
+ return Qtrue;
154
+ }
155
+
156
+ static VALUE spline(VALUE self,VALUE n,VALUE px,VALUE py,VALUE m,VALUE method){
157
+ int nc = NUM2INT(n);
158
+ double *pxc = rb_ar_2_dbl_ar(px);
159
+ double *pyc = rb_ar_2_dbl_ar(py);
160
+ int mc = NUM2INT(m);
161
+ int methodc = NUM2INT(method);
162
+ gr_spline(nc,pxc,pyc,mc,methodc);
163
+ return Qtrue;
164
+ }
165
+
166
+ static VALUE gridit(VALUE self,VALUE a,VALUE b,VALUE c,VALUE d,VALUE e,VALUE f,VALUE g,VALUE h,VALUE i){
167
+ int ac = NUM2INT(a);
168
+ double *bc = rb_ar_2_dbl_ar(b);
169
+ double *cc = rb_ar_2_dbl_ar(c);
170
+ double *dc = rb_ar_2_dbl_ar(d);
171
+ int ec = NUM2INT(e);
172
+ int fc = NUM2INT(f);
173
+ double *gc = rb_ar_2_dbl_ar(g);
174
+ double *hc = rb_ar_2_dbl_ar(h);
175
+ double *ic = rb_ar_2_dbl_ar(i);
176
+ gr_gridit(ac,bc,cc,dc,ec,fc,gc,hc,ic);
177
+ return Qtrue;
178
+ //Can be optimised for Ruby
179
+ }
180
+
181
+ static VALUE setlinetype(VALUE self,VALUE type){
182
+ int typec = NUM2INT(type);
183
+ gr_setlinetype(typec);
184
+ return Qtrue;
185
+ }
186
+
187
+ static VALUE inqlinetype(VALUE self,VALUE a){
188
+ int *ac = rb_ar_2_int_ar(a);
189
+ gr_inqlinetype(ac);
190
+ return Qtrue;
191
+ }
192
+
193
+ static VALUE setlinewidth(VALUE self,VALUE width){
194
+ double widthc = NUM2DBL(width);
195
+ gr_setlinewidth(widthc);
196
+ return Qtrue;
197
+ }
198
+
199
+ static VALUE inqlinewidth(VALUE self,VALUE a){
200
+ double *ac = rb_ar_2_dbl_ar(a);
201
+ gr_inqlinewidth(ac);
202
+ return Qtrue;
203
+ }
204
+
205
+ static VALUE setlinecolorind(VALUE self,VALUE color){
206
+ int colorc = NUM2INT(color);
207
+ gr_setlinecolorind(colorc);
208
+ return Qtrue;
209
+ }
210
+
211
+ static VALUE inqlinecolorind(VALUE self,VALUE a){
212
+ int *ac = rb_ar_2_int_ar(a);
213
+ gr_inqlinecolorind(ac);
214
+ return Qtrue;
215
+ }
216
+
217
+ static VALUE setmarkertype(VALUE self, VALUE type){
218
+ int typec = NUM2INT(type);
219
+ gr_setmarkertype(typec);
220
+ return Qtrue;
221
+ }
222
+
223
+ static VALUE inqmarkertype(VALUE self,VALUE a){
224
+ int *ac = rb_ar_2_int_ar(a);
225
+ gr_inqmarkertype(ac);
226
+ return Qtrue;
227
+ }
228
+
229
+
230
+ static VALUE setmarkersize(VALUE self, VALUE size){
231
+ double sizec = NUM2DBL(size);
232
+ gr_setmarkersize(sizec);
233
+ return Qtrue;
234
+ }
235
+
236
+ static VALUE setmarkercolorind(VALUE self,VALUE color){
237
+ double colorc = NUM2INT(color);
238
+ gr_setmarkercolorind(colorc);
239
+ return Qtrue;
240
+ }
241
+
242
+ static VALUE inqmarkercolorind(VALUE self,VALUE a){
243
+ int *ac = rb_ar_2_int_ar(a);
244
+ gr_inqmarkercolorind(ac);
245
+ return Qtrue;
246
+ }
247
+
248
+ static VALUE settextfontprec(VALUE self, VALUE font, VALUE precision){
249
+ int fontc = NUM2INT(font);
250
+ int precisionc = NUM2INT(precision);
251
+ gr_settextfontprec(fontc,precisionc);
252
+ return Qtrue;
253
+ }
254
+
255
+ static VALUE setcharexpan(VALUE self,VALUE factor){
256
+ double factorc = NUM2DBL(factor);
257
+ gr_setcharexpan(factorc);
258
+ return Qtrue;
259
+ }
260
+
261
+ static VALUE setcharspace(VALUE self,VALUE a){
262
+ double ac = NUM2DBL(a);
263
+ gr_setcharspace(ac);
264
+ return Qtrue;
265
+ }
266
+
267
+ static VALUE settextcolorind(VALUE self,VALUE color){
268
+ int colorc = NUM2INT(color);
269
+ gr_settextcolorind(colorc);
270
+ return Qtrue;
271
+ }
272
+
273
+ static VALUE setcharheight(VALUE self, VALUE height){
274
+ double heightc= NUM2DBL(height);
275
+ gr_setcharheight(heightc);
276
+ return Qtrue;
277
+ }
278
+
279
+ static VALUE setcharup(VALUE self,VALUE ux,VALUE uy){
280
+ double uxc = NUM2DBL(ux);
281
+ double uyc = NUM2DBL(uy);
282
+ gr_setcharup(uxc,uyc);
283
+ return Qtrue;
284
+ }
285
+
286
+ static VALUE settextpath(VALUE self,VALUE path){
287
+ int pathc = NUM2INT(path);
288
+ gr_settextpath(pathc);
289
+ return Qtrue;
290
+ }
291
+
292
+ static VALUE settextalign(VALUE self, VALUE horizontal, VALUE vertical){
293
+ int horizontalc=NUM2INT(horizontal);
294
+ int verticalc=NUM2INT(vertical);
295
+ gr_settextalign(horizontalc,verticalc);
296
+ return Qtrue;
297
+ }
298
+
299
+ static VALUE setfillintstyle(VALUE self,VALUE style){
300
+ int stylec = NUM2INT(style);
301
+ gr_setfillintstyle(stylec);
302
+ return Qtrue;
303
+ }
304
+
305
+ static VALUE setfillstyle(VALUE self,VALUE index){
306
+ int indexc = NUM2INT(index);
307
+ gr_setfillstyle(indexc);
308
+ return Qtrue;
309
+ }
310
+
311
+ static VALUE setfillcolorind(VALUE self,VALUE color){
312
+ int colorc = NUM2INT(color);
313
+ gr_setfillcolorind(colorc);
314
+ return Qtrue;
315
+ }
316
+
317
+ static VALUE setcolorrep(VALUE self,VALUE index,VALUE red,VALUE green,VALUE blue){
318
+ int indexc = NUM2INT(index);
319
+ double redc = NUM2DBL(red);
320
+ double greenc = NUM2DBL(green);
321
+ double bluec = NUM2DBL(blue);
322
+ gr_setcolorrep(index,red,green,blue);
323
+ return Qtrue;
324
+ }
325
+
326
+ static VALUE setwindow(VALUE self, VALUE xmin, VALUE xmax,VALUE ymin, VALUE ymax){
327
+ double xminc = NUM2DBL(xmin);
328
+ double xmaxc = NUM2DBL(xmax);
329
+ double yminc = NUM2DBL(ymin);
330
+ double ymaxc = NUM2DBL(ymax);
331
+ gr_setwindow(xminc,xmaxc,yminc,ymaxc);
332
+ return Qtrue;
333
+ }
334
+
335
+ static VALUE inqwindow(VALUE self,VALUE a,VALUE b,VALUE c,VALUE d){
336
+ double *ac = rb_ar_2_dbl_ar(a);
337
+ double *bc = rb_ar_2_dbl_ar(b);
338
+ double *cc = rb_ar_2_dbl_ar(c);
339
+ double *dc = rb_ar_2_dbl_ar(d);
340
+ gr_inqwindow(ac,bc,cc,dc);
341
+ return Qtrue;
342
+ }
343
+
344
+ static VALUE setviewport(VALUE self, VALUE xmin, VALUE xmax,VALUE ymin, VALUE ymax){
345
+ double xminc = NUM2DBL(xmin);
346
+ double xmaxc = NUM2DBL(xmax);
347
+ double yminc = NUM2DBL(ymin);
348
+ double ymaxc = NUM2DBL(ymax);
349
+ gr_setviewport(xminc,xmaxc,yminc,ymaxc);
350
+ return Qtrue;
351
+ }
352
+
353
+ static VALUE inqviewport(VALUE self,VALUE a,VALUE b,VALUE c,VALUE d){
354
+ double *ac = rb_ar_2_dbl_ar(a);
355
+ double *bc = rb_ar_2_dbl_ar(b);
356
+ double *cc = rb_ar_2_dbl_ar(c);
357
+ double *dc = rb_ar_2_dbl_ar(d);
358
+ gr_inqviewport(ac,bc,cc,dc);
359
+ return Qtrue;
360
+ }
361
+
362
+ static VALUE selntran(VALUE self,VALUE transform){
363
+ int transformc = NUM2INT(transform);
364
+ gr_selntran(transformc);
365
+ return Qtrue;
366
+ }
367
+
368
+ static VALUE setclip(VALUE self,VALUE indicator){
369
+ int indicatorc = NUM2INT(indicator);
370
+ gr_setclip(indicatorc);
371
+ return Qtrue;
372
+ }
373
+
374
+ static VALUE setwswindow(VALUE self,VALUE xmin,VALUE xmax,VALUE ymin,VALUE ymax){
375
+ double xminc = NUM2DBL(xmin);
376
+ double xmaxc = NUM2DBL(xmax);
377
+ double yminc = NUM2DBL(ymin);
378
+ double ymaxc = NUM2DBL(ymax);
379
+ gr_setwswindow(xminc,xmaxc,yminc,ymaxc);
380
+ return Qtrue;
381
+ }
382
+
383
+ static VALUE setwsviewport(VALUE self,VALUE xmin,VALUE xmax,VALUE ymin,VALUE ymax){
384
+ double xminc = NUM2DBL(xmin);
385
+ double xmaxc = NUM2DBL(xmax);
386
+ double yminc = NUM2DBL(ymin);
387
+ double ymaxc = NUM2DBL(ymax);
388
+ gr_setwsviewport(xminc,xmaxc,yminc,ymaxc);
389
+ return Qtrue;
390
+ }
391
+
392
+ static VALUE createseg(VALUE self,VALUE a){
393
+ int ac = NUM2INT(a);
394
+ gr_createseg(ac);
395
+ return Qtrue;
396
+ }
397
+
398
+ static VALUE copysegws(VALUE self,VALUE a){
399
+ int ac = NUM2INT(a);
400
+ gr_copysegws(ac);
401
+ return Qtrue;
402
+ }
403
+
404
+ static VALUE redrawsegws(VALUE self){
405
+ gr_redrawsegws();
406
+ return Qtrue;
407
+ }
408
+
409
+ static VALUE setsegtran(VALUE self,VALUE a,VALUE b,VALUE c,VALUE d,VALUE e,VALUE f,VALUE g,VALUE h){
410
+ int ac = NUM2INT(a);
411
+ double bc = NUM2DBL(b);
412
+ double cc = NUM2DBL(c);
413
+ double dc = NUM2DBL(d);
414
+ double ec = NUM2DBL(e);
415
+ double fc = NUM2DBL(f);
416
+ double gc = NUM2DBL(g);
417
+ double hc = NUM2DBL(h);
418
+ gr_setsegtran(a,b,c,d,e,f,g,h);
419
+ return Qtrue;
420
+ }
421
+
422
+ static VALUE closeseg(VALUE self){
423
+ gr_closeseg();
424
+ return Qtrue;
425
+ }
426
+
427
+ static VALUE emergencyclosegks(VALUE self){
428
+ gr_emergencyclosegks();
429
+ return Qtrue;
430
+ }
431
+
432
+ static VALUE updategks(VALUE self){
433
+ gr_updategks();
434
+ return Qtrue;
435
+ }
436
+
437
+ static VALUE setspace(VALUE self, VALUE zmin, VALUE zmax,VALUE rotation, VALUE tilt){
438
+ double zminc = NUM2DBL(zmin);
439
+ double zmaxc = NUM2DBL(zmax);
440
+ int rotationc = NUM2INT(rotation);
441
+ int tiltc = NUM2INT(tilt);
442
+ return INT2NUM(gr_setspace(zminc,zmaxc,rotationc,tiltc));
443
+ }
444
+
445
+ static VALUE inqspace(VALUE self,VALUE a,VALUE b,VALUE c,VALUE d){
446
+ double *ac = rb_ar_2_dbl_ar(a);
447
+ double *bc = rb_ar_2_dbl_ar(b);
448
+ int *cc = rb_ar_2_int_ar(c);
449
+ int *dc = rb_ar_2_int_ar(d);
450
+ gr_inqspace(ac,bc,cc,dc);
451
+ return Qtrue;
452
+ }
453
+
454
+ static VALUE setscale(VALUE self,VALUE options){
455
+ int optionsc = NUM2INT(options);
456
+ return INT2NUM(gr_setscale(optionsc));
457
+ }
458
+
459
+ static VALUE inqscale(VALUE self,VALUE a){
460
+ int *ac = rb_ar_2_int_ar(a);
461
+ gr_inqscale(ac);
462
+ return Qtrue;
463
+ }
464
+
465
+ static VALUE textext(VALUE self,VALUE x, VALUE y, VALUE string){
466
+ double xc=NUM2DBL(x);
467
+ double yc=NUM2DBL(y);
468
+ char *stringc=StringValueCStr(string);
469
+ gr_textext(xc,yc,stringc);
470
+ return Qtrue;
471
+ }
472
+
473
+ static VALUE inqtextext(VALUE self,VALUE a,VALUE b,VALUE c,VALUE d,VALUE e){
474
+ double ac = NUM2DBL(a);
475
+ double bc = NUM2DBL(b);
476
+ char *cc = StringValueCStr(c);
477
+ double *dc = rb_ar_2_dbl_ar(d);
478
+ double *ec = rb_ar_2_dbl_ar(e);
479
+ gr_inqtextext(ac,bc,cc,dc,ec);
480
+ return Qtrue;
481
+ }
482
+
483
+ static VALUE axes(VALUE self, VALUE x_tick, VALUE y_tick, VALUE x_org, VALUE y_org, VALUE major_x, VALUE major_y, VALUE tick_size){
484
+ double x_tickc=NUM2DBL(x_tick);
485
+ double y_tickc=NUM2DBL(y_tick);
486
+ double x_orgc=NUM2DBL(x_org);
487
+ double y_orgc=NUM2DBL(y_org);
488
+ int major_xc=NUM2INT(major_x);
489
+ int major_yc=NUM2INT(major_y);
490
+ double tick_sizec=NUM2DBL(tick_size);
491
+ gr_axes(x_tickc,y_tickc,x_orgc,y_orgc,major_xc,major_yc,tick_sizec);
492
+ return Qtrue;
493
+ }
494
+
495
+ /* figure this one
496
+ static VALUE axeslbl(VALUE self,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE){
497
+ return Qtrue;
498
+ }
499
+ */
500
+
501
+ static VALUE grid(VALUE self,VALUE x_tick,VALUE y_tick,VALUE x_org,VALUE y_org,VALUE major_x,VALUE major_y){
502
+ double x_tickc = NUM2DBL(x_tick);
503
+ double y_tickc = NUM2DBL(y_tick);
504
+ double x_orgc = NUM2DBL(x_org);
505
+ double y_orgc = NUM2DBL(y_org);
506
+ int major_xc=NUM2INT(major_x);
507
+ int major_yc=NUM2INT(major_y);
508
+ gr_grid(x_tickc,y_tickc,x_orgc,y_orgc,major_xc,major_yc);
509
+ return Qtrue;
510
+ }
511
+
512
+ static VALUE grid3d(VALUE self,VALUE x_tick,VALUE y_tick,VALUE z_tick,VALUE x_org,VALUE y_org,VALUE z_org,VALUE major_x,VALUE major_y,VALUE major_z){
513
+ double x_tickc = NUM2DBL(x_tick);
514
+ double y_tickc = NUM2DBL(y_tick);
515
+ double z_tickc = NUM2DBL(z_tick);
516
+ double x_orgc = NUM2DBL(x_org);
517
+ double y_orgc = NUM2DBL(y_org);
518
+ double z_orgc = NUM2DBL(z_org);
519
+ int major_xc=NUM2INT(major_x);
520
+ int major_yc=NUM2INT(major_y);
521
+ int major_zc=NUM2INT(major_z);
522
+ gr_grid3d(x_tickc,y_tickc,z_tickc,x_orgc,y_orgc,z_orgc,major_xc,major_yc,major_zc);
523
+ return Qtrue;
524
+ }
525
+
526
+ static VALUE verrorbars(VALUE self,VALUE px,VALUE py,VALUE e1,VALUE e2){
527
+ int x_size = RARRAY_LEN(px);
528
+ int y_size = RARRAY_LEN(py);
529
+ int size = (x_size <= y_size)?x_size:y_size;
530
+ double *pxc = rb_ar_2_dbl_ar(px);
531
+ double *pyc = rb_ar_2_dbl_ar(py);
532
+ double *e1c = rb_ar_2_dbl_ar(e1);
533
+ double *e2c = rb_ar_2_dbl_ar(e2);
534
+ gr_verrorbars(size,pxc,pyc,e1c,e2c);
535
+ return Qtrue;
536
+ }
537
+
538
+ static VALUE herrorbars(VALUE self,VALUE px,VALUE py,VALUE e1,VALUE e2){
539
+ int x_size = RARRAY_LEN(px);
540
+ int y_size = RARRAY_LEN(py);
541
+ int size = (x_size <= y_size)?x_size:y_size;
542
+ double *pxc = rb_ar_2_dbl_ar(px);
543
+ double *pyc = rb_ar_2_dbl_ar(py);
544
+ double *e1c = rb_ar_2_dbl_ar(e1);
545
+ double *e2c = rb_ar_2_dbl_ar(e2);
546
+ gr_herrorbars(size,pxc,pyc,e1c,e2c);
547
+ return Qtrue;
548
+ }
549
+
550
+ static VALUE polyline3d(VALUE self,VALUE px,VALUE py,VALUE pz){
551
+ int x_size = RARRAY_LEN(px);
552
+ int y_size = RARRAY_LEN(py);
553
+ int z_size = RARRAY_LEN(pz);
554
+ int size = (x_size <= y_size)?x_size:y_size;
555
+ size = (size <= z_size)?size:z_size;
556
+ double *xc = rb_ar_2_dbl_ar(px);
557
+ double *yc = rb_ar_2_dbl_ar(py);
558
+ double *zc = rb_ar_2_dbl_ar(pz);
559
+ gr_polyline3d(size,xc,yc,zc);
560
+ return Qtrue;
561
+ }
562
+
563
+ static VALUE polymarker3d(VALUE self,VALUE px,VALUE py,VALUE pz){
564
+ int x_size = RARRAY_LEN(px);
565
+ int y_size = RARRAY_LEN(py);
566
+ int z_size = RARRAY_LEN(pz);
567
+ int size = (x_size <= y_size)?x_size:y_size;
568
+ size = (size <= z_size)?size:z_size;
569
+ double *xc = rb_ar_2_dbl_ar(px);
570
+ double *yc = rb_ar_2_dbl_ar(py);
571
+ double *zc = rb_ar_2_dbl_ar(pz);
572
+ gr_polymarker3d(size,xc,yc,zc);
573
+ return Qtrue;
574
+ }
575
+
576
+ static VALUE axes3d(VALUE self,VALUE x_tick,VALUE y_tick,VALUE z_tick,VALUE x_org,VALUE y_org,VALUE z_org,VALUE major_x,VALUE major_y,VALUE major_z,VALUE tick_size){
577
+ double x_tickc = NUM2DBL(x_tick);
578
+ double y_tickc = NUM2DBL(y_tick);
579
+ double z_tickc = NUM2DBL(z_tick);
580
+ double x_orgc = NUM2DBL(x_org);
581
+ double y_orgc = NUM2DBL(y_org);
582
+ double z_orgc = NUM2DBL(z_org);
583
+ int major_xc = NUM2INT(major_x);
584
+ int major_yc = NUM2INT(major_y);
585
+ int major_zc = NUM2INT(major_z);
586
+ double tick_sizec = NUM2DBL(tick_size);
587
+ gr_axes3d(x_tickc,y_tickc,z_tickc,x_orgc,y_orgc,z_orgc,major_xc,major_yc,major_zc,tick_sizec);
588
+ return Qtrue;
589
+ }
590
+
591
+ static VALUE titles3d(VALUE self,VALUE x_title,VALUE y_title,VALUE z_title){
592
+ char *x_titlec = StringValueCStr(x_title);
593
+ char *y_titlec = StringValueCStr(y_title);
594
+ char *z_titlec = StringValueCStr(z_title);
595
+ gr_titles3d(x_titlec,y_titlec,z_titlec);
596
+ return Qtrue;
597
+ }
598
+
599
+ static VALUE surface(VALUE self,VALUE px,VALUE py,VALUE pz,VALUE option){
600
+ int nxc = RARRAY_LEN(px);
601
+ int nyc = RARRAY_LEN(py);
602
+ double *pxc = rb_ar_2_dbl_ar(px);
603
+ double *pyc = rb_ar_2_dbl_ar(py);
604
+ double *pzc = rb_ar_2_dbl_ar(pz);
605
+ int optionc = NUM2INT(option);
606
+ gr_surface(nxc,nyc,pxc,pyc,pzc,optionc);
607
+ return Qtrue;
608
+ }
609
+
610
+ static VALUE contour(VALUE self,VALUE px,VALUE py,VALUE ph,VALUE pz,VALUE major_h){
611
+ int nxc = RARRAY_LEN(px);
612
+ int nyc = RARRAY_LEN(py);
613
+ int nhc = RARRAY_LEN(ph);
614
+ double *pxc = rb_ar_2_dbl_ar(px);
615
+ double *pyc = rb_ar_2_dbl_ar(py);
616
+ double *phc = rb_ar_2_dbl_ar(ph);
617
+ double *pzc = rb_ar_2_dbl_ar(pz);
618
+ int major_hc = NUM2INT(major_h);
619
+ gr_contour(nxc,nyc,nhc,pxc,pyc,phc,pzc,major_hc);
620
+ return Qtrue;
621
+ }
622
+
623
+ static VALUE tricontour(VALUE self,VALUE npoints,VALUE x,VALUE y,VALUE z,VALUE nlevels,VALUE levels){
624
+ int npointsc = NUM2INT(npoints);
625
+ double *xc = rb_ar_2_dbl_ar(x);
626
+ double *yc = rb_ar_2_dbl_ar(y);
627
+ double *zc = rb_ar_2_dbl_ar(z);
628
+ int nlevelsc = NUM2INT(nlevels);
629
+ double *levelsc = rb_ar_2_dbl_ar(levels);
630
+ gr_tricontour(npointsc,xc,yc,zc,nlevelsc,levelsc);
631
+ return Qtrue;
632
+ }
633
+
634
+ static VALUE hexbin(VALUE self,VALUE a,VALUE b,VALUE c,VALUE d){
635
+ int ac = NUM2INT(a);
636
+ double* bc = rb_ar_2_dbl_ar(b);
637
+ double* cc = rb_ar_2_dbl_ar(c);
638
+ int dc = NUM2INT(d);
639
+ return INT2NUM(gr_hexbin(ac,bc,cc,dc));
640
+ }
641
+
642
+ static VALUE setcolormap(VALUE self,VALUE a){
643
+ int ac = NUM2INT(a);
644
+ gr_setcolormap(ac);
645
+ return Qtrue;
646
+ }
647
+
648
+ static VALUE inqcolormap(VALUE self,VALUE a){
649
+ int *ac = rb_ar_2_int_ar(a);
650
+ gr_inqcolormap(ac);
651
+ return Qtrue;
652
+ }
653
+
654
+ static VALUE colorbar(VALUE self){
655
+ gr_colorbar();
656
+ return Qtrue;
657
+ }
658
+
659
+ static VALUE inqcolor(VALUE self,VALUE a,VALUE b){
660
+ int ac = NUM2INT(a);
661
+ int *bc = rb_ar_2_int_ar(b);
662
+ gr_inqcolor(ac,bc);
663
+ return Qtrue;
664
+ }
665
+
666
+ static VALUE inqcolorfromrgb(VALUE self,VALUE a,VALUE b,VALUE c){
667
+ double ac = NUM2DBL(a);
668
+ double bc = NUM2DBL(b);
669
+ double cc = NUM2DBL(c);
670
+ return INT2NUM(gr_inqcolorfromrgb(ac,bc,cc));
671
+ }
672
+
673
+ static VALUE hsvtorgb(VALUE self,VALUE h,VALUE s,VALUE v ,VALUE r,VALUE g,VALUE b){
674
+ double hc = NUM2DBL(h);
675
+ double sc = NUM2DBL(s);
676
+ double vc = NUM2DBL(v);
677
+ double *rc = rb_ar_2_dbl_ar(r);
678
+ double *gc = rb_ar_2_dbl_ar(g);
679
+ double *bc = rb_ar_2_dbl_ar(b);
680
+ gr_hsvtorgb(hc,sc,vc,rc,gc,bc);
681
+ return Qtrue;
682
+ }
683
+
684
+ static VALUE tick(VALUE self,VALUE a,VALUE b){
685
+ double ac = NUM2DBL(a);
686
+ double bc = NUM2DBL(b);
687
+ return DBL2NUM(gr_tick(ac,bc));
688
+ }
689
+
690
+ static VALUE validaterange(VALUE self,VALUE a,VALUE b){
691
+ double ac = NUM2DBL(a);
692
+ double bc = NUM2DBL(b);
693
+ return INT2NUM(gr_validaterange(ac,bc));
694
+ }
695
+
696
+ static VALUE adjustlimits(VALUE self,VALUE a,VALUE b){
697
+ double *ac = rb_ar_2_dbl_ar(a);
698
+ double *bc = rb_ar_2_dbl_ar(b);
699
+ gr_adjustlimits(ac,bc);
700
+ return Qtrue;
701
+ }
702
+
703
+ static VALUE adjustrange(VALUE self,VALUE a,VALUE b){
704
+ double *ac = rb_ar_2_dbl_ar(a);
705
+ double *bc = rb_ar_2_dbl_ar(b);
706
+ gr_adjustrange(ac,bc);
707
+ return Qtrue;
708
+ }
709
+
710
+ static VALUE beginprint(VALUE self,VALUE pathname){
711
+ char *pathnamec = StringValueCStr(pathname);
712
+ gr_beginprint(pathnamec);
713
+ return Qtrue;
714
+ }
715
+
716
+ static VALUE beginprintext(VALUE self,VALUE pathname,VALUE mode,VALUE format,VALUE orientation){
717
+ char *pathnamec = StringValueCStr(pathname);
718
+ char *modec = StringValueCStr(mode);
719
+ char *formatc = StringValueCStr(format);
720
+ char *orientationc = StringValueCStr(orientation);
721
+ gr_beginprintext(pathnamec,modec,formatc,orientationc);
722
+ return Qtrue;
723
+ }
724
+
725
+ static VALUE endprint(VALUE self){
726
+ gr_endprint();
727
+ return Qtrue;
728
+ }
729
+
730
+ static VALUE ndctowc(VALUE self,VALUE a,VALUE b){
731
+ double *ac = rb_ar_2_dbl_ar(a);
732
+ double *bc = rb_ar_2_dbl_ar(b);
733
+ gr_ndctowc(ac,bc);
734
+ return Qtrue;
735
+ }
736
+
737
+ static VALUE wctondc(VALUE self,VALUE a,VALUE b){
738
+ double *ac = rb_ar_2_dbl_ar(a);
739
+ double *bc = rb_ar_2_dbl_ar(b);
740
+ gr_wctondc(ac,bc);
741
+ return Qtrue;
742
+ }
743
+
744
+ static VALUE wc3towc(VALUE self,VALUE a,VALUE b,VALUE c){
745
+ double *ac = rb_ar_2_dbl_ar(a);
746
+ double *bc = rb_ar_2_dbl_ar(b);
747
+ double *cc = rb_ar_2_dbl_ar(c);
748
+ gr_wc3towc(ac,bc,cc);
749
+ return Qtrue;
750
+ }
751
+
752
+ static VALUE drawrect(VALUE self,VALUE xmin,VALUE xmax,VALUE ymin,VALUE ymax){
753
+ double xminc = NUM2DBL(xmin);
754
+ double xmaxc = NUM2DBL(xmax);
755
+ double yminc = NUM2DBL(ymin);
756
+ double ymaxc = NUM2DBL(ymax);
757
+ gr_drawrect(xminc,xmaxc,yminc,ymaxc);
758
+ return Qtrue;
759
+ }
760
+
761
+ static VALUE fillrect(VALUE self,VALUE xmin,VALUE xmax,VALUE ymin,VALUE ymax){
762
+ double xminc = NUM2DBL(xmin);
763
+ double xmaxc = NUM2DBL(xmax);
764
+ double yminc = NUM2DBL(ymin);
765
+ double ymaxc = NUM2DBL(ymax);
766
+ gr_fillrect(xminc,xmaxc,yminc,ymaxc);
767
+ return Qtrue;
768
+ }
769
+
770
+ static VALUE drawarc(VALUE self,VALUE xmin,VALUE xmax,VALUE ymin,VALUE ymax,VALUE a1,VALUE a2){
771
+ double xminc = NUM2DBL(xmin);
772
+ double xmaxc = NUM2DBL(xmax);
773
+ double yminc = NUM2DBL(ymin);
774
+ double ymaxc = NUM2DBL(ymax);
775
+ int a1c = NUM2INT(a1);
776
+ int a2c = NUM2INT(a2);
777
+ gr_drawarc(xminc,xmaxc,yminc,ymaxc,a1c,a2c);
778
+ return Qtrue;
779
+ }
780
+
781
+ static VALUE fillarc(VALUE self,VALUE xmin,VALUE xmax,VALUE ymin,VALUE ymax,VALUE a1,VALUE a2){
782
+ double xminc = NUM2DBL(xmin);
783
+ double xmaxc = NUM2DBL(xmax);
784
+ double yminc = NUM2DBL(ymin);
785
+ double ymaxc = NUM2DBL(ymax);
786
+ int a1c = NUM2INT(a1);
787
+ int a2c = NUM2INT(a2);
788
+ gr_fillarc(xminc,xmaxc,yminc,ymaxc,a1c,a2c);
789
+ return Qtrue;
790
+ }
791
+
792
+ /*static VALUE drawpath(VALUE self,VALUE,VALUE,VALUE,VALUE){
793
+ gr_drawpath();
794
+ return Qtrue;
795
+ }
796
+ requires a struct do that
797
+ */
798
+
799
+ static VALUE setarrowstyle(VALUE self,VALUE style){
800
+ int stylec = NUM2INT(style);
801
+ gr_setarrowstyle(stylec);
802
+ return Qtrue;
803
+ }
804
+
805
+ static VALUE setarrowsize(VALUE self,VALUE size){
806
+ int sizec = NUM2INT(size);
807
+ gr_setarrowsize(size);
808
+ return Qtrue;
809
+ }
810
+
811
+ static VALUE drawarrow(VALUE self,VALUE x1,VALUE y1,VALUE x2,VALUE y2){
812
+ double x1c = NUM2DBL(x1);
813
+ double x2c = NUM2DBL(x2);
814
+ double y1c = NUM2DBL(y1);
815
+ double y2c = NUM2DBL(y2);
816
+ gr_drawarrow(x1c,x2c,y1c,y2c);
817
+ return Qtrue;
818
+ }
819
+
820
+ /*static VALUE readimage(VALUE self,VALUE,VALUE,VALUE,VALUE){
821
+ gr_readimage();
822
+ return Qtrue;
823
+ }
824
+ requires 2d array
825
+ */
826
+
827
+ static VALUE drawimage(VALUE self,VALUE xmin,VALUE xmax,VALUE ymin,VALUE ymax,VALUE width,VALUE height,VALUE data,VALUE model){
828
+ double xminc = NUM2DBL(xmin);
829
+ double xmaxc = NUM2DBL(xmax);
830
+ double yminc = NUM2DBL(ymin);
831
+ double ymaxc = NUM2DBL(ymax);
832
+ int widthc = NUM2INT(width);
833
+ int heightc = NUM2INT(height);
834
+ int *datac = rb_ar_2_int_ar(data);
835
+ int modelc = NUM2INT(model);
836
+ gr_drawimage(xminc,xmaxc,yminc,ymaxc,widthc,heightc,datac,modelc);
837
+ return Qtrue;
838
+ }
839
+
840
+ static VALUE importgraphics(VALUE self,VALUE a){
841
+ char *ac = StringValueCStr(a);
842
+ return INT2NUM(gr_importgraphics(ac));
843
+ }
844
+
845
+ static VALUE setshadow(VALUE self,VALUE offsetx,VALUE offsety,VALUE blur){
846
+ double offsetxc = NUM2DBL(offsetx);
847
+ double offsetyc = NUM2DBL(offsety);
848
+ double blurc = NUM2DBL(blur);
849
+ gr_setshadow(offsetxc,offsetyc,blurc);
850
+ return Qtrue;
851
+ }
852
+
853
+ static VALUE settransparency(VALUE self,VALUE alpha){
854
+ double alphac = NUM2DBL(alpha);
855
+ gr_settransparency(alphac);
856
+ return Qtrue;
857
+ }
858
+
859
+ /*static VALUE setcoordxform(VALUE self,VALUE){
860
+ gr_setcoordxform();
861
+ return Qtrue;
862
+ } 2d matrix*/
863
+
864
+ static VALUE begingraphics(VALUE self,VALUE path){
865
+ char *pathc = StringValueCStr(path);
866
+ gr_begingraphics(pathc);
867
+ return Qtrue;
868
+ }
869
+
870
+ static VALUE endgraphics(VALUE self){
871
+ gr_endgraphics();
872
+ return Qtrue;
873
+ }
874
+
875
+ static VALUE getgraphics(VALUE self){
876
+ char *ac = gr_getgraphics();
877
+ return rb_str_new2(ac);
878
+ }
879
+
880
+ static VALUE drawgraphics(VALUE self,VALUE a){
881
+ char *ac = StringValueCStr(a);
882
+ return INT2NUM(gr_drawgraphics(ac));
883
+ }
884
+
885
+ static VALUE mathtex(VALUE self,VALUE x,VALUE y,VALUE string){
886
+ double xc = NUM2DBL(x);
887
+ double yc = NUM2DBL(y);
888
+ char *stringc=StringValueCStr(string);
889
+ gr_mathtex(xc,yc,stringc);
890
+ return Qtrue;
891
+ }
892
+
893
+ static VALUE inqmathtex(VALUE self,VALUE a,VALUE b,VALUE c,VALUE d,VALUE e){
894
+ double ac = NUM2DBL(a);
895
+ double bc = NUM2DBL(b);
896
+ char *cc = StringValueCStr(c);
897
+ double *dc = rb_ar_2_dbl_ar(d);
898
+ double *ec = rb_ar_2_dbl_ar(e);
899
+ gr_inqmathtex(ac,bc,cc,dc,ec);
900
+ return Qtrue;
901
+ }
902
+
903
+ static VALUE beginselection(VALUE self,VALUE a,VALUE b){
904
+ int ac = NUM2INT(a);
905
+ int bc = NUM2INT(b);
906
+ gr_beginselection(ac,bc);
907
+ return Qtrue;
908
+ }
909
+
910
+ static VALUE endselection(VALUE self){
911
+ gr_endselection();
912
+ return Qtrue;
913
+ }
914
+
915
+ static VALUE moveselection(VALUE self,VALUE a,VALUE b){
916
+ double ac = NUM2DBL(a);
917
+ double bc = NUM2DBL(b);
918
+ gr_moveselection(ac,bc);
919
+ return Qtrue;
920
+ }
921
+
922
+ static VALUE resizeselection(VALUE self,VALUE a,VALUE b,VALUE c){
923
+ int ac = NUM2INT(a);
924
+ double bc = NUM2DBL(b);
925
+ double cc = NUM2DBL(c);
926
+ gr_resizeselection(ac,bc,cc);
927
+ return Qtrue;
928
+ }
929
+
930
+ static VALUE inqbbox(VALUE self,VALUE a,VALUE b,VALUE c,VALUE d){
931
+ double *ac = rb_ar_2_dbl_ar(a);
932
+ double *bc = rb_ar_2_dbl_ar(b);
933
+ double *cc = rb_ar_2_dbl_ar(c);
934
+ double *dc = rb_ar_2_dbl_ar(d);
935
+ gr_inqbbox(ac,bc,cc,dc);
936
+ return Qtrue;
937
+ }
938
+
939
+ static VALUE precision(VALUE self){
940
+ return DBL2NUM(gr_precision());
941
+ }
942
+
943
+ static VALUE setregenflags(VALUE self,VALUE a){
944
+ int ac = NUM2INT(a);
945
+ gr_setregenflags(ac);
946
+ return Qtrue;
947
+ }
948
+
949
+ static VALUE inqregenflags(VALUE self){
950
+ return INT2NUM(gr_inqregenflags());
951
+ }
952
+
953
+ static VALUE savestate(VALUE self){
954
+ gr_savestate();
955
+ return Qtrue;
956
+ }
957
+
958
+ static VALUE restorestate(VALUE self){
959
+ gr_restorestate();
960
+ return Qtrue;
961
+ }
962
+
963
+ static VALUE selectcontext(VALUE self,VALUE a){
964
+ int ac = NUM2INT(a);
965
+ gr_selectcontext(ac);
966
+ return Qtrue;
967
+ }
968
+
969
+ static VALUE destroycontext(VALUE self,VALUE a){
970
+ int ac = NUM2INT(a);
971
+ gr_destroycontext(ac);
972
+ return Qtrue;
973
+ }
974
+
975
+ static VALUE uselinespec(VALUE self,VALUE a){
976
+ char *ac = StringValueCStr(a);
977
+ return INT2NUM(gr_uselinespec(ac));
978
+ }
979
+
980
+ /*static VALUE delaunay(VALUE self,VALUE,VALUE,VALUE,VALUE,VALUE){
981
+ gr_delaunay();
982
+ return Qtrue;
983
+ }
984
+
985
+ static VALUE reducepoints(VALUE self,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE){
986
+ gr_reducepoints();
987
+ return Qtrue;
988
+ }
989
+ */
990
+ static VALUE trisurface(VALUE self,VALUE px,VALUE py,VALUE pz){
991
+ int x_size = RARRAY_LEN(px);
992
+ int y_size = RARRAY_LEN(py);
993
+ int z_size = RARRAY_LEN(pz);
994
+ int sizec = (x_size <= y_size)?x_size:y_size;
995
+ sizec = (sizec <= z_size)?sizec:z_size;
996
+ double *xc = rb_ar_2_dbl_ar(px);
997
+ double *yc = rb_ar_2_dbl_ar(py);
998
+ double *zc = rb_ar_2_dbl_ar(pz);
999
+ gr_trisurface(sizec,xc,yc,zc);
1000
+ return Qtrue;
1001
+ }
1002
+
1003
+ static VALUE gradient(VALUE self,VALUE a,VALUE b,VALUE c,VALUE d,VALUE e,VALUE f,VALUE g){
1004
+ int ac = NUM2INT(a);
1005
+ int bc = NUM2INT(b);
1006
+ double *cc = rb_ar_2_dbl_ar(c);
1007
+ double *dc = rb_ar_2_dbl_ar(d);
1008
+ double *ec = rb_ar_2_dbl_ar(e);
1009
+ double *fc = rb_ar_2_dbl_ar(f);
1010
+ double *gc = rb_ar_2_dbl_ar(g);
1011
+ gr_gradient(ac,bc,cc,dc,ec,fc,gc);
1012
+ return Qtrue;
1013
+ }
1014
+
1015
+ static VALUE quiver(VALUE self,VALUE a,VALUE b,VALUE c,VALUE d,VALUE e,VALUE f,VALUE g){
1016
+ int ac = NUM2INT(a);
1017
+ int bc = NUM2INT(b);
1018
+ double *cc = rb_ar_2_dbl_ar(c);
1019
+ double *dc = rb_ar_2_dbl_ar(d);
1020
+ double *ec = rb_ar_2_dbl_ar(e);
1021
+ double *fc = rb_ar_2_dbl_ar(f);
1022
+ int gc = NUM2INT(g);
1023
+ gr_quiver(ac,bc,cc,dc,ec,fc,gc);
1024
+ return Qtrue;
1025
+ }
1026
+
1027
+ static VALUE version(VALUE self){
1028
+ const char *verc=gr_version();
1029
+ return rb_str_new2(verc);
1030
+ }
1031
+
1032
+ void Init_grruby()
1033
+ {
1034
+ VALUE mRubyplot = rb_define_module("Rubyplot");
1035
+ VALUE mGRruby = rb_define_module_under("GR", mRubyplot);
1036
+ VALUE mGR3ruby = rb_define_module_under("GR3", mRubyplot);
1037
+
1038
+ rb_define_singleton_method(mGRruby,"opengks",opengks,0);
1039
+ rb_define_singleton_method(mGRruby,"closegks",closegks,0);
1040
+ rb_define_singleton_method(mGRruby,"inqdspsize",inqdspsize,4);
1041
+ rb_define_singleton_method(mGRruby,"openws",openws,3);
1042
+ rb_define_singleton_method(mGRruby,"closews",closews,1);
1043
+ rb_define_singleton_method(mGRruby,"activatews",activatews,1);
1044
+ rb_define_singleton_method(mGRruby,"deactivatews",deactivatews,1);
1045
+ rb_define_singleton_method(mGRruby,"clearws",clearws,0);
1046
+ rb_define_singleton_method(mGRruby,"updatews",updatews,0);
1047
+ rb_define_singleton_method(mGRruby,"polyline",polyline,2);
1048
+ rb_define_singleton_method(mGRruby,"polymarker",polymarker,2);
1049
+ rb_define_singleton_method(mGRruby,"text",text,3);
1050
+ rb_define_singleton_method(mGRruby,"inqtext",inqtext,5);
1051
+ rb_define_singleton_method(mGRruby,"fillarea",fillarea,2);
1052
+ rb_define_singleton_method(mGRruby,"cellarray",cellarray,11);
1053
+ rb_define_singleton_method(mGRruby,"gdp",gdp,6);
1054
+ rb_define_singleton_method(mGRruby,"spline",spline,5);
1055
+ rb_define_singleton_method(mGRruby,"gridit",gridit,9);
1056
+ rb_define_singleton_method(mGRruby,"setlinetype",setlinetype,1);
1057
+ rb_define_singleton_method(mGRruby,"inqlinetype",inqlinetype,1);
1058
+ rb_define_singleton_method(mGRruby,"setlinewidth",setlinewidth,1);
1059
+ rb_define_singleton_method(mGRruby,"inqlinewidth",inqlinewidth,1);
1060
+ rb_define_singleton_method(mGRruby,"setlinecolorind",setlinecolorind,1);
1061
+ rb_define_singleton_method(mGRruby,"inqlinecolorind",inqlinecolorind,1);
1062
+ rb_define_singleton_method(mGRruby,"setmarkertype",setmarkertype,1);
1063
+ rb_define_singleton_method(mGRruby,"inqmarkertype",inqmarkertype,1);
1064
+ rb_define_singleton_method(mGRruby,"setmarkersize",setmarkersize,1);
1065
+ rb_define_singleton_method(mGRruby,"setmarkercolorind",setmarkercolorind,1);
1066
+ rb_define_singleton_method(mGRruby,"inqmarkercolorind",inqmarkercolorind,1);
1067
+ rb_define_singleton_method(mGRruby,"settextfontprec",settextfontprec,2);
1068
+ rb_define_singleton_method(mGRruby,"setcharexpan",setcharexpan,1);
1069
+ rb_define_singleton_method(mGRruby,"setcharspace",setcharspace,1);
1070
+ rb_define_singleton_method(mGRruby,"settextcolorind",settextcolorind,1);
1071
+ rb_define_singleton_method(mGRruby,"setcharheight",setcharheight,1);
1072
+ rb_define_singleton_method(mGRruby,"setcharup",setcharup,2);
1073
+ rb_define_singleton_method(mGRruby,"settextpath",settextpath,1);
1074
+ rb_define_singleton_method(mGRruby,"settextalign",settextalign,2);
1075
+ rb_define_singleton_method(mGRruby,"setfillintstyle",setfillintstyle,1);
1076
+ rb_define_singleton_method(mGRruby,"setfillstyle",setfillstyle,1);
1077
+ rb_define_singleton_method(mGRruby,"setfillcolorind",setfillcolorind,1);
1078
+ rb_define_singleton_method(mGRruby,"setcolorrep",setcolorrep,4);
1079
+ rb_define_singleton_method(mGRruby,"setwindow",setwindow,4);
1080
+ rb_define_singleton_method(mGRruby,"inqwindow",inqwindow,4);
1081
+ rb_define_singleton_method(mGRruby,"setviewport",setviewport,4);
1082
+ rb_define_singleton_method(mGRruby,"inqviewport",inqviewport,4);
1083
+ rb_define_singleton_method(mGRruby,"selntran",selntran,1);
1084
+ rb_define_singleton_method(mGRruby,"setclip",setclip,1);
1085
+ rb_define_singleton_method(mGRruby,"setwswindow",setwswindow,4);
1086
+ rb_define_singleton_method(mGRruby,"setwsviewport",setwsviewport,4);
1087
+ rb_define_singleton_method(mGRruby,"createseg",createseg,1);
1088
+ rb_define_singleton_method(mGRruby,"copysegws",copysegws,1);
1089
+ rb_define_singleton_method(mGRruby,"redrawsegws",redrawsegws,0);
1090
+ rb_define_singleton_method(mGRruby,"setsegtran",setsegtran,8);
1091
+ rb_define_singleton_method(mGRruby,"closeseg",closeseg,0);
1092
+ rb_define_singleton_method(mGRruby,"emergencyclosegks",emergencyclosegks,0);
1093
+ rb_define_singleton_method(mGRruby,"updategks",updategks,0);
1094
+ rb_define_singleton_method(mGRruby,"setspace",setspace,4);
1095
+ rb_define_singleton_method(mGRruby,"inqspace",inqspace,4);
1096
+ rb_define_singleton_method(mGRruby,"setscale",setscale,1);
1097
+ rb_define_singleton_method(mGRruby,"inqscale",inqscale,1);
1098
+ rb_define_singleton_method(mGRruby,"textext",textext,3);
1099
+ rb_define_singleton_method(mGRruby,"inqtextext",inqtextext,5);
1100
+ rb_define_singleton_method(mGRruby,"axes",axes,7);
1101
+ rb_define_singleton_method(mGRruby,"grid",grid,6);
1102
+ rb_define_singleton_method(mGRruby,"grid3d",grid3d,9);
1103
+ rb_define_singleton_method(mGRruby,"verrorbars",verrorbars,4);
1104
+ rb_define_singleton_method(mGRruby,"herrorbars",herrorbars,4);
1105
+ rb_define_singleton_method(mGRruby,"polyline3d",polyline3d,3);
1106
+ rb_define_singleton_method(mGRruby,"polymarker3d",polymarker3d,3);
1107
+ rb_define_singleton_method(mGRruby,"axes3d",axes3d,10);
1108
+ rb_define_singleton_method(mGRruby,"titles3d",titles3d,3);
1109
+ rb_define_singleton_method(mGRruby,"surface",surface,4);
1110
+ rb_define_singleton_method(mGRruby,"contour",contour,5);
1111
+ rb_define_singleton_method(mGRruby,"tricontour",tricontour,6);
1112
+ rb_define_singleton_method(mGRruby,"hexbin",hexbin,4);
1113
+ rb_define_singleton_method(mGRruby,"setcolormap",setcolormap,1);
1114
+ rb_define_singleton_method(mGRruby,"inqcolormap",inqcolormap,1);
1115
+ rb_define_singleton_method(mGRruby,"colorbar",colorbar,0);
1116
+ rb_define_singleton_method(mGRruby,"inqcolor",inqcolor,2);
1117
+ rb_define_singleton_method(mGRruby,"inqcolorfromrgb",inqcolorfromrgb,3);
1118
+ rb_define_singleton_method(mGRruby,"hsvtorgb",hsvtorgb,6);
1119
+ rb_define_singleton_method(mGRruby,"tick",tick,2);
1120
+ rb_define_singleton_method(mGRruby,"validaterange",validaterange,2);
1121
+ rb_define_singleton_method(mGRruby,"adjustlimits",adjustlimits,2);
1122
+ rb_define_singleton_method(mGRruby,"adjustrange",adjustrange,2);
1123
+ rb_define_singleton_method(mGRruby,"beginprint",beginprint,1);
1124
+ rb_define_singleton_method(mGRruby,"beginprintext",beginprintext,4);
1125
+ rb_define_singleton_method(mGRruby,"endprint",endprint,0);
1126
+ rb_define_singleton_method(mGRruby,"ndctowc",ndctowc,2);
1127
+ rb_define_singleton_method(mGRruby,"wctondc",wctondc,2);
1128
+ rb_define_singleton_method(mGRruby,"wc3towc",wc3towc,3);
1129
+ rb_define_singleton_method(mGRruby,"drawrect",drawrect,4);
1130
+ rb_define_singleton_method(mGRruby,"fillrect",fillrect,4);
1131
+ rb_define_singleton_method(mGRruby,"drawarc",drawarc,6);
1132
+ rb_define_singleton_method(mGRruby,"fillarc",fillarc,6);
1133
+ rb_define_singleton_method(mGRruby,"setarrowstyle",setarrowstyle,1);
1134
+ rb_define_singleton_method(mGRruby,"setarrowsize",setarrowsize,1);
1135
+ rb_define_singleton_method(mGRruby,"drawarrow",drawarrow,4);
1136
+ rb_define_singleton_method(mGRruby,"drawimage",drawimage,8);
1137
+ rb_define_singleton_method(mGRruby,"importgraphics",importgraphics,1);
1138
+ rb_define_singleton_method(mGRruby,"setshadow",setshadow,3);
1139
+ rb_define_singleton_method(mGRruby,"settransparency",settransparency,1);
1140
+ rb_define_singleton_method(mGRruby,"begingraphics",begingraphics,1);
1141
+ rb_define_singleton_method(mGRruby,"endgraphics",endgraphics,0);
1142
+ rb_define_singleton_method(mGRruby,"getgraphics",getgraphics,0);
1143
+ rb_define_singleton_method(mGRruby,"drawgraphics",drawgraphics,1);
1144
+ rb_define_singleton_method(mGRruby,"mathtex",mathtex,3);
1145
+ rb_define_singleton_method(mGRruby,"inqmathtex",inqmathtex,5);
1146
+ rb_define_singleton_method(mGRruby,"beginselection",beginselection,2);
1147
+ rb_define_singleton_method(mGRruby,"endselection",endselection,0);
1148
+ rb_define_singleton_method(mGRruby,"moveselection",moveselection,2);
1149
+ rb_define_singleton_method(mGRruby,"resizeselection",resizeselection,3);
1150
+ rb_define_singleton_method(mGRruby,"inqbbox",inqbbox,4);
1151
+ rb_define_singleton_method(mGRruby,"precision",precision,0);
1152
+ rb_define_singleton_method(mGRruby,"setregenflags",setregenflags,1);
1153
+ rb_define_singleton_method(mGRruby,"inqregenflags",inqregenflags,0);
1154
+ rb_define_singleton_method(mGRruby,"savestate",savestate,0);
1155
+ rb_define_singleton_method(mGRruby,"restorestate",restorestate,0);
1156
+ rb_define_singleton_method(mGRruby,"selectcontext",selectcontext,1);
1157
+ rb_define_singleton_method(mGRruby,"destroycontext",destroycontext,1);
1158
+ rb_define_singleton_method(mGRruby,"uselinespec",uselinespec,1);
1159
+ rb_define_singleton_method(mGRruby,"trisurface",trisurface,3);
1160
+ rb_define_singleton_method(mGRruby,"gradient",gradient,7);
1161
+ rb_define_singleton_method(mGRruby,"quiver",quiver,7);
1162
+ rb_define_singleton_method(mGRruby,"version",version,0);
1163
+ }