ruby-gr 0.0.19 → 0.0.24

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07da9fb7d76476cb7598eac022e5a1b5e4004af6e0bdd0e87d1acd817f36abc7
4
- data.tar.gz: 87961c4df97b188a7c5fbd77a9e0ac993a6190ddc9e3fc2f9c30b2c7e88c19cb
3
+ metadata.gz: 54882caa13673ab79c5589d9ba8fcd02d3fef5adb0b2ad820e4aa75dc6894273
4
+ data.tar.gz: 5d57cc79475d98ac75c4fef19d3af024085774ca835978b79d878fb49873e267
5
5
  SHA512:
6
- metadata.gz: bb5d8869e80d488a5b2076eb80125136f27f18b4e352066ba1c5260b343440b7474ace25d708464c827954c1f02f47c682e83eff0b3e0a47d0374b58bc74ad09
7
- data.tar.gz: 677a4c8839974102a3d4ac618f41cd06b23e4c7d7d68f70110efb7f838c1689588fc00f8c462eabfe724c7fe7a639319bd83728d047901ddd9013bba3c3db029
6
+ metadata.gz: 5b22d5d24b5fba2fa5f806543cc513e4a4d12f7d416f7aa94b3378b7deccef5974dcaf0454afd6e0bfcb6a07322ea6fce71067c9da4eb3b7188f680e0affbf3d
7
+ data.tar.gz: 4fef6ebc51e3ff253e59017c85c8d8d9ac2a56c8000a628944603c4e3645365283a403e09dbec0a7fe654353cd8f418bcfa8fbf9e5f3cd37de11eaee2b900d3a
data/README.md CHANGED
@@ -1,48 +1,46 @@
1
1
  # GR.rb
2
2
 
3
- [![The MIT License](https://img.shields.io/badge/license-MIT-orange.svg)](LICENSE.txt)
4
- [![Build Status](https://travis-ci.org/red-data-tools/GR.rb.svg?branch=master)](https://travis-ci.org/red-data-tools/GR.rb)
5
3
  [![Gem Version](https://badge.fury.io/rb/ruby-gr.svg)](https://badge.fury.io/rb/ruby-gr)
6
4
  [![Gitter Chat](https://badges.gitter.im/red-data-tools/en.svg)](https://gitter.im/red-data-tools/en)
7
5
  [![Docs Latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://rubydoc.info/gems/ruby-gr)
8
6
 
9
- ![rdatasets-1](https://i.imgur.com/XEQ6wKs.png)
10
- ![stem](https://i.imgur.com/3w0Ejrm.png)
11
- ![histogram](https://i.imgur.com/xUdoA2s.png)
12
- ![barplot](https://i.imgur.com/52bOFKE.png)
13
- ![scatter3](https://i.imgur.com/yTTVetQ.png)
14
- ![volume](https://i.imgur.com/CuRN6oC.png)
15
- ![griddata](https://i.imgur.com/58HdYDo.png)
16
- ![2darray](https://i.imgur.com/aKR2FJG.png)
17
- ![2dpolararray](https://i.imgur.com/cmSrxvS.png)
18
- ![hexbin](https://i.imgur.com/unWhQHr.png)
19
- ![rdatasets-2](https://i.imgur.com/ZPit2F5.png)
20
- ![rdatasets-3](https://i.imgur.com/TbNoxwy.png)
21
- ![surface](https://i.imgur.com/sWdaHme.png)
22
- ![face](https://i.imgur.com/uLCKi2r.png)
23
- ![shade](https://i.imgur.com/VJmS3EQ.png)
24
-
25
- :bar_chart: [GR framework](https://github.com/sciapp/gr) - the graphics library for visualization - for Ruby
7
+ [![rdatasets-1](https://i.imgur.com/XEQ6wKs.png)](examples/rdatasets.rb)
8
+ [![stem](https://i.imgur.com/3w0Ejrm.png)](examples/fast_plots.rb)
9
+ [![histogram](https://i.imgur.com/xUdoA2s.png)](examples/fast_plots.rb)
10
+ [![barplot](https://i.imgur.com/52bOFKE.png)](examples/fast_plots.rb)
11
+ [![scatter3](https://i.imgur.com/yTTVetQ.png)](examples/fast_plots.rb)
12
+ [![volume](https://i.imgur.com/CuRN6oC.png)](examples/fast_plots.rb)
13
+ [![griddata](https://i.imgur.com/58HdYDo.png)](examples/griddata.rb)
14
+ [![2darray](https://i.imgur.com/aKR2FJG.png)](examples/2darray.rb)
15
+ [![2dpolararray](https://i.imgur.com/cmSrxvS.png)](examples/2dpolararray.rb)
16
+ [![hexbin](https://i.imgur.com/unWhQHr.png)](examples/hexbin.rb)
17
+ [![rdatasets-2](https://i.imgur.com/ZPit2F5.png)](examples/rdatasets.rb)
18
+ [![rdatasets-3](https://i.imgur.com/TbNoxwy.png)](examples/rdatasets.rb)
19
+ [![surface](https://i.imgur.com/sWdaHme.png)](examples/kws2.rb)
20
+ [![face](https://i.imgur.com/uLCKi2r.png)](examples/face.rb)
21
+ [![shade](https://i.imgur.com/VJmS3EQ.png)](examples/shade_ex.rb)
22
+
23
+ :bar_chart: [GR framework](https://github.com/sciapp/gr) - powerful visualization library - for Ruby
26
24
 
27
25
  ## Installation
28
26
 
29
- GR.rb supports Ruby 2.4+.
27
+ GR.rb supports Ruby 2.5+.
30
28
 
31
- [Install GR](#gr-installation).
32
-
33
- Set environment variable GRDIR, if you have not already done.
29
+ First, [install GR](#gr-installation). Then install `ruby-gr` gem.
34
30
 
35
31
  ```sh
36
- export GRDIR="/your/path/to/gr"
32
+ gem install ruby-gr
37
33
  ```
38
34
 
39
- Add this line to your application's Gemfile:
35
+ Note: If you are using Rubyinstaller(Windows), pacman will automatically install [mingw-w64-gr](https://packages.msys2.org/base/mingw-w64-gr).
36
+
37
+ Set environment variable `GRDIR`.
40
38
 
41
39
  ```sh
42
- gem 'ruby-gr'
40
+ export GRDIR="/your/path/to/gr"
43
41
  ```
44
42
 
45
- GR3 and GR::Plot require [numo-narray](https://github.com/ruby-numo/numo-narray).
43
+ If you use package managers to install GR, [pkg-config](https://github.com/ruby-gnome/pkg-config) may automatically detect the shared library location without specifying the `GRDIR` environment variable.
46
44
 
47
45
  ## Quick Start
48
46
 
@@ -81,15 +79,15 @@ GR.plot(
81
79
  )
82
80
  ```
83
81
 
84
- Save to PNG file.
82
+ Save in PNG format.
85
83
 
86
84
  ```ruby
87
85
  GR.savefig("figure.png")
88
86
  ```
89
87
 
90
- ## Features
88
+ ## API Overview
91
89
 
92
- There are two layers to the GR.rb API.
90
+ There are two different approaches to plotting with GR.rb. One way is to call Matlab-like APIs. The other is to call GR/GR3 native functions.
93
91
 
94
92
  #### GR::Plot - A simple, matlab-style API.
95
93
 
@@ -99,6 +97,7 @@ GR.plot(x, y)
99
97
  ```
100
98
 
101
99
  List of vailable functions. See [GR.rb Wiki](https://github.com/red-data-tools/GR.rb/wiki) for details.
100
+ Some GR module methods are overridden.
102
101
 
103
102
  [`plot`](../../wiki/Plotting-functions#plot)
104
103
  [`step`](../../wiki/Plotting-functions#step)
@@ -124,8 +123,12 @@ List of vailable functions. See [GR.rb Wiki](https://github.com/red-data-tools/G
124
123
  [`imshow`](../../wiki/Plotting-functions#imshow)
125
124
  [`isosurface`](../../wiki/Plotting-functions#isosurface)
126
125
 
126
+ We are planning to prepare a [more object-oriented interface](https://github.com/kojix2/GRUtils.rb) based on [GRUtils.jl](https://github.com/heliosdrm/GRUtils.jl) in the future.
127
+
127
128
  #### GR - A module for calling native GR functions.
128
129
 
130
+ 2-D Plots and common 3-D Plots.
131
+
129
132
  ```ruby
130
133
  require 'gr'
131
134
 
@@ -136,6 +139,8 @@ GR.setwindow(0.0, 20.0, 0.0, 20.0)
136
139
 
137
140
  #### GR3 - A module for calling native GR3 functions.
138
141
 
142
+ Complex 3D scenes.
143
+
139
144
  ```ruby
140
145
  require 'gr3'
141
146
 
@@ -143,14 +148,14 @@ require 'gr3'
143
148
  GR3.cameralookat(-3, 2, -2, 0, 0, 0, 0, 0, -1)
144
149
  ```
145
150
 
146
- * GR.rb can be used in Jupyter Notebook.
147
-
148
151
  ## Documentation
149
152
 
150
153
  - [GR.rb Wiki](https://github.com/red-data-tools/GR.rb/wiki)
151
154
  - [GR Framework](https://gr-framework.org/)
152
155
  - [GR.rb API Documentation](https://rubydoc.info/gems/ruby-gr)
153
156
 
157
+ Although GR.rb adds methods dynamically, we try our best to provide a complete yard document. However, if you want to see more up-to-date information, we recommend using the official GR reference.
158
+
154
159
  ## GR Installation
155
160
 
156
161
  ### Installing an official release (recommended)
@@ -165,28 +170,23 @@ export GRDIR="your/path/to/gr"
165
170
 
166
171
  * macOS Catalina and macOS Mojave: See the "How to open an app that hasn’t been notarized or is from an unidentified developer" section of [Safely open apps on your Mac](https://support.apple.com/en-us/HT202491) in the Apple documentation.
167
172
 
168
- ### Using your package manager
173
+ ### Using package managers
169
174
 
170
- * The third party GR packages for Mac, Linux and Windows (for advanced users) are available.
171
- * If you find problems, please report to the [issue](https://github.com/red-data-tools/GR.rb/issues).
175
+ * The third party GR packages for Mac, Linux and Windows are available (for advanced users).
176
+ * If you find any problem, please report the issue [here](https://github.com/red-data-tools/GR.rb/issues).
177
+ * Note: These packages may not have some features, for example, video output.
172
178
 
173
- #### Mac: Homebrew
179
+ #### Mac - Homebrew
174
180
 
175
181
  ```sh
176
182
  brew install libgr
177
183
  ```
178
184
 
179
- Set environment variable GRDIR.
180
-
181
- ```sh
182
- export GRDIR=$(brew --prefix libgr)
183
- ```
184
-
185
- #### Linux: APT Yum
185
+ #### Linux - APT Yum
186
186
 
187
- [packages.red-data-tools.org](https://github.com/red-data-tools/packages.red-data-tools.org) provides `libgr-dev` and `libgr3-dev`.
187
+ [packages.red-data-tools.org](https://github.com/red-data-tools/packages.red-data-tools.org) provides `libgr-dev`, `libgr3-dev` and `libgrm-dev`
188
188
 
189
- #### Windows: MSYS2
189
+ ### Windows - MSYS2
190
190
 
191
191
  If you are using Rubyinstaller, pacman will automatically install [mingw-w64-gr](https://packages.msys2.org/base/mingw-w64-gr) when the gem is installed.
192
192
 
@@ -196,13 +196,14 @@ GR.rb will be the default backend for [Charty](https://github.com/red-data-tools
196
196
 
197
197
  ## Contributing
198
198
 
199
- * Report bugs
200
- * Fix bugs and submit pull requests
199
+ * [Report bugs](https://github.com/red-data-tools/GR.rb/issues)
200
+ * Fix bugs and [submit pull requests](https://github.com/red-data-tools/GR.rb/pulls)
201
201
  * Write, clarify, or fix documentation
202
202
  * Suggest or add new features
203
- * Create visualization library based on GR.rb
203
+ * Update GR packages ( Homebrew, MinGW, red-data-tools )
204
+ * Create visualization tools based on GR.rb
204
205
 
205
206
  ## Acknowledgements
206
207
 
207
- We would like to thank Josef Heinen, the creator of [GR.jl](https://github.com/jheinen/GR.jl), Florian Rhiem, the creator of [python-gr](https://github.com/sciapp/python-gr), and [GR](https://github.com/sciapp/gr) developers.
208
+ We would like to thank Josef Heinen, the creator of [GR](https://github.com/sciapp/gr) and [GR.jl](https://github.com/jheinen/GR.jl), Florian Rhiem, the creator of [python-gr](https://github.com/sciapp/python-gr), and all [GR](https://github.com/sciapp/gr) developers.
208
209
 
data/lib/gr.rb CHANGED
@@ -36,7 +36,7 @@
36
36
  # | +--------------+ |
37
37
  # +------------------+
38
38
  #
39
- # (You can edit the above AA diagram with http://asciiflow.com/))
39
+ # (You can edit the above AA diagram with http://asciiflow.com/)
40
40
  #
41
41
  # Fiddley is Ruby-FFI compatible API layer for Fiddle.
42
42
  #
@@ -52,27 +52,20 @@ module GR
52
52
  attr_accessor :ffi_lib
53
53
  end
54
54
 
55
+ require_relative 'gr_commons/gr_commons'
56
+ extend GRCommons::SearchSharedLibrary
57
+
55
58
  # Platforms | path
56
59
  # Windows | bin/libgr.dll
57
60
  # MacOSX | lib/libGR.so (NOT .dylib)
58
61
  # Ubuntu | lib/libGR.so
59
- if Object.const_defined?(:RubyInstaller)
60
- ENV['GRDIR'] ||= [
61
- RubyInstaller::Runtime.msys2_installation.msys_path,
62
- RubyInstaller::Runtime.msys2_installation.mingwarch
63
- ].join(File::ALT_SEPARATOR)
64
- self.ffi_lib = File.expand_path('bin/libgr.dll', ENV['GRDIR'])
65
- RubyInstaller::Runtime.add_dll_directory(File.dirname(ffi_lib))
66
- else
67
- raise Error, 'Please set env variable GRDIR' unless ENV['GRDIR']
68
-
69
- self.ffi_lib = File.expand_path('lib/libGR.so', ENV['GRDIR'])
70
- end
71
-
72
- # Change the default encoding to UTF-8.
73
- ENV['GKS_ENCODING'] ||= 'utf8'
62
+ self.ffi_lib = case RbConfig::CONFIG['host_os']
63
+ when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
64
+ search_shared_library('libgr.dll', 'gr')
65
+ else
66
+ search_shared_library('libGR.so', 'gr')
67
+ end
74
68
 
75
- require_relative 'gr_commons/gr_commons'
76
69
  require_relative 'gr/version'
77
70
  require_relative 'gr/ffi'
78
71
  require_relative 'gr/grbase'
@@ -88,22 +81,21 @@ module GR
88
81
  # a Fiddley::MemoryPointer in the GRBase class.
89
82
  extend GRBase
90
83
 
91
- # Now you can see a lot of methods just calling super here.
92
- # They are written to help the yard generate the documentation.
93
84
  class << self
94
- def initgr(*)
95
- super
96
- end
85
+ # @!method initgr
97
86
 
98
- def opengks(*)
99
- super
100
- end
87
+ # @!method opengks
101
88
 
102
- def closegks(*)
103
- super
104
- end
89
+ # @!method closegks
105
90
 
106
- # inqdspsize
91
+ # Get the current display size.
92
+ #
93
+ # Depending on the current workstation type, the current display might be
94
+ # the primary screen (e.g. when using gksqt or GKSTerm) or a purely virtual
95
+ # display (e.g. when using Cairo). When a high DPI screen is used as the
96
+ # current display, width and height will be in logical pixels.
97
+ #
98
+ # @return [Array] meter_width, meter_height, width, height
107
99
  def inqdspsize
108
100
  inquiry %i[double double int int] do |*pts|
109
101
  super(*pts)
@@ -111,13 +103,12 @@ module GR
111
103
  end
112
104
 
113
105
  # Open a graphical workstation.
106
+ #
114
107
  # @param workstation_id [Integer] A workstation identifier.
115
108
  # @param connection [String] A connection identifier.
116
109
  # @param workstation_type [Integer] The desired workstation type.
117
110
  # * 5 : Workstation Independent Segment Storage
118
- # * 7, 8 : Computer Graphics Metafile (CGM binary, clear text)
119
111
  # * 41 : Windows GDI
120
- # * 51 : Mac Quickdraw
121
112
  # * 61 - 64 : PostScript (b/w, color)
122
113
  # * 101, 102 : Portable Document Format (plain, compressed)
123
114
  # * 210 - 213 : X Windows
@@ -138,70 +129,82 @@ module GR
138
129
  # * 410 : Socket driver
139
130
  # * 415 : 0MQ driver
140
131
  # * 420 : OpenGL
141
- # * 430 : HTML5 Canvas
142
- def openws(*)
143
- super
144
- end
132
+ #
133
+ # @!method openws
145
134
 
146
135
  # Close the specified workstation.
136
+ #
147
137
  # @param workstation_id [Integer] A workstation identifier.
148
- def closews(*)
149
- super
150
- end
138
+ #
139
+ # @!method closews
151
140
 
152
141
  # Activate the specified workstation.
142
+ #
153
143
  # @param workstation_id [Integer] A workstation identifier.
154
- def activatews(*)
155
- super
156
- end
144
+ #
145
+ # @!method activatews
157
146
 
158
147
  # Deactivate the specified workstation.
148
+ #
159
149
  # @param workstation_id [Integer] A workstation identifier.
160
- def deactivatews(*)
161
- super
162
- end
150
+ #
151
+ # @!method deactivatews
163
152
 
164
- def configurews(*)
165
- super
166
- end
153
+ # Configure the specified workstation.
154
+ #
155
+ # @!method configurews
167
156
 
168
- def clearws(*)
169
- super
170
- end
157
+ # Clear the specified workstation.
158
+ #
159
+ # @!method clearws
171
160
 
172
- def updatews(*)
173
- super
174
- end
161
+ # Update the specified workstation.
162
+ #
163
+ # @!method updatews
175
164
 
176
165
  # Draw a polyline using the current line attributes,
177
166
  # starting from the first data point and ending at the last data point.
167
+ #
178
168
  # @param x [Array, NArray] A list containing the X coordinates
179
169
  # @param y [Array, NArray] A list containing the Y coordinates
170
+ #
171
+ # The values for x and y are in world coordinates.
172
+ # The attributes that control the appearance of a polyline are linetype,
173
+ # linewidth and color index.
174
+ #
180
175
  def polyline(x, y)
181
176
  n = equal_length(x, y)
182
177
  super(n, x, y)
183
178
  end
184
179
 
185
180
  # Draw marker symbols centered at the given data points.
181
+ #
186
182
  # @param x [Array, NArray] A list containing the X coordinates
187
183
  # @param y [Array, NArray] A list containing the Y coordinates
184
+ #
185
+ # The values for x and y are in world coordinates.
186
+ # The attributes that control the appearance of a polymarker are marker type,
187
+ # marker size scale factor and color index.
188
+ #
188
189
  def polymarker(x, y)
189
190
  n = equal_length(x, y)
190
191
  super(n, x, y)
191
192
  end
192
193
 
193
194
  # Draw a text at position `x`, `y` using the current text attributes.
194
- # @param x [Numeric] The X coordinate of starting position of the text string
195
- # @param y [Numeric] The Y coordinate of starting position of the text string
196
- # @param string [String] The text to be drawn
195
+ #
196
+ # @param x [Numeric] The X coordinate of starting position of the text
197
+ # string
198
+ # @param y [Numeric] The Y coordinate of starting position of the text
199
+ # string
200
+ # @param string [String] The text to be drawn
197
201
  #
198
202
  # The values for `x` and `y` are in normalized device coordinates.
199
- # The attributes that control the appearance of text are text font and precision,
200
- # character expansion factor, character spacing, text color index, character
201
- # height, character up vector, text path and text alignment.
202
- def text(*)
203
- super
204
- end
203
+ # The attributes that control the appearance of text are text font and
204
+ # precision, character expansion factor, character spacing, text color index,
205
+ # character height, character up vector, text path and text alignment.
206
+ #
207
+ # @!method text
205
208
 
206
209
  def inqtext(x, y, string)
207
210
  inquiry [{ double: 4 }, { double: 4 }] do |tbx, tby|
@@ -210,11 +213,13 @@ module GR
210
213
  end
211
214
 
212
215
  # Allows you to specify a polygonal shape of an area to be filled.
216
+ #
213
217
  # @param x [Array, NArray] A list containing the X coordinates
214
218
  # @param y [Array, NArray] A list containing the Y coordinates
215
219
  #
216
- # The attributes that control the appearance of fill areas are fill area interior
217
- # style, fill area style index and fill area color index.
220
+ # The attributes that control the appearance of fill areas are fill area
221
+ # interior style, fill area style index and fill area color index.
222
+ #
218
223
  def fillarea(x, y)
219
224
  n = equal_length(x, y)
220
225
  super(n, x, y)
@@ -224,28 +229,33 @@ module GR
224
229
  # function partitions a rectangle given by two corner points into DIMX X DIMY
225
230
  # cells, each of them colored individually by the corresponding color index
226
231
  # of the given cell array.
227
- # @param xmin [Numeric] Lower left point of the rectangle
228
- # @param ymin [Numeric] Lower left point of the rectangle
229
- # @param xmax [Numeric] Upper right point of the rectangle
230
- # @param ymax [Numeric] Upper right point of the rectangle
231
- # @param dimx [Integer] X dimension of the color index array
232
- # @param dimy [Integer] Y dimension of the color index array
232
+ #
233
+ # @param xmin [Numeric] Lower left point of the rectangle
234
+ # @param ymin [Numeric] Lower left point of the rectangle
235
+ # @param xmax [Numeric] Upper right point of the rectangle
236
+ # @param ymax [Numeric] Upper right point of the rectangle
237
+ # @param dimx [Integer] X dimension of the color index array
238
+ # @param dimy [Integer] Y dimension of the color index array
233
239
  # @param color [Array, NArray] Color index array
234
240
  #
235
241
  # The values for `xmin`, `xmax`, `ymin` and `ymax` are in world coordinates.
242
+ #
236
243
  def cellarray(xmin, xmax, ymin, ymax, dimx, dimy, color)
237
244
  super(xmin, xmax, ymin, ymax, dimx, dimy, 1, 1, dimx, dimy, int(color))
238
245
  end
239
246
 
240
247
  # Display a two dimensional color index array with nonuniform cell sizes.
241
- # @param x [Array, NArray] X coordinates of the cell edges
242
- # @param y [Array, NArray] Y coordinates of the cell edges
243
- # @param dimx [Integer] X dimension of the color index array
244
- # @param dimy [Integer] Y dimension of the color index array
248
+ #
249
+ # @param x [Array, NArray] X coordinates of the cell edges
250
+ # @param y [Array, NArray] Y coordinates of the cell edges
251
+ # @param dimx [Integer] X dimension of the color index array
252
+ # @param dimy [Integer] Y dimension of the color index array
245
253
  # @param color [Array, NArray] Color index array
254
+ #
246
255
  # The values for `x` and `y` are in world coordinates. `x` must contain
247
256
  # `dimx` + 1 elements and `y` must contain `dimy` + 1 elements. The elements
248
257
  # i and i+1 are respectively the edges of the i-th cell in X and Y direction.
258
+ #
249
259
  def nonuniformcellarray(x, y, dimx, dimy, color)
250
260
  raise ArgumentError unless x.length == dimx + 1 && y.length == dimy + 1
251
261
 
@@ -254,20 +264,46 @@ module GR
254
264
 
255
265
  # Display a two dimensional color index array mapped to a disk using polar
256
266
  # coordinates.
257
- # @param xorg [Numeric] X coordinate of the disk center in world coordinates
258
- # @param yorg [Numeric] Y coordinate of the disk center in world coordinates
259
- # @param phimin [Numeric] start angle of the disk sector in degrees
260
- # @param phimax [Numeric] end angle of the disk sector in degrees
261
- # @param rmin [Numeric] inner radius of the punctured disk in world coordinates
262
- # @param rmax [Numeric] outer radius of the punctured disk in world coordinates
263
- # @param dimiphi [Integer] Phi (X) dimension of the color index array
264
- # @param dimr [Integer] iR (Y) dimension of the color index array
265
- # @param color [Array, NArray] Color index array
266
267
  #
267
268
  # The two dimensional color index array is mapped to the resulting image by
268
- # interpreting the X-axis of the array as the angle and the Y-axis as the raidus.
269
- # The center point of the resulting disk is located at `xorg`, `yorg` and the
270
- # radius of the disk is `rmax`.
269
+ # interpreting the X-axis of the array as the angle and the Y-axis as the
270
+ # raidus. The center point of the resulting disk is located at `xorg`, `yorg`
271
+ # and the radius of the disk is `rmax`.
272
+ #
273
+ # @param xorg [Numeric] X coordinate of the disk center in world
274
+ # coordinates
275
+ # @param yorg [Numeric] Y coordinate of the disk center in world
276
+ # coordinates
277
+ # @param phimin [Numeric] start angle of the disk sector in degrees
278
+ # @param phimax [Numeric] end angle of the disk sector in degrees
279
+ # @param rmin [Numeric] inner radius of the punctured disk in world
280
+ # coordinates
281
+ # @param rmax [Numeric] outer radius of the punctured disk in world
282
+ # coordinates
283
+ # @param dimiphi [Integer] Phi (X) dimension of the color index array
284
+ # @param dimr [Integer] iR (Y) dimension of the color index array
285
+ # @param color [Array, NArray] Color index array
286
+ #
287
+ # The additional parameters to the function can be used to further control
288
+ # the mapping from polar to cartesian coordinates.
289
+ #
290
+ # If `rmin` is greater than 0 the input data is mapped to a punctured disk
291
+ # (or annulus) with an inner radius of `rmin` and an outer radius `rmax`. If
292
+ # `rmin` is greater than `rmax` the Y-axis of the array is reversed.
293
+ #
294
+ # The parameter `phimin` and `phimax` can be used to map the data to a
295
+ # sector of the (punctured) disk starting at `phimin` and ending at `phimax`.
296
+ # If `phimin` is greater than `phimax` the X-axis is reversed. The visible
297
+ # sector is the one starting in mathematically positive direction
298
+ # (counterclockwise) at the smaller angle and ending at the larger angle.
299
+ # An example of the four possible options can be found below:
300
+ #
301
+ # * phimin phimax Result
302
+ # * 90 270 Left half visible, mapped counterclockwise
303
+ # * 270 90 Left half visible, mapped clockwise
304
+ # * -90 90 Right half visible, mapped counterclockwise
305
+ # * 90 -90 Right half visible, mapped clockwise
306
+ #
271
307
  def polarcellarray(x_org, y_org, phimin, phimax, rmin, rmax, dimphi, dimr, color)
272
308
  super(x_org, y_org, phimin, phimax, rmin, rmax, dimphi, dimr, 1, 1, dimphi, dimr, int(color))
273
309
  end
@@ -275,10 +311,12 @@ module GR
275
311
  # Generates a generalized drawing primitive (GDP) of the type you specify,
276
312
  # using specified points and any additional information contained in a data
277
313
  # record.
278
- # @param x [Array, NArray] A list containing the X coordinates
279
- # @param y [Array, NArray] A list containing the Y coordinates
280
- # @param primid [Integer] Primitive identifier
314
+ #
315
+ # @param x [Array, NArray] A list containing the X coordinates
316
+ # @param y [Array, NArray] A list containing the Y coordinates
317
+ # @param primid [Integer] Primitive identifier
281
318
  # @param datrec [Array, NArray] Primitive data record
319
+ #
282
320
  def gdp(x, y, primid, datrec)
283
321
  n = equal_length(x, y)
284
322
  ldr = datrec.length
@@ -287,21 +325,35 @@ module GR
287
325
 
288
326
  # Generate a cubic spline-fit,
289
327
  # starting from the first data point and ending at the last data point.
290
- # @param x [Array, NArray] A list containing the X coordinates
291
- # @param y [Array, NArray] A list containing the Y coordinates
292
- # @param m [Integer] The number of points in the polygon to be drawn (`m` > len(`x`))
293
- # @param method [Integer] The smoothing method
328
+ #
329
+ # @param x [Array, NArray] A list containing the X coordinates
330
+ # @param y [Array, NArray] A list containing the Y coordinates
331
+ # @param m [Integer] The number of points in the polygon to be
332
+ # drawn (`m` > len(`x`))
333
+ # @param method [Integer] The smoothing method
294
334
  # * If `method` is > 0, then a generalized cross-validated smoothing spline is calculated.
295
335
  # * If `method` is 0, then an interpolating natural cubic spline is calculated.
296
336
  # * If `method` is < -1, then a cubic B-spline is calculated.
337
+ #
297
338
  # The values for `x` and `y` are in world coordinates. The attributes that
298
339
  # control the appearance of a spline-fit are linetype, linewidth and color
299
340
  # index.
341
+ #
300
342
  def spline(x, y, m, method)
301
343
  n = equal_length(x, y)
302
344
  super(n, x, y, m, method)
303
345
  end
304
346
 
347
+ # Interpolate data from arbitrary points at points on a rectangular grid.
348
+ #
349
+ # @param xd [Array, NArray] X coordinates of the input points
350
+ # @param yd [Array, NArray] Y coordinates of the input points
351
+ # @param zd [Array, NArray] values of the points
352
+ # @param nx [Array, NArray] The number of points in X direction for the
353
+ # output grid
354
+ # @param ny [Array, NArray] The number of points in Y direction for the
355
+ # output grid
356
+ #
305
357
  def gridit(xd, yd, zd, nx, ny)
306
358
  nd = equal_length(xd, yd, zd)
307
359
  inquiry [{ double: nx }, { double: ny }, { double: nx * ny }] do |px, py, pz|
@@ -310,173 +362,130 @@ module GR
310
362
  end
311
363
 
312
364
  # Specify the line style for polylines.
365
+ #
313
366
  # @param style [Integer] The polyline line style
314
- # * 1 : LINETYPE_SOLID
315
- # * Solid line
316
- # * 2 : LINETYPE_DASHED
317
- # * Dashed line
318
- # * 3 : LINETYPE_DOTTED
319
- # * Dotted line
320
- # * 4 : LINETYPE_DASHED_DOTTED
321
- # * Dashed-dotted line
322
- # * -1 : LINETYPE_DASH_2_DOT
323
- # * Sequence of one dash followed by two dots
324
- # * -2 : LINETYPE_DASH_3_DOT
325
- # * Sequence of one dash followed by three dots
326
- # * -3 : LINETYPE_LONG_DASH
327
- # * Sequence of long dashes
328
- # * -4 : LINETYPE_LONG_SHORT_DASH
329
- # * Sequence of a long dash followed by a short dash
330
- # * -5 : LINETYPE_SPACED_DASH
331
- # * Sequence of dashes double spaced
332
- # * -6 : LINETYPE_SPACED_DOT
333
- # * Sequence of dots double spaced
334
- # * -7 : LINETYPE_DOUBLE_DOT
335
- # * Sequence of pairs of dots
336
- # * -8 : LINETYPE_TRIPLE_DOT
337
- # * Sequence of groups of three dots
338
- def setlinetype(*)
339
- super
340
- end
367
+ # * 1 : LINETYPE_SOLID - Solid line
368
+ # * 2 : LINETYPE_DASHED - Dashed line
369
+ # * 3 : LINETYPE_DOTTED - Dotted line
370
+ # * 4 : LINETYPE_DASHED_DOTTED - Dashed-dotted line
371
+ # * -1 : LINETYPE_DASH_2_DOT - Sequence of one dash followed by two dots
372
+ # * -2 : LINETYPE_DASH_3_DOT - Sequence of one dash followed by three dots
373
+ # * -3 : LINETYPE_LONG_DASH - Sequence of long dashes
374
+ # * -4 : LINETYPE_LONG_SHORT_DASH - Sequence of a long dash followed by a short dash
375
+ # * -5 : LINETYPE_SPACED_DASH - Sequence of dashes double spaced
376
+ # * -6 : LINETYPE_SPACED_DOT - Sequence of dots double spaced
377
+ # * -7 : LINETYPE_DOUBLE_DOT - Sequence of pairs of dots
378
+ # * -8 : LINETYPE_TRIPLE_DOT - Sequence of groups of three dots
379
+ #
380
+ # @!method setlinetype
341
381
 
342
382
  def inqlinetype
343
383
  inquiry_int { |pt| super(pt) }
344
384
  end
345
385
 
346
386
  # Define the line width of subsequent polyline output primitives.
387
+ #
388
+ # The line width is calculated as the nominal line width generated on the
389
+ # workstation multiplied by the line width scale factor. This value is mapped
390
+ # by the workstation to the nearest available line width. The default line
391
+ # width is 1.0, or 1 times the line width generated on the graphics device.
392
+ #
347
393
  # @param width [Numeric] The polyline line width scale factor
348
- # The line width is calculated as the nominal line width generated
349
- # on the workstation multiplied by the line width scale factor.
350
- # This value is mapped by the workstation to the nearest available line width.
351
- # The default line width is 1.0, or 1 times the line width generated on the graphics device.
352
- def setlinewidth(*)
353
- super
354
- end
394
+ #
395
+ # @!method setlinewidth
355
396
 
356
397
  def inqlinewidth
357
398
  inquiry_double { |pt| super(pt) }
358
399
  end
359
400
 
360
401
  # Define the color of subsequent polyline output primitives.
402
+ #
361
403
  # @param color [Integer] The polyline color index (COLOR < 1256)
362
- def setlinecolorind(*)
363
- super
364
- end
404
+ #
405
+ # @!method setlinecolorind
365
406
 
366
- # inqlinecolorind
367
407
  def inqlinecolorind
368
408
  inquiry_int { |pt| super(pt) }
369
409
  end
370
410
 
371
411
  # Specifiy the marker type for polymarkers.
412
+ #
372
413
  # @param style [Integer] The polymarker marker type
373
- # * 1 : MARKERTYPE_DOT
374
- # * Smallest displayable dot
375
- # * 2 : MARKERTYPE_PLUS
376
- # * Plus sign
377
- # * 3 : MARKERTYPE_ASTERISK
378
- # * Asterisk
379
- # * 4 : MARKERTYPE_CIRCLE
380
- # * Hollow circle
381
- # * 5 : MARKERTYPE_DIAGONAL_CROSS
382
- # * Diagonal cross
383
- # * -1 : MARKERTYPE_SOLID_CIRCLE
384
- # * Filled circle
385
- # * -2 : MARKERTYPE_TRIANGLE_UP
386
- # * Hollow triangle pointing upward
387
- # * -3 : MARKERTYPE_SOLID_TRI_UP
388
- # * Filled triangle pointing upward
389
- # * -4 : MARKERTYPE_TRIANGLE_DOWN
390
- # * Hollow triangle pointing downward
391
- # * -5 : MARKERTYPE_SOLID_TRI_DOWN
392
- # * Filled triangle pointing downward
393
- # * -6 : MARKERTYPE_SQUARE
394
- # * Hollow square
395
- # * -7 : MARKERTYPE_SOLID_SQUARE
396
- # * Filled square
397
- # * -8 : MARKERTYPE_BOWTIE
398
- # * Hollow bowtie
399
- # * -9 : MARKERTYPE_SOLID_BOWTIE
400
- # * Filled bowtie
401
- # * -10 : MARKERTYPE_HGLASS
402
- # * Hollow hourglass
403
- # * -11 : MARKERTYPE_SOLID_HGLASS
404
- # * Filled hourglass
405
- # * -12 : MARKERTYPE_DIAMOND
406
- # * Hollow diamond
407
- # * -13 : MARKERTYPE_SOLID_DIAMOND
408
- # * Filled Diamond
409
- # * -14 : MARKERTYPE_STAR
410
- # * Hollow star
411
- # * -15 : MARKERTYPE_SOLID_STAR
412
- # * Filled Star
413
- # * -16 : MARKERTYPE_TRI_UP_DOWN
414
- # * Hollow triangles pointing up and down overlaid
415
- # * -17 : MARKERTYPE_SOLID_TRI_RIGHT
416
- # * Filled triangle point right
417
- # * -18 : MARKERTYPE_SOLID_TRI_LEFT
418
- # * Filled triangle pointing left
419
- # * -19 : MARKERTYPE_HOLLOW PLUS
420
- # * Hollow plus sign
421
- # * -20 : MARKERTYPE_SOLID PLUS
422
- # * Solid plus sign
423
- # * -21 : MARKERTYPE_PENTAGON
424
- # * Pentagon
425
- # * -22 : MARKERTYPE_HEXAGON
426
- # * Hexagon
427
- # * -23 : MARKERTYPE_HEPTAGON
428
- # * Heptagon
429
- # * -24 : MARKERTYPE_OCTAGON
430
- # * Octagon
431
- # * -25 : MARKERTYPE_STAR_4
432
- # * 4-pointed star
433
- # * -26 : MARKERTYPE_STAR_5
434
- # * 5-pointed star (pentagram)
435
- # * -27 : MARKERTYPE_STAR_6
436
- # * 6-pointed star (hexagram)
437
- # * -28 : MARKERTYPE_STAR_7
438
- # * 7-pointed star (heptagram)
439
- # * -29 : MARKERTYPE_STAR_8
440
- # * 8-pointed star (octagram)
441
- # * -30 : MARKERTYPE_VLINE
442
- # * verical line
443
- # * -31 : MARKERTYPE_HLINE
444
- # * horizontal line
445
- # * -32 : MARKERTYPE_OMARK
446
- # * o-mark
414
+ # * 1 : MARKERTYPE_DOT - Smallest displayable dot
415
+ # * 2 : MARKERTYPE_PLUS - Plus sign
416
+ # * 3 : MARKERTYPE_ASTERISK - Asterisk
417
+ # * 4 : MARKERTYPE_CIRCLE - Hollow circle
418
+ # * 5 : MARKERTYPE_DIAGONAL_CROSS - Diagonal cross
419
+ # * -1 : MARKERTYPE_SOLID_CIRCLE - Filled circle
420
+ # * -2 : MARKERTYPE_TRIANGLE_UP - Hollow triangle pointing upward
421
+ # * -3 : MARKERTYPE_SOLID_TRI_UP - Filled triangle pointing upward
422
+ # * -4 : MARKERTYPE_TRIANGLE_DOWN - Hollow triangle pointing downward
423
+ # * -5 : MARKERTYPE_SOLID_TRI_DOWN - Filled triangle pointing downward
424
+ # * -6 : MARKERTYPE_SQUARE - Hollow square
425
+ # * -7 : MARKERTYPE_SOLID_SQUARE - Filled square
426
+ # * -8 : MARKERTYPE_BOWTIE - Hollow bowtie
427
+ # * -9 : MARKERTYPE_SOLID_BOWTIE - Filled bowtie
428
+ # * -10 : MARKERTYPE_HGLASS - Hollow hourglass
429
+ # * -11 : MARKERTYPE_SOLID_HGLASS - Filled hourglass
430
+ # * -12 : MARKERTYPE_DIAMOND - Hollow diamond
431
+ # * -13 : MARKERTYPE_SOLID_DIAMOND - Filled Diamond
432
+ # * -14 : MARKERTYPE_STAR - Hollow star
433
+ # * -15 : MARKERTYPE_SOLID_STAR - Filled Star
434
+ # * -16 : MARKERTYPE_TRI_UP_DOWN - Hollow triangles pointing up and down overlaid
435
+ # * -17 : MARKERTYPE_SOLID_TRI_RIGHT - Filled triangle point right
436
+ # * -18 : MARKERTYPE_SOLID_TRI_LEFT - Filled triangle pointing left
437
+ # * -19 : MARKERTYPE_HOLLOW PLUS - Hollow plus sign
438
+ # * -20 : MARKERTYPE_SOLID PLUS - Solid plus sign
439
+ # * -21 : MARKERTYPE_PENTAGON - Pentagon
440
+ # * -22 : MARKERTYPE_HEXAGON - Hexagon
441
+ # * -23 : MARKERTYPE_HEPTAGON - Heptagon
442
+ # * -24 : MARKERTYPE_OCTAGON - Octagon
443
+ # * -25 : MARKERTYPE_STAR_4 - 4-pointed star
444
+ # * -26 : MARKERTYPE_STAR_5 - 5-pointed star (pentagram)
445
+ # * -27 : MARKERTYPE_STAR_6 - 6-pointed star (hexagram)
446
+ # * -28 : MARKERTYPE_STAR_7 - 7-pointed star (heptagram)
447
+ # * -29 : MARKERTYPE_STAR_8 - 8-pointed star (octagram)
448
+ # * -30 : MARKERTYPE_VLINE - verical line
449
+ # * -31 : MARKERTYPE_HLINE - horizontal line
450
+ # * -32 : MARKERTYPE_OMARK - o-mark
451
+ #
447
452
  # Polymarkers appear centered over their specified coordinates.
448
- def setmarkertype(*)
449
- super
450
- end
453
+ #
454
+ # @!method setmarkertype
451
455
 
452
456
  def inqmarkertype
453
457
  inquiry_int { |pt| super(pt) }
454
458
  end
455
459
 
456
460
  # Specify the marker size for polymarkers.
461
+ #
462
+ # The polymarker size is calculated as the nominal size generated on the
463
+ # graphics device multiplied by the marker size scale factor.
464
+ #
457
465
  # @param size [Numeric] Scale factor applied to the nominal marker size
458
- # The polymarker size is calculated as the nominal size generated on the graphics device
459
- # multiplied by the marker size scale factor.
460
- def setmarkersize(*)
461
- super
462
- end
466
+ #
467
+ # @!method setmarkersize
463
468
 
464
469
  # Inquire the marker size for polymarkers.
470
+ #
471
+ # @return [Numeric] Scale factor applied to the nominal marker size
472
+ #
465
473
  def inqmarkersize
466
474
  inquiry_double { |pt| super(pt) }
467
475
  end
468
476
 
469
477
  # Define the color of subsequent polymarker output primitives.
478
+ #
470
479
  # @param color [Integer] The polymarker color index (COLOR < 1256)
471
- def setmarkercolorind(*)
472
- super
473
- end
480
+ #
481
+ # @!method setmarkercolorind
474
482
 
475
483
  def inqmarkercolorind
476
484
  inquiry_int { |pt| super(pt) }
477
485
  end
478
486
 
479
487
  # Specify the text font and precision for subsequent text output primitives.
488
+ #
480
489
  # @param font [Integer] Text font
481
490
  # * 101 : FONT_TIMES_ROMAN
482
491
  # * 102 : FONT_TIMES_ITALIC
@@ -509,185 +518,217 @@ module GR
509
518
  # * 129 : FONT_PALATINO_BOLDITALIC
510
519
  # * 130 : FONT_ZAPFCHANCERY_MEDIUMITALIC
511
520
  # * 131 : FONT_ZAPFDINGBATS
521
+ # * 232 : FONT_COMPUTERMODERN
522
+ # * 233 : FONT_DEJAVUSANS
523
+ #
512
524
  # @param precision [Integer] Text precision
513
- # * 0 : TEXT_PRECISION_STRING
514
- # * String precision (higher quality)
515
- # * 1 : TEXT_PRECISION_CHAR
516
- # * Character precision (medium quality)
517
- # * 2 : TEXT_PRECISION_STROKE
518
- # * Stroke precision (lower quality)
525
+ # * 0 : TEXT_PRECISION_STRING - String precision (higher quality)
526
+ # * 1 : TEXT_PRECISION_CHAR - Character precision (medium quality)
527
+ # * 2 : TEXT_PRECISION_STROKE - Stroke precision (lower quality)
528
+ # * 3 : TEXT_PRECISION_OUTLINE - Outline precision (highest quality)
529
+ #
519
530
  # The appearance of a font depends on the text precision value specified.
520
531
  # STRING, CHARACTER or STROKE precision allows for a greater or lesser
521
532
  # realization of the text primitives, for efficiency. STRING is the default
522
- # precision for GR and produces the highest quality output.
523
- def settextfontprec(*)
524
- super
525
- end
533
+ # precision for GR and produces the highest quality output using either
534
+ # native font rendering or FreeType. OUTLINE uses the GR path rendering
535
+ # functions to draw individual glyphs and produces the highest quality output.
536
+ #
537
+ # @!method settextfontprec
526
538
 
527
539
  # Set the current character expansion factor (width to height ratio).
528
- # @param factor [Numeric] Text expansion factor applied to the nominal text width-to-height ratio
529
- # `setcharexpan` defines the width of subsequent text output primitives. The expansion
530
- # factor alters the width of the generated characters, but not their height. The default
531
- # text expansion factor is 1, or one times the normal width-to-height ratio of the text.
532
- def setcharexpan(*)
533
- super
534
- end
540
+ #
541
+ # `setcharexpan` defines the width of subsequent text output primitives.
542
+ # The expansion factor alters the width of the generated characters, but not
543
+ # their height. The default text expansion factor is 1, or one times the
544
+ # normal width-to-height ratio of the text.
545
+ #
546
+ # @param factor [Numeric] Text expansion factor applied to the nominal text
547
+ # width-to-height ratio
548
+ #
549
+ # @!method setcharexpan
535
550
 
536
- def setcharspace(*)
537
- super
538
- end
551
+ # @!method setcharspace
539
552
 
540
553
  # Sets the current text color index.
541
- # @param color [Integer] The text color index (COLOR < 1256)
554
+ #
542
555
  # `settextcolorind` defines the color of subsequent text output primitives.
543
- # GR uses the default foreground color (black=1) for the default text color index.
544
- def settextcolorind(*)
545
- super
546
- end
556
+ # GR uses the default foreground color (black=1) for the default text color
557
+ # index.
558
+ #
559
+ # @param color [Integer] The text color index (COLOR < 1256)
560
+ #
561
+ # @!method settextcolorind
547
562
 
548
563
  # Gets the current text color index.
564
+ #
549
565
  # This function gets the color of text output primitives.
566
+ #
550
567
  # @return [Integer] color The text color index (COLOR < 1256)
551
568
  def inqtextcolorind
552
569
  inquiry_int { |pt| super(pt) }
553
570
  end
554
571
 
555
572
  # Set the current character height.
573
+ #
574
+ # `setcharheight` defines the height of subsequent text output primitives.
575
+ # Text height is defined as a percentage of the default window. GR uses the
576
+ # default text height of 0.027 (2.7% of the height of the default window).
577
+ #
556
578
  # @param height [Numeric] Text height value
557
- # `setcharheight` defines the height of subsequent text output primitives. Text height
558
- # is defined as a percentage of the default window. GR uses the default text height of
559
- # 0.027 (2.7% of the height of the default window).
560
- def setcharheight(*)
561
- super
579
+ #
580
+ # @!method setcharheight
581
+
582
+ # Gets the current character height.
583
+ #
584
+ # This function gets the height of text output primitives. Text height is
585
+ # defined as a percentage of the default window. GR uses the default text
586
+ # height of 0.027 (2.7% of the height of the default window).
587
+ #
588
+ # @return [Numeric] Text height value
589
+ def inqcharheight
590
+ inquiry_double { |pt| super(pt) }
562
591
  end
563
592
 
564
593
  # Set the current character text angle up vector.
565
- # @param ux [Numeric] Text up vector
566
- # @param uy [Numeric] Text up vector
567
- # `setcharup` defines the vertical rotation of subsequent text output primitives.
568
- # The text up vector is initially set to (0, 1), horizontal to the baseline.
569
- def setcharup(*)
570
- super
571
- end
594
+ #
595
+ # `setcharup` defines the vertical rotation of subsequent text output
596
+ # primitives. The text up vector is initially set to (0, 1), horizontal to
597
+ # the baseline.
598
+ #
599
+ # @param ux [Numeric] X coordinate of the text up vector
600
+ # @param uy [Numeric] Y coordinate of the text up vector
601
+ #
602
+ # @!method setcharup
572
603
 
573
604
  # Define the current direction in which subsequent text will be drawn.
605
+ #
574
606
  # @param path [Integer] Text path
575
- # * 0 : TEXT_PATH_RIGHT
576
- # * left-to-right
577
- # * 1 : TEXT_PATH_LEFT
578
- # * right-to-left
579
- # * 2 : TEXT_PATH_UP
580
- # * downside-up
581
- # * 3 : TEXT_PATH_DOWN
582
- # * upside-down
583
- def settextpath(*)
584
- super
585
- end
607
+ # * 0 : TEXT_PATH_RIGHT - left-to-right
608
+ # * 1 : TEXT_PATH_LEFT - right-to-left
609
+ # * 2 : TEXT_PATH_UP - downside-up
610
+ # * 3 : TEXT_PATH_DOWN - upside-down
611
+ #
612
+ # @!method settextpath
586
613
 
587
614
  # Set the current horizontal and vertical alignment for text.
615
+ #
588
616
  # @param horizontal [Integer] Horizontal text alignment
589
- # * 0 : TEXT_HALIGN_NORMAL
590
- # * 1 : TEXT_HALIGN_LEFT
591
- # * Left justify
592
- # * 2 : TEXT_HALIGN_CENTER
593
- # * Center justify
594
- # * 3 : TEXT_HALIGN_RIGHT
595
- # * Right justify
617
+ # * 0 : TEXT_HALIGN_NORMALlygon using the fill color index
618
+
619
+ # * 1 : TEXT_HALIGN_LEFT - Left justify
620
+ # * 2 : TEXT_HALIGN_CENTER - Center justify
621
+ # * 3 : TEXT_HALIGN_RIGHT - Right justify
622
+ #
596
623
  # @param vertical [Integer] Vertical text alignment
597
624
  # * 0 : TEXT_VALIGN_NORMAL  
598
- # * 1 : TEXT_VALIGN_TOP
599
- # * Align with the top of the characters
600
- # * 2 : TEXT_VALIGN_CAP
601
- # * Aligned with the cap of the characters
602
- # * 3 : TEXT_VALIGN_HALF
603
- # * Aligned with the half line of the characters
604
- # * 4 : TEXT_VALIGN_BASE
605
- # * Aligned with the base line of the characters
606
- # * 5 : TEXT_VALIGN_BOTTOM
607
- # * Aligned with the bottom line of the characters
608
- # `settextalign` specifies how the characters in a text primitive will be aligned
609
- # in horizontal and vertical space. The default text alignment indicates horizontal left
610
- # alignment and vertical baseline alignment.
611
- def settextalign(*)
612
- super
613
- end
625
+ # * 1 : TEXT_VALIGN_TOP - Align with the top of the characters
626
+ # * 2 : TEXT_VALIGN_CAP - Aligned with the cap of the characters
627
+ # * 3 : TEXT_VALIGN_HALF - Aligned with the half line of the characters
628
+ # * 4 : TEXT_VALIGN_BASE - Aligned with the base line of the characters
629
+ # * 5 : TEXT_VALIGN_BOTTOM - Aligned with the bottom line of the characters
630
+ #
631
+ # `settextalign` specifies how the characters in a text primitive will be
632
+ # aligned in horizontal and vertical space. The default text alignment
633
+ # indicates horizontal left alignment and vertical baseline alignment.
634
+ #
635
+ # @!method settextalign
614
636
 
615
637
  # Set the fill area interior style to be used for fill areas.
638
+ #
616
639
  # @param style [Integer] The style of fill to be used
617
- # * 0 : HOLLOW
618
- # * No filling. Just draw the bounding polyline
619
- # * 1 : SOLID
620
- # * Fill the interior of the polygon using the fill color index
621
- # * 2 : PATTERN
622
- # * Fill the interior of the polygon using the style index as a pattern index
623
- # * 3 : HATCH
624
- # * Fill the interior of the polygon using the style index as a cross-hatched style
640
+ # * 0 : HOLLOW - No filling. Just draw the bounding polyline
641
+ # * 1 : SOLID - Fill the interior of the polygon using the fill color index
642
+ # * 2 : PATTERN - Fill the interior of the polygon using the style index as a pattern index
643
+ # * 3 : HATCH - Fill the interior of the polygon using the style index as a cross-hatched style
644
+ # * 4 : SOLID_WITH_BORDER - Fill the interior of the polygon using the fill color index and draw the bounding polyline
645
+ #
625
646
  # `setfillintstyle` defines the interior style for subsequent fill area output
626
647
  # primitives. The default interior style is HOLLOW.
627
- def setfillintstyle(*)
628
- super
629
- end
648
+ #
649
+ # @!method setfillintstyle
630
650
 
631
651
  # Returns the fill area interior style to be used for fill areas.
652
+ #
653
+ # This function gets the currently set fill style.
654
+ #
655
+ # @return [Integer] The currently set fill style
632
656
  def inqfillintstyle
633
657
  inquiry_int { |pt| super(pt) }
634
658
  end
635
659
 
636
660
  # Sets the fill style to be used for subsequent fill areas.
661
+ #
662
+ # `setfillstyle` specifies an index when PATTERN fill or HATCH fill is
663
+ # requested by the`setfillintstyle` function. If the interior style is set
664
+ # to PATTERN, the fill style index points to a device-independent pattern
665
+ # table. If interior style is set to HATCH the fill style index indicates
666
+ # different hatch styles. If HOLLOW or SOLID is specified for the interior
667
+ # style, the fill style index is unused.
668
+ #
637
669
  # @param index [Integer] The fill style index to be used
638
- # `setfillstyle` specifies an index when PATTERN fill or HATCH fill is requested by the
639
- # `setfillintstyle` function. If the interior style is set to PATTERN, the fill style
640
- # index points to a device-independent pattern table. If interior style is set to HATCH
641
- # the fill style index indicates different hatch styles. If HOLLOW or SOLID is specified
642
- # for the interior style, the fill style index is unused.
643
- def setfillstyle(*)
644
- super
645
- end
670
+ #
671
+ # @!method setfillstyle
646
672
 
647
673
  # Returns the current fill area color index.
674
+ #
675
+ # This function gets the color index for PATTERN and HATCH fills.
676
+ #
677
+ # @return [Integer] The currently set fill style color index
648
678
  def inqfillstyle
649
679
  inquiry_int { |pt| super(pt) }
650
680
  end
651
681
 
652
682
  # Sets the current fill area color index.
683
+ #
684
+ # `setfillcolorind` defines the color of subsequent fill area output
685
+ # primitives. GR uses the default foreground color (black=1) for the default
686
+ # fill area color index.
687
+ #
653
688
  # @param color [Integer] The text color index (COLOR < 1256)
654
- # `setfillcolorind` defines the color of subsequent fill area output primitives.
655
- # GR uses the default foreground color (black=1) for the default fill area color index.
656
- def setfillcolorind(*)
657
- super
658
- end
689
+ #
690
+ # @!method setfillcolorind
659
691
 
660
692
  # Returns the current fill area color index.
693
+ #
694
+ # This function gets the color of fill area output primitives.
695
+ #
696
+ # @return [Integer] The text color index (COLOR < 1256)
661
697
  def inqfillcolorind
662
698
  inquiry_int { |pt| super(pt) }
663
699
  end
664
700
 
665
- # `setcolorrep` allows to redefine an existing color index representation by specifying
666
- # an RGB color triplet.
701
+ # Redefine an existing color index representation by specifying an RGB color
702
+ # triplet.
703
+ #
667
704
  # @param index [Integer] Color index in the range 0 to 1256
668
- # @param red [Numeric] Red intensity in the range 0.0 to 1.0
705
+ # @param red [Numeric] Red intensity in the range 0.0 to 1.0
669
706
  # @param green [Numeric] Green intensity in the range 0.0 to 1.0
670
- # @param blue [Numeric] Blue intensity in the range 0.0 to 1.0
671
- def setcolorrep(*)
672
- super
673
- end
707
+ # @param blue [Numeric] Blue intensity in the range 0.0 to 1.0
708
+ #
709
+ # @!method setcolorrep
674
710
 
675
- # `setwindow` establishes a window, or rectangular subspace, of world coordinates to be
676
- # plotted. If you desire log scaling or mirror-imaging of axes, use the SETSCALE function.
677
- # @param xmin [Numeric] The left horizontal coordinate of the window (`xmin` < `xmax`).
711
+ # `setwindow` establishes a window, or rectangular subspace, of world
712
+ # coordinates to be plotted. If you desire log scaling or mirror-imaging of
713
+ # axes, use the SETSCALE function.
714
+ #
715
+ # `setwindow` defines the rectangular portion of the World Coordinate space
716
+ # (WC) to be associated with the specified normalization transformation. The
717
+ # WC window and the Normalized Device Coordinates (NDC) viewport define the
718
+ # normalization transformation through which all output primitives are
719
+ # mapped. The WC window is mapped onto the rectangular NDC viewport which is,
720
+ # in turn, mapped onto the display surface of the open and active workstation,
721
+ # in device coordinates. By default, GR uses the range [0,1] x [0,1], in
722
+ # world coordinates, as the normalization transformation window.
723
+ #
724
+ # @param xmin [Numeric] The left horizontal coordinate of the window
725
+ # (`xmin` < `xmax`).
678
726
  # @param xmax [Numeric] The right horizontal coordinate of the window.
679
- # @param ymin [Numeric] The bottom vertical coordinate of the window (`ymin` < `ymax`).
727
+ # @param ymin [Numeric] The bottom vertical coordinate of the window
728
+ # (`ymin` < `ymax`).
680
729
  # @param ymax [Numeric] The top vertical coordinate of the window.
681
- # `setwindow` defines the rectangular portion of the World Coordinate space (WC) to be
682
- # associated with the specified normalization transformation. The WC window and the
683
- # Normalized Device Coordinates (NDC) viewport define the normalization transformation
684
- # through which all output primitives are mapped. The WC window is mapped onto the
685
- # rectangular NDC viewport which is, in turn, mapped onto the display surface of the
686
- # open and active workstation, in device coordinates. By default, GR uses the range
687
- # \[0,1] x [0,1], in world coordinates, as the normalization transformation window.
688
- def setwindow(*)
689
- super
690
- end
730
+ #
731
+ # @!method setwindow
691
732
 
692
733
  # inqwindow
693
734
  def inqwindow
@@ -696,20 +737,25 @@ module GR
696
737
  end
697
738
  end
698
739
 
699
- # `setviewport` establishes a rectangular subspace of normalized device coordinates.
740
+ # `setviewport` establishes a rectangular subspace of normalized device
741
+ # coordinates.
742
+ #
743
+ # `setviewport` defines the rectangular portion of the Normalized Device
744
+ # Coordinate (NDC) space to be associated with the specified normalization
745
+ # transformation. The NDC viewport and World Coordinate (WC) window define
746
+ # the normalization transformation through which all output primitives pass.
747
+ # The WC window is mapped onto the rectangular NDC viewport which is, in
748
+ # turn, mapped onto the display surface of the open and active workstation,
749
+ # in device coordinates.
750
+ #
700
751
  # @param xmin [Numeric] The left horizontal coordinate of the viewport.
701
- # @param xmax [Numeric] The right horizontal coordinate of the viewport (0 <= `xmin` < `xmax` <= 1).
752
+ # @param xmax [Numeric] The right horizontal coordinate of the viewport
753
+ # (0 <= `xmin` < `xmax` <= 1).
702
754
  # @param ymin [Numeric] The bottom vertical coordinate of the viewport.
703
- # @param ymax [Numeric] The top vertical coordinate of the viewport (0 <= `ymin` < `ymax` <= 1).
704
- # `setviewport` defines the rectangular portion of the Normalized Device Coordinate
705
- # (NDC) space to be associated with the specified normalization transformation. The
706
- # NDC viewport and World Coordinate (WC) window define the normalization transformation
707
- # through which all output primitives pass. The WC window is mapped onto the rectangular
708
- # NDC viewport which is, in turn, mapped onto the display surface of the open and active
709
- # workstation, in device coordinates.
710
- def setviewport(*)
711
- super
712
- end
755
+ # @param ymax [Numeric] The top vertical coordinate of the viewport
756
+ # (0 <= `ymin` < `ymax` <= 1).
757
+ #
758
+ # @!method setviewport
713
759
 
714
760
  # inqviewport
715
761
  def inqviewport
@@ -718,99 +764,103 @@ module GR
718
764
  end
719
765
  end
720
766
 
721
- # `selntran` selects a predefined transformation from world coordinates to normalized
722
- # device coordinates.
767
+ # `selntran` selects a predefined transformation from world coordinates to
768
+ # normalized device coordinates.
769
+ #
723
770
  # @param transform [Integer] A normalization transformation number.
724
- # * 0 : Selects the identity transformation in which both the window and viewport have the range of 0 to 1
725
- # * >= 1 : Selects a normalization transformation as defined by `setwindow` and `setviewport`
726
- def selntran(*)
727
- super
728
- end
771
+ # * 0 : Selects the identity transformation in which both the window and
772
+ # viewport have the range of 0 to 1
773
+ # * >= 1 : Selects a normalization transformation as defined by `setwindow`
774
+ # and `setviewport`
775
+ #
776
+ # @!method selntran
729
777
 
730
778
  # Set the clipping indicator.
731
- # @params indicator [Integer] An indicator specifying whether clipping is on or off.
779
+ #
780
+ # @params indicator [Integer] An indicator specifying whether clipping is on
781
+ # or off.
732
782
  # * 0 : Clipping is off. Data outside of the window will be drawn.
733
783
  # * 1 : Clipping is on. Data outside of the window will not be drawn.
734
- # `setclip` enables or disables clipping of the image drawn in the current window.
735
- # Clipping is defined as the removal of those portions of the graph that lie outside of
736
- # the defined viewport. If clipping is on, GR does not draw generated output primitives
737
- # past the viewport boundaries. If clipping is off, primitives may exceed the viewport
738
- # boundaries, and they will be drawn to the edge of the workstation window.
739
- # By default, clipping is on.
740
- def setclip(*)
741
- super
742
- end
743
-
744
- # Set the area of the NDC viewport that is to be drawn in the workstation window.
745
- # @param xmin [Numeric] The left horizontal coordinate of the workstation window.
746
- # @param xmax [Numeric] The right horizontal coordinate of the workstation window (0 <= `xmin` < `xmax` <= 1).
747
- # @param ymin [Numeric] The bottom vertical coordinate of the workstation window.
748
- # @param ymax [Numeric] The top vertical coordinate of the workstation window (0 <= `ymin` < `ymax` <= 1).
749
- # `setwswindow` defines the rectangular area of the Normalized Device Coordinate space
750
- # to be output to the device. By default, the workstation transformation will map the
751
- # range [0,1] x [0,1] in NDC onto the largest square on the workstation’s display
752
- # surface. The aspect ratio of the workstation window is maintained at 1 to 1.
753
- def setwswindow(*)
754
- super
755
- end
784
+ #
785
+ # `setclip` enables or disables clipping of the image drawn in the current
786
+ # window. Clipping is defined as the removal of those portions of the graph
787
+ # that lie outside of the defined viewport. If clipping is on, GR does not
788
+ # draw generated output primitives past the viewport boundaries. If clipping
789
+ # is off, primitives may exceed the viewport boundaries, and they will be
790
+ # drawn to the edge of the workstation window. By default, clipping is on.
791
+ #
792
+ # @!method setclip
793
+
794
+ # Set the area of the NDC viewport that is to be drawn in the workstation
795
+ # window.
796
+ #
797
+ # `setwswindow` defines the rectangular area of the Normalized Device
798
+ # Coordinate space to be output to the device. By default, the workstation
799
+ # transformation will map the range [0,1] x [0,1] in NDC onto the largest
800
+ # square on the workstation’s display surface. The aspect ratio of the
801
+ # workstation window is maintained at 1 to 1.
802
+ #
803
+ # @param xmin [Numeric] The left horizontal coordinate of the workstation
804
+ # window.
805
+ # @param xmax [Numeric] The right horizontal coordinate of the workstation
806
+ # window (0 <= `xmin` < `xmax` <= 1).
807
+ # @param ymin [Numeric] The bottom vertical coordinate of the workstation
808
+ # window.
809
+ # @param ymax [Numeric] The top vertical coordinate of the workstation
810
+ # window (0 <= `ymin` < `ymax` <= 1).
811
+ #
812
+ # @!method setwswindow
756
813
 
757
814
  # Define the size of the workstation graphics window in meters.
758
- # @param xmin [Numeric] The left horizontal coordinate of the workstation viewport.
759
- # @param xmax [Numeric] The right horizontal coordinate of the workstation viewport.
760
- # @param ymin [Numeric] The bottom vertical coordinate of the workstation viewport.
761
- # @param ymax [Numeric] The top vertical coordinate of the workstation viewport.
762
- # `setwsviewport` places a workstation window on the display of the specified size in
763
- # meters. This command allows the workstation window to be accurately sized for a
764
- # display or hardcopy device, and is often useful for sizing graphs for desktop
765
- # publishing applications.
766
- def setwsviewport(*)
767
- super
768
- end
815
+ #
816
+ # `setwsviewport` places a workstation window on the display of the
817
+ # specified size in meters. This command allows the workstation window to be
818
+ # accurately sized for a display or hardcopy device, and is often useful for
819
+ # sizing graphs for desktop publishing applications.
820
+ #
821
+ # @param xmin [Numeric] The left horizontal coordinate of the workstation
822
+ # viewport.
823
+ # @param xmax [Numeric] The right horizontal coordinate of the workstation
824
+ # viewport.
825
+ # @param ymin [Numeric] The bottom vertical coordinate of the workstation
826
+ # viewport.
827
+ # @param ymax [Numeric] The top vertical coordinate of the workstation
828
+ # viewport.
829
+ #
830
+ # @!method setwsviewport
769
831
 
770
- def createseg(*)
771
- super
772
- end
832
+ # @!method createseg
773
833
 
774
- def copysegws(*)
775
- super
776
- end
834
+ # @!method copysegws
777
835
 
778
- def redrawsegws(*)
779
- super
780
- end
836
+ # @!method redrawsegws
781
837
 
782
- def setsegtran(*)
783
- super
784
- end
838
+ # @!method setsegtran
785
839
 
786
- def closeseg(*)
787
- super
788
- end
840
+ # @!method closeseg
789
841
 
790
- def emergencyclosegks(*)
791
- super
792
- end
842
+ # @!method emergencyclosegks
793
843
 
794
- def updategks(*)
795
- super
796
- end
844
+ # @!method updategks
797
845
 
798
- # Set the abstract Z-space used for mapping three-dimensional output primitives into
799
- # the current world coordinate space.
800
- # @param zmin [Numeric] Minimum value for the Z-axis.
801
- # @param zmax [Numeric] Maximum value for the Z-axis.
846
+ # Set the abstract Z-space used for mapping three-dimensional output
847
+ # primitives into the current world coordinate space.
848
+ #
849
+ # `setspace` establishes the limits of an abstract Z-axis and defines the
850
+ # angles for rotation and for the viewing angle (tilt) of a simulated
851
+ # three-dimensional graph, used for mapping corresponding output primitives
852
+ # into the current window. These settings are used for all subsequent
853
+ # three-dimensional output primitives until other values are specified.
854
+ # Angles of rotation and viewing angle must be specified between 0° and 90°.
855
+ #
856
+ # @param zmin [Numeric] Minimum value for the Z-axis.
857
+ # @param zmax [Numeric] Maximum value for the Z-axis.
802
858
  # @param rotation [Integer] Angle for the rotation of the X axis, in degrees.
803
- # @param tilt [integer] Viewing angle of the Z axis in degrees.
804
- # @return [Integer]
805
- # `setspace` establishes the limits of an abstract Z-axis and defines the angles for
806
- # rotation and for the viewing angle (tilt) of a simulated three-dimensional graph,
807
- # used for mapping corresponding output primitives into the current window.
808
- # These settings are used for all subsequent three-dimensional output primitives until
809
- # other values are specified. Angles of rotation and viewing angle must be specified
810
- # between 0° and 90°.
811
- def setspace(*)
812
- super
813
- end
859
+ # @param tilt [integer] Viewing angle of the Z axis in degrees.
860
+ #
861
+ # @return [Integer]
862
+ #
863
+ # @!method setspace
814
864
 
815
865
  def inqspace
816
866
  inquiry %i[double double int int] do |*pts|
@@ -818,64 +868,63 @@ module GR
818
868
  end
819
869
  end
820
870
 
821
- # `setscale` sets the type of transformation to be used for subsequent GR output
822
- # primitives.
871
+ # `setscale` sets the type of transformation to be used for subsequent GR
872
+ # output primitives.
873
+ #
823
874
  # @param options [Integer] Scale specification
824
- # * 1 : OPTION_X_LOG
825
- # * Logarithmic X-axis
826
- # * 2 : OPTION_Y_LOG
827
- # * Logarithmic Y-axis
828
- # * 4 : OPTION_Z_LOG
829
- # * Logarithmic Z-axis
830
- # * 8 : OPTION_FLIP_X
831
- # * Flip X-axis
832
- # * 16 : OPTION_FLIP_Y
833
- # * Flip Y-axis
834
- # * 32 : OPTION_FLIP_Z
835
- # * Flip Z-axis
875
+ # * 1 : OPTION_X_LOG - Logarithmic X-axis
876
+ # * 2 : OPTION_Y_LOG - Logarithmic Y-axis
877
+ # * 4 : OPTION_Z_LOG - Logarithmic Z-axis
878
+ # * 8 : OPTION_FLIP_X - Flip X-axis
879
+ # * 16 : OPTION_FLIP_Y - Flip Y-axis
880
+ # * 32 : OPTION_FLIP_Z - Flip Z-axis
881
+ #
836
882
  # @return [Integer]
883
+ #
837
884
  # `setscale` defines the current transformation according to the given scale
838
- # specification which may be or'ed together using any of the above options. GR uses
839
- # these options for all subsequent output primitives until another value is provided.
840
- # The scale options are used to transform points from an abstract logarithmic or
841
- # semi-logarithmic coordinate system, which may be flipped along each axis, into the
842
- # world coordinate system.
843
- # Note: When applying a logarithmic transformation to a specific axis, the system
844
- # assumes that the axes limits are greater than zero.
845
- def setscale(*)
846
- super
847
- end
885
+ # specification which may be or'ed together using any of the above options.
886
+ # GR uses these options for all subsequent output primitives until another
887
+ # value is provided. The scale options are used to transform points from an
888
+ # abstract logarithmic or semi-logarithmic coordinate system, which may be
889
+ # flipped along each axis, into the world coordinate system.
890
+ #
891
+ # Note: When applying a logarithmic transformation to a specific axis, the
892
+ # system assumes that the axes limits are greater than zero.
893
+ #
894
+ # @!method setscale
848
895
 
849
896
  # inqscale
850
897
  def inqscale
851
898
  inquiry_int { |pt| super(pt) }
852
899
  end
853
900
 
854
- # Draw a text at position `x`, `y` using the current text attributes. Strings can be
855
- # defined to create basic mathematical expressions and Greek letters.
901
+ # Draw a text at position `x`, `y` using the current text attributes.
902
+ # Strings can be defined to create basic mathematical expressions and Greek
903
+ # letters.
904
+ #
905
+ # The values for X and Y are in normalized device coordinates.
906
+ # The attributes that control the appearance of text are text font and
907
+ # precision, character expansion factor, character spacing, text color index,
908
+ # character height, character up vector, text path and text alignment.
909
+ #
856
910
  # @param x [Numeric] The X coordinate of starting position of the text string
857
911
  # @param y [Numeric] The Y coordinate of starting position of the text string
858
- # @param string [String] The text to be drawn
912
+ # @param string [String] The text to be drawn
859
913
  # @return [Integer]
860
914
  #
861
- # The values for X and Y are in normalized device coordinates.
862
- # The attributes that control the appearance of text are text font and precision,
863
- # character expansion factor, character spacing, text color index, character
864
- # height, character up vector, text path and text alignment.
865
- #
866
915
  # The character string is interpreted to be a simple mathematical formula.
867
916
  # The following notations apply:
868
917
  #
869
- # Subscripts and superscripts: These are indicated by carets ('^') and underscores
870
- # \('_'). If the sub/superscript contains more than one character, it must be enclosed
871
- # in curly braces ('{}').
918
+ # Subscripts and superscripts: These are indicated by carets ('^') and
919
+ # underscores \('_'). If the sub/superscript contains more than one character,
920
+ # it must be enclosed in curly braces ('{}').
872
921
  #
873
- # Fractions are typeset with A '/' B, where A stands for the numerator and B for the
874
- # denominator.
922
+ # Fractions are typeset with A '/' B, where A stands for the numerator and B
923
+ # for the denominator.
875
924
  #
876
925
  # To include a Greek letter you must specify the corresponding keyword after a
877
- # backslash ('\') character. The text translator produces uppercase or lowercase
878
- # Greek letters depending on the case of the keyword.
926
+ # backslash ('\') character. The text translator produces uppercase or
927
+ # lowercase Greek letters depending on the case of the keyword.
879
928
  # * Α α - alpha
880
929
  # * Β β - beta
881
930
  # * Γ γ - gamma
@@ -901,11 +950,10 @@ module GR
901
950
  # * Ψ ψ - psi
902
951
  # * Ω ω - omega
903
952
  # Note: `\v` is a replacement for `\nu` which would conflict with `\n` (newline)
904
- # For more sophisticated mathematical formulas, you should use the `gr.mathtex`
953
+ # For more sophisticated mathematical formulas, you should use the `mathtex`
905
954
  # function.
906
- def textext(*)
907
- super
908
- end
955
+ #
956
+ # @!method textext
909
957
 
910
958
  # inqtextext
911
959
  def inqtextext(x, y, string)
@@ -914,11 +962,17 @@ module GR
914
962
  end
915
963
  end
916
964
 
917
- # Draw X and Y coordinate axes with linearly and/or logarithmically spaced tick marks.
918
- # @param x_tick [Numeric] The interval between minor tick marks on the X axis.
919
- # @param y_tick [Numeric] The interval between minor tick marks on the Y axis.
920
- # @param x_org [Numeric] The world coordinates of the origin (point of intersection) of the X axis.
921
- # @param y_org [Numeric] The world coordinates of the origin (point of intersection) of the Y axis.
965
+ # Draw X and Y coordinate axes with linearly and/or logarithmically spaced
966
+ # tick marks.
967
+ #
968
+ # @param x_tick [Numeric]
969
+ # The interval between minor tick marks on the X axis.
970
+ # @param y_tick [Numeric]
971
+ # The interval between minor tick marks on the Y axis.
972
+ # @param x_org [Numeric]
973
+ # The world coordinates of the origin (point of intersection) of the X axis.
974
+ # @param y_org [Numeric]
975
+ # The world coordinates of the origin (point of intersection) of the Y axis.
922
976
  # @param major_x [Integer]
923
977
  # Unitless integer values specifying the number of minor tick intervals
924
978
  # between major tick marks. Values of 0 or 1 imply no minor ticks.
@@ -932,74 +986,142 @@ module GR
932
986
  # coordinate unit. Major tick marks are twice as long as minor tick marks.
933
987
  # A negative value reverses the tick marks on the axes from inward facing
934
988
  # to outward facing (or vice versa).
935
- def axes(*)
936
- super
937
- end
989
+ #
990
+ # Tick marks are positioned along each axis so that major tick marks fall on
991
+ # the axes origin (whether visible or not). Major tick marks are labeled
992
+ # with the corresponding data values. Axes are drawn according to the scale
993
+ # of the window. Axes and tick marks are drawn using solid lines; line color
994
+ # and width can be modified using the gr_setlinetype and gr_setlinewidth
995
+ # functions. Axes are drawn according to the linear or logarithmic
996
+ # transformation established by the gr_setscale function.
997
+ #
998
+ # @!method axes
938
999
 
939
1000
  alias axes2d axes
940
1001
 
941
- def axeslbl(*)
942
- super
943
- end
944
-
945
- # Draw a linear and/or logarithmic grid.
946
- # @param x_tick [Numeric] The length in world coordinates of the interval between minor grid lines.
947
- # @param y_tick [Numeric] The length in world coordinates of the interval between minor grid lines.
948
- # @param x_org [Numeric] The world coordinates of the origin (point of intersection) of the grid.
949
- # @param y_org [Numeric] The world coordinates of the origin (point of intersection) of the grid.
1002
+ # Create axes in the current workspace and supply a custom function for
1003
+ # changing the behaviour of the tick labels.
1004
+ #
1005
+ # @note This method uses GRCommons::Fiddley::Function as a callback function.
1006
+ # Please read the source code If you have to use it. There are some
1007
+ # examples of the use of this function in the Plot class..
1008
+ #
1009
+ # Similar to gr_axes() but allows more fine-grained control over tick labels
1010
+ # and text positioning by supplying callback functions. Within the callback
1011
+ # function you can use normal GR text primitives for performing any
1012
+ # manipulations on the label text.
1013
+ # See gr_axes() for more details on drawing axes.
1014
+ #
1015
+ # @param x_tick [Numeric]
1016
+ # The interval between minor tick marks on the X axis.
1017
+ # @param y_tick [Numeric]
1018
+ # The interval between minor tick marks on the Y axis.
1019
+ # @param x_org [Numeric]
1020
+ # The world coordinate of the origin (point of intersection) of the X axis.
1021
+ # @param y_org [Numeric]
1022
+ # The world coordinate of the origin (point of intersection) of the Y axis.
950
1023
  # @param major_x [Integer]
951
- # Unitless integer values specifying the number of minor grid lines
952
- # between major grid lines. Values of 0 or 1 imply no grid lines.
1024
+ # Unitless integer value specifying the number of minor tick intervals
1025
+ # between major tick marks on the X axis. Values of 0 or 1 imply no minor
1026
+ # ticks. Negative values specify no labels will be drawn for the associated
1027
+ # axis.
953
1028
  # @param major_y [Integer]
954
- # Unitless integer values specifying the number of minor grid lines
955
- # between major grid lines. Values of 0 or 1 imply no grid lines.
1029
+ # Unitless integer value specifying the number of minor tick intervals
1030
+ # between major tick marks on the Y axis. Values of 0 or 1 imply no minor
1031
+ # ticks. Negative values specify no labels will be drawn for the associated
1032
+ # axis.
1033
+ # @param tick_size [Numeric]
1034
+ # The length of minor tick marks specified in a normalized device
1035
+ # coordinate unit. Major tick marks are twice as long as minor tick marks.
1036
+ # A negative value reverses the tick marks on the axes from inward facing
1037
+ # to outward facing (or vice versa).
1038
+ # @param fpx [Pointer]
1039
+ # Function pointer to a function that returns a label for a given tick on
1040
+ # the X axis. The callback function should have the following arguments.
1041
+ # @param fpy [Pointer] Exactly same as the fpx above, but for the the Y axis.
956
1042
  #
957
- # Major grid lines correspond to the axes origin and major tick marks whether visible
958
- # or not. Minor grid lines are drawn at points equal to minor tick marks. Major grid
959
- # lines are drawn using black lines and minor grid lines are drawn using gray lines.
960
- def grid(*)
961
- super
962
- end
1043
+ # * fpx/fpy
1044
+ # * param x [Numeric] NDC of the label in X direction.
1045
+ # * param y [Numeric] NDC of the label in Y direction.
1046
+ # * param svalue [String] Internal string representation of the text drawn by GR at (x,y).
1047
+ # * param value [Numeric] Floating point representation of the label drawn at (x,y).
1048
+ #
1049
+ # @!method axeslbl
963
1050
 
964
1051
  # Draw a linear and/or logarithmic grid.
965
- # @param x_tick [Numeric] The length in world coordinates of the interval between minor grid lines.
966
- # @param y_tick [Numeric] The length in world coordinates of the interval between minor grid lines.
967
- # @param z_tick [Numeric] The length in world coordinates of the interval between minor grid lines.
968
- # @param x_org [Numeric] The world coordinates of the origin (point of intersection) of the grid.
969
- # @param y_org [Numeric] The world coordinates of the origin (point of intersection) of the grid.
970
- # @param z_org [Numeric] The world coordinates of the origin (point of intersection) of the grid.
971
- # @param major_x [Integer]
972
- # Unitless integer values specifying the number of minor grid lines
973
- # between major grid lines. Values of 0 or 1 imply no grid lines.
974
- # @param major_y [Integer]
975
- # Unitless integer values specifying the number of minor grid lines
976
- # between major grid lines. Values of 0 or 1 imply no grid lines.
977
- # @param major_z [Integer]
978
- # Unitless integer values specifying the number of minor grid lines
979
- # between major grid lines. Values of 0 or 1 imply no grid lines.
980
1052
  #
981
- # Major grid lines correspond to the axes origin and major tick marks whether visible
982
- # or not. Minor grid lines are drawn at points equal to minor tick marks. Major grid
983
- # lines are drawn using black lines and minor grid lines are drawn using gray lines.
984
- def grid3d(*)
985
- super
986
- end
1053
+ # Major grid lines correspond to the axes origin and major tick marks whether
1054
+ # visible or not. Minor grid lines are drawn at points equal to minor tick
1055
+ # marks. Major grid lines are drawn using black lines and minor grid lines
1056
+ # are drawn using gray lines.
1057
+ #
1058
+ # @param x_tick [Numeric] The length in world coordinates of the interval
1059
+ # between minor grid lines.
1060
+ # @param y_tick [Numeric] The length in world coordinates of the interval
1061
+ # between minor grid lines.
1062
+ # @param x_org [Numeric] The world coordinates of the origin (point of
1063
+ # intersection) of the grid.
1064
+ # @param y_org [Numeric] The world coordinates of the origin (point of
1065
+ # intersection) of the grid.
1066
+ # @param major_x [Integer] Unitless integer values specifying the number of
1067
+ # minor grid lines between major grid lines.
1068
+ # Values of 0 or 1 imply no grid lines.
1069
+ # @param major_y [Integer] Unitless integer values specifying the number of
1070
+ # minor grid lines between major grid lines.
1071
+ # Values of 0 or 1 imply no grid lines.
1072
+ #
1073
+ # @!method grid
1074
+
1075
+ # Draw a linear and/or logarithmic grid.
1076
+ #
1077
+ # Major grid lines correspond to the axes origin and major tick marks whether
1078
+ # visible or not. Minor grid lines are drawn at points equal to minor tick
1079
+ # marks. Major grid lines are drawn using black lines and minor grid lines
1080
+ # are drawn using gray lines.
1081
+ #
1082
+ # @param x_tick [Numeric] The length in world coordinates of the interval
1083
+ # between minor grid lines.
1084
+ # @param y_tick [Numeric] The length in world coordinates of the interval
1085
+ # between minor grid lines.
1086
+ # @param z_tick [Numeric] The length in world coordinates of the interval
1087
+ # between minor grid lines.
1088
+ # @param x_org [Numeric] The world coordinates of the origin (point of
1089
+ # intersection) of the grid.
1090
+ # @param y_org [Numeric] The world coordinates of the origin (point of
1091
+ # intersection) of the grid.
1092
+ # @param z_org [Numeric] The world coordinates of the origin (point of
1093
+ # intersection) of the grid.
1094
+ # @param major_x [Integer] Unitless integer values specifying the number
1095
+ # of minor grid lines between major grid lines.
1096
+ # Values of 0 or 1 imply no grid lines.
1097
+ # @param major_y [Integer] Unitless integer values specifying the number
1098
+ # of minor grid lines between major grid lines.
1099
+ # Values of 0 or 1 imply no grid lines.
1100
+ # @param major_z [Integer] Unitless integer values specifying the number of
1101
+ # minor grid lines between major grid lines.
1102
+ # Values of 0 or 1 imply no grid lines.
1103
+ #
1104
+ # @!method grid3d
987
1105
 
988
1106
  # Draw a standard vertical error bar graph.
989
- # @param x [Array, NArray] A list of length N containing the X coordinates
990
- # @param y [Array, NArray] A list of length N containing the Y coordinates
1107
+ #
1108
+ # @param x [Array, NArray] A list of length N containing the X coordinates
1109
+ # @param y [Array, NArray] A list of length N containing the Y coordinates
991
1110
  # @param e1 [Array, NArray] The absolute values of the lower error bar data
992
1111
  # @param e2 [Array, NArray] The absolute values of the lower error bar data
1112
+ #
993
1113
  def verrorbars(x, y, e1, e2)
994
1114
  n = equal_length(x, y, e1, e2)
995
1115
  super(n, x, y, e1, e2)
996
1116
  end
997
1117
 
998
1118
  # Draw a standard horizontal error bar graph.
1119
+ #
999
1120
  # @param x [Array, NArray] A list of length N containing the X coordinates
1000
1121
  # @param y [Array, NArray] A list of length N containing the Y coordinates
1001
1122
  # @param e1 [Array, NArray] The absolute values of the lower error bar data
1002
1123
  # @param e2 [Array, NArray] The absolute values of the lower error bar data
1124
+ #
1003
1125
  def herrorbars(x, y, e1, e2)
1004
1126
  n = equal_length(x, y, e1, e2)
1005
1127
  super(n, x, y, e1, e2)
@@ -1007,24 +1129,30 @@ module GR
1007
1129
 
1008
1130
  # Draw a 3D curve using the current line attributes,
1009
1131
  # starting from the first data point and ending at the last data point.
1010
- # @param x [Array, NArray] A list of length N containing the X coordinates
1011
- # @param y [Array, NArray] A list of length N containing the Y coordinates
1012
- # @param z [Array, NArray] A list of length N containing the Z coordinates
1132
+ #
1013
1133
  # The values for `x`, `y` and `z` are in world coordinates. The attributes that
1014
1134
  # control the appearance of a polyline are linetype, linewidth and color
1015
1135
  # index.
1136
+ #
1137
+ # @param x [Array, NArray] A list of length N containing the X coordinates
1138
+ # @param y [Array, NArray] A list of length N containing the Y coordinates
1139
+ # @param z [Array, NArray] A list of length N containing the Z coordinates
1140
+ #
1016
1141
  def polyline3d(x, y, z)
1017
1142
  n = equal_length(x, y, z)
1018
1143
  super(n, x, y, z)
1019
1144
  end
1020
1145
 
1021
1146
  # Draw marker symbols centered at the given 3D data points.
1022
- # @param x [Array, NArray] A list of length N containing the X coordinates
1023
- # @param y [Array, NArray] A list of length N containing the Y coordinates
1024
- # @param z [Array, NArray] A list of length N containing the Z coordinates
1147
+ #
1025
1148
  # The values for `x`, `y` and `z` are in world coordinates. The attributes
1026
1149
  # that control the appearance of a polymarker are marker type, marker size
1027
1150
  # scale factor and color index.
1151
+ #
1152
+ # @param x [Array, NArray] A list of length N containing the X coordinates
1153
+ # @param y [Array, NArray] A list of length N containing the Y coordinates
1154
+ # @param z [Array, NArray] A list of length N containing the Z coordinates
1155
+ #
1028
1156
  def polymarker3d(x, y, z)
1029
1157
  n = equal_length(x, y, z)
1030
1158
  super(n, x, y, z)
@@ -1032,12 +1160,24 @@ module GR
1032
1160
 
1033
1161
  # Draw X, Y and Z coordinate axes with linearly and/or logarithmically
1034
1162
  # spaced tick marks.
1163
+ #
1164
+ # Tick marks are positioned along each axis so that major tick marks fall on
1165
+ # the axes origin (whether visible or not). Major tick marks are labeled with
1166
+ # the corresponding data values. Axes are drawn according to the scale of the
1167
+ # window. Axes and tick marks are drawn using solid lines; line color and
1168
+ # width can be modified using the `setlinetype` and `setlinewidth` functions.
1169
+ # Axes are drawn according to the linear or logarithmic transformation
1170
+ # established by the `setscale` function.
1171
+ #
1035
1172
  # @param x_tick [Numeric] The interval between minor tick marks on the X axis.
1036
1173
  # @param y_tick [Numeric] The interval between minor tick marks on the Y axis.
1037
1174
  # @param z_tick [Numeric] The interval between minor tick marks on the Z axis.
1038
- # @param x_org [Numeric] The world coordinates of the origin (point of intersection) of the X axes.
1039
- # @param y_org [Numeric] The world coordinates of the origin (point of intersection) of the Y axes.
1040
- # @param z_org [Numeric] The world coordinates of the origin (point of intersection) of the Z axes.
1175
+ # @param x_org [Numeric]
1176
+ # The world coordinates of the origin (point of intersection) of the X axes.
1177
+ # @param y_org [Numeric]
1178
+ # The world coordinates of the origin (point of intersection) of the Y axes.
1179
+ # @param z_org [Numeric]
1180
+ # The world coordinates of the origin (point of intersection) of the Z axes.
1041
1181
  # @param major_x [Integer]
1042
1182
  # Unitless integer values specifying the number of minor tick intervals
1043
1183
  # between major tick marks. Values of 0 or 1 imply no minor ticks.
@@ -1055,48 +1195,41 @@ module GR
1055
1195
  # coordinate unit. Major tick marks are twice as long as minor tick marks.
1056
1196
  # A negative value reverses the tick marks on the axes from inward facing
1057
1197
  # to outward facing (or vice versa).
1058
- # Tick marks are positioned along each axis so that major tick marks fall on the axes
1059
- # origin (whether visible or not). Major tick marks are labeled with the corresponding
1060
- # data values. Axes are drawn according to the scale of the window. Axes and tick marks
1061
- # are drawn using solid lines; line color and width can be modified using the
1062
- # `setlinetype` and `setlinewidth` functions. Axes are drawn according to
1063
- # the linear or logarithmic transformation established by the `setscale` function.
1064
- def axes3d(*)
1065
- super
1066
- end
1198
+ #
1199
+ # @!method axes3d
1067
1200
 
1068
1201
  # Display axis titles just outside of their respective axes.
1202
+ #
1069
1203
  # @param x_title [String] The text to be displayed on the X axis
1070
1204
  # @param x_title [String] The text to be displayed on the Y axis
1071
1205
  # @param x_title [String] The text to be displayed on the Z axis
1072
- def titles3d(*)
1073
- super
1074
- end
1206
+ #
1207
+ # @!method titles3d
1075
1208
 
1076
1209
  # Draw a three-dimensional surface plot for the given data points.
1210
+ #
1211
+ # `x` and `y` define a grid. `z` is a singly dimensioned array containing at
1212
+ # least `nx` * `ny` data points. Z describes the surface height at each point
1213
+ # on the grid. Data is ordered as shown in the table:
1214
+ #
1215
+ # @note `surface` is overwritten by `require gr/plot`.
1216
+ # The original method is moved to the underscored name.
1217
+ # The yard document will show the method name after evacuation.
1218
+ #
1077
1219
  # @param x [Array, NArray] A list containing the X coordinates
1078
1220
  # @param y [Array, NArray] A list containing the Y coordinates
1079
1221
  # @param z [Array, NArray]
1080
1222
  # A list of length `len(x)` * `len(y)` or an appropriately dimensioned
1081
1223
  # array containing the Z coordinates
1082
1224
  # @param option [Integer] Surface display option
1083
- # * 0 LINES
1084
- # * Use X Y polylines to denote the surface
1085
- # * 1 MESH
1086
- # * Use a wire grid to denote the surface
1087
- # * 2 FILLED_MESH
1088
- # * Applies an opaque grid to the surface
1089
- # * 3 Z_SHADED_MESH
1090
- # * Applies Z-value shading to the surface
1091
- # * 4 COLORED_MESH
1092
- # * Applies a colored grid to the surface
1093
- # * 5 CELL_ARRAY
1094
- # * Applies a grid of individually-colored cells to the surface
1095
- # * 6 SHADED_MESH
1096
- # * Applies light source shading to the 3-D surface
1097
- # `x` and `y` define a grid. `z` is a singly dimensioned array containing at least
1098
- # `nx` * `ny` data points. Z describes the surface height at each point on the grid.
1099
- # Data is ordered as shown in the table:
1225
+ # * 0 LINES - Use X Y polylines to denote the surface
1226
+ # * 1 MESH - Use a wire grid to denote the surface
1227
+ # * 2 FILLED_MESH - Applies an opaque grid to the surface
1228
+ # * 3 Z_SHADED_MESH - Applies Z-value shading to the surface
1229
+ # * 4 COLORED_MESH - Applies a colored grid to the surface
1230
+ # * 5 CELL_ARRAY - Applies a grid of individually-colored cells to the surface
1231
+ # * 6 SHADED_MESH - Applies light source shading to the 3-D surface
1232
+ #
1100
1233
  def surface(x, y, z, option)
1101
1234
  # TODO: check: Arrays have incorrect length or dimension.
1102
1235
  nx = x.length
@@ -1104,12 +1237,17 @@ module GR
1104
1237
  super(nx, ny, x, y, z, option)
1105
1238
  end
1106
1239
 
1107
- # Draw contours of a three-dimensional data set
1108
- # whose values are specified over a rectangular mesh.
1109
- # Contour lines may optionally be labeled.
1240
+ # Draw contours of a three-dimensional data set whose values are specified
1241
+ # over a rectangular mesh. Contour lines may optionally be labeled.
1242
+ #
1243
+ # @note `contour` is overwritten by `require gr/plot`.
1244
+ # The original method is moved to the underscored name.
1245
+ # The yard document will show the method name after evacuation.
1246
+ #
1110
1247
  # @param x [Array, NArray] A list containing the X coordinates
1111
1248
  # @param y [Array, NArray] A list containing the Y coordinates
1112
- # @param h [Array, NArray] A list containing the Z coordinate for the height values
1249
+ # @param h [Array, NArray]
1250
+ # A list containing the Z coordinate for the height values
1113
1251
  # @param z [Array, NArray]
1114
1252
  # A list containing the Z coordinate for the height values
1115
1253
  # A list of length `len(x)` * `len(y)` or an appropriately dimensioned
@@ -1119,6 +1257,7 @@ module GR
1119
1257
  # every third line. A value of 1 will label every line. A value of 0
1120
1258
  # produces no labels. To produce colored contour lines, add an offset
1121
1259
  # of 1000 to `major_h`.
1260
+ #
1122
1261
  def contour(x, y, h, z, major_h)
1123
1262
  # TODO: check: Arrays have incorrect length or dimension.
1124
1263
  nx = x.length
@@ -1127,8 +1266,13 @@ module GR
1127
1266
  super(nx, ny, nh, x, y, h, z, major_h)
1128
1267
  end
1129
1268
 
1130
- # Draw filled contours of a three-dimensional data set
1131
- # whose values are specified over a rectangular mesh.
1269
+ # Draw filled contours of a three-dimensional data set whose values are
1270
+ # specified over a rectangular mesh.
1271
+ #
1272
+ # @note `contourf` is overwritten by `require gr/plot`.
1273
+ # The original method is moved to the underscored name.
1274
+ # The yard document will show the method name after evacuation.
1275
+ #
1132
1276
  # @param x [Array, NArray] A list containing the X coordinates
1133
1277
  # @param y [Array, NArray] A list containing the Y coordinates
1134
1278
  # @param h [Array, NArray]
@@ -1138,6 +1282,7 @@ module GR
1138
1282
  # @param z [Array, NArray]
1139
1283
  # A list of length `len(x)` * `len(y)` or an appropriately dimensioned
1140
1284
  # array containing the Z coordinates
1285
+ #
1141
1286
  def contourf(x, y, h, z, major_h)
1142
1287
  # TODO: check: Arrays have incorrect length or dimension.
1143
1288
  nx = x.length
@@ -1147,28 +1292,59 @@ module GR
1147
1292
  end
1148
1293
 
1149
1294
  # Draw a contour plot for the given triangle mesh.
1295
+ #
1296
+ # @param x [Array, NArray] A list containing the X coordinates
1297
+ # @param y [Array, NArray] A list containing the Y coordinates
1298
+ # @param z [Array, NArray] A list containing the Z coordinates
1299
+ # @param lavels [Array, NArray] A list of contour levels
1300
+ #
1150
1301
  def tricontour(x, y, z, levels)
1151
1302
  npoints = x.length # equal_length ?
1152
1303
  nlevels = levels.length
1153
1304
  super(npoints, x, y, z, nlevels, levels)
1154
1305
  end
1155
1306
 
1307
+ # @note `hexbin` is overwritten by `require gr/plot`.
1308
+ # The original method is moved to the underscored name.
1309
+ # The yard document will show the method name after evacuation.
1310
+ #
1156
1311
  # @return [Integer]
1157
1312
  def hexbin(x, y, nbins)
1158
1313
  n = x.length
1159
1314
  super(n, x, y, nbins)
1160
1315
  end
1161
1316
 
1162
- def setcolormap(*)
1163
- super
1164
- end
1317
+ # Set the currently used colormap.
1318
+ #
1319
+ # * A list of colormaps can be found at: https://gr-framework.org/colormaps.html
1320
+ # Using a negative index will use the reverse of the selected colormap.
1321
+ #
1322
+ # @param index [Integer] Colormap index
1323
+ #
1324
+ # @!method setcolormap
1165
1325
 
1166
1326
  # inqcolormap
1167
1327
  def inqcolormap
1168
1328
  inquiry_int { |pt| super(pt) }
1169
1329
  end
1170
1330
 
1171
- # TODO: GR.jl python-gr different API
1331
+ # Define a colormap by a list of RGB colors.
1332
+ # @note GR.jl and python-gr have different APIsI
1333
+ #
1334
+ # This function defines a colormap using the n given color intensities.
1335
+ # If less than 256 colors are provided the colors intensities are linear
1336
+ # interpolated. If x is NULL the given color values are evenly distributed
1337
+ # in the colormap. Otherwise the normalized value of x defines the position
1338
+ # of the color in the colormap.
1339
+ #
1340
+ # @param r [Array, NArray] The red intensities in range 0.0 to 1.0
1341
+ # @param g [Array, NArray] The green intensities in range 0.0 to 1.0
1342
+ # @param b [Array, NArray] The blue intensities in range 0.0 to 1.0
1343
+ # @param positions [Array, NArray]
1344
+ # The positions of the corresponding color in the resulting colormap or nil.
1345
+ # The values of positions must increase monotonically from 0.0 to 1.0.
1346
+ # If positions is nil the given colors are evenly distributed in the colormap.
1347
+ #
1172
1348
  def setcolormapfromrgb(r, g, b, positions: nil)
1173
1349
  n = equal_length(r, g, b)
1174
1350
  if positions.nil?
@@ -1179,9 +1355,7 @@ module GR
1179
1355
  super(n, r, g, b, positions)
1180
1356
  end
1181
1357
 
1182
- def colorbar(*)
1183
- super
1184
- end
1358
+ # @!method colorbar
1185
1359
 
1186
1360
  def inqcolor(color)
1187
1361
  inquiry_int do |rgb|
@@ -1190,9 +1364,7 @@ module GR
1190
1364
  end
1191
1365
 
1192
1366
  # @return [Integer]
1193
- def inqcolorfromrgb(*)
1194
- super
1195
- end
1367
+ # @!method inqcolorfromrgb
1196
1368
 
1197
1369
  def hsvtorgb(h, s, v)
1198
1370
  inquiry %i[double double double] do |r, g, b|
@@ -1201,14 +1373,10 @@ module GR
1201
1373
  end
1202
1374
 
1203
1375
  # @return [Numeric]
1204
- def tick(*)
1205
- super
1206
- end
1376
+ # @!method tick
1207
1377
 
1208
1378
  # @return [Integer]
1209
- def validaterange(*)
1210
- super
1211
- end
1379
+ # @!method validaterange
1212
1380
 
1213
1381
  def adjustlimits(amin, amax)
1214
1382
  inquiry %i[double double] do |pamin, pamax|
@@ -1227,24 +1395,28 @@ module GR
1227
1395
  end
1228
1396
 
1229
1397
  # Open and activate a print device.
1398
+ #
1399
+ # `beginprint` opens an additional graphics output device. The device type is obtained
1400
+ # from the given file extension
1401
+ #
1230
1402
  # @param pathname [String] Filename for the print device.
1231
1403
  # The following file types are supported:
1232
- # * .ps, .eps : PostScript
1233
- # * .pdf : Portable Document Format
1234
- # * .bmp : Windows Bitmap (BMP)
1404
+ # * .ps, .eps : PostScript
1405
+ # * .pdf : Portable Document Format
1406
+ # * .bmp : Windows Bitmap (BMP)
1235
1407
  # * .jpeg, .jpg : JPEG image file
1236
- # * .png : Portable Network Graphics file (PNG)
1408
+ # * .png : Portable Network Graphics file (PNG)
1237
1409
  # * .tiff, .tif : Tagged Image File Format (TIFF)
1238
- # * .fig : Xfig vector graphics file
1239
- # * .svg : Scalable Vector Graphics
1240
- # * .wmf : Windows Metafile
1241
- # `beginprint` opens an additional graphics output device. The device type is obtained
1242
- # from the given file extension.
1243
- def beginprint(*)
1244
- super
1245
- end
1410
+ # * .svg : Scalable Vector Graphics
1411
+ # * .wmf : Windows Metafile
1412
+ # * .mp4 : MPEG-4 video file
1413
+ # * .webm : WebM video file
1414
+ # * .ogg : Ogg video file
1415
+ #
1416
+ # @!method beginprint
1246
1417
 
1247
1418
  # Open and activate a print device with the given layout attributes.
1419
+ #
1248
1420
  # @param pathname [String] Filename for the print device.
1249
1421
  # @param mode [String] Output mode (Color, GrayScale)
1250
1422
  # @param fmt [String] Output format
@@ -1280,13 +1452,10 @@ module GR
1280
1452
  # * Ledger : 0.432 x 0.279
1281
1453
  # * Tabloid : 0.279 x 0.432
1282
1454
  # @param orientation [String] Page orientation (Landscape, Portait)
1283
- def beginprintext(*)
1284
- super
1285
- end
1455
+ #
1456
+ # @!method beginprintext
1286
1457
 
1287
- def endprint(*)
1288
- super
1289
- end
1458
+ # @!method endprint
1290
1459
 
1291
1460
  def ndctowc(x, y)
1292
1461
  inquiry %i[double double] do |px, py|
@@ -1314,67 +1483,74 @@ module GR
1314
1483
  end
1315
1484
 
1316
1485
  # Draw a rectangle using the current line attributes.
1486
+ #
1317
1487
  # @param xmin [Numeric] Lower left edge of the rectangle
1318
1488
  # @param xmax [Numeric] Lower right edge of the rectangle
1319
1489
  # @param ymin [Numeric] Upper left edge of the rectangle
1320
1490
  # @param ymax [Numeric] Upper right edge of the rectangle
1321
- def drawrect(*)
1322
- super
1323
- end
1491
+ #
1492
+ # @!method drawrect
1324
1493
 
1325
1494
  # Draw a filled rectangle using the current fill attributes.
1495
+ #
1326
1496
  # @param xmin [Numeric] Lower left edge of the rectangle
1327
1497
  # @param xmax [Numeric] Lower right edge of the rectangle
1328
1498
  # @param ymin [Numeric] Upper left edge of the rectangle
1329
1499
  # @param ymax [Numeric] Upper right edge of the rectangle
1330
- def fillrect(*)
1331
- super
1332
- end
1500
+ #
1501
+ # @!method fillrect
1333
1502
 
1334
1503
  # Draw a circular or elliptical arc covering the specified rectangle.
1504
+ #
1505
+ # The resulting arc begins at `a1` and ends at `a2` degrees. Angles are
1506
+ # interpreted such that 0 degrees is at the 3 o'clock position. The center
1507
+ # of the arc is the center of the given rectangle.
1508
+ #
1335
1509
  # @param xmin [Numeric] Lower left edge of the rectangle
1336
1510
  # @param xmax [Numeric] Lower right edge of the rectangle
1337
1511
  # @param ymin [Numeric] Upper left edge of the rectangle
1338
1512
  # @param ymax [Numeric] Upper right edge of the rectangle
1339
- # @param a1 [Numeric] The start angle
1340
- # @param a2 [Numeric] The end angle
1341
- # The resulting arc begins at `a1` and ends at `a2` degrees. Angles are interpreted
1342
- # such that 0 degrees is at the 3 o'clock position. The center of the arc is the center
1343
- # of the given rectangle.
1344
- def drawarc(*)
1345
- super
1346
- end
1513
+ # @param a1 [Numeric] The start angle
1514
+ # @param a2 [Numeric] The end angle
1515
+ #
1516
+ # @!method drawarc
1347
1517
 
1348
1518
  # Fill a circular or elliptical arc covering the specified rectangle.
1519
+ #
1520
+ # The resulting arc begins at `a1` and ends at `a2` degrees. Angles are
1521
+ # interpreted such that 0 degrees is at the 3 o'clock position. The center
1522
+ # of the arc is the center of the given rectangle.
1523
+ #
1349
1524
  # @param xmin [Numeric] Lower left edge of the rectangle
1350
1525
  # @param xmax [Numeric] Lower right edge of the rectangle
1351
1526
  # @param ymin [Numeric] Upper left edge of the rectangle
1352
1527
  # @param ymax [Numeric] Upper right edge of the rectangle
1353
1528
  # @param a1 [Numeric] The start angle
1354
1529
  # @param a2 [Numeric] The end angle
1355
- # The resulting arc begins at `a1` and ends at `a2` degrees. Angles are interpreted
1356
- # such that 0 degrees is at the 3 o'clock position. The center of the arc is the center
1357
- # of the given rectangle.
1358
- def fillarc(*)
1359
- super
1360
- end
1530
+ #
1531
+ # @!method fillarc
1361
1532
 
1362
- # Draw simple and compound outlines consisting of line segments and bezier curves.
1533
+ # Draw simple and compound outlines consisting of line segments and bezier
1534
+ # curves.
1535
+ #
1363
1536
  # @param points [Array, NArray] (N, 2) array of (x, y) vertices
1364
1537
  # @parm codes [Array, NArray] N-length array of path codes
1365
- # * STOP : end the entire path
1366
- # * MOVETO : move to the given vertex
1367
- # * LINETO : draw a line from the current position to the given vertex
1368
- # * CURVE3 : draw a quadratic Bézier curve
1369
- # * CURVE4 : draw a cubic Bézier curve
1538
+ # * STOP : end the entire path
1539
+ # * MOVETO : move to the given vertex
1540
+ # * LINETO : draw a line from the current position to the given vertex
1541
+ # * CURVE3 : draw a quadratic Bézier curve
1542
+ # * CURVE4 : draw a cubic Bézier curve
1370
1543
  # * CLOSEPOLY : draw a line segment to the start point of the current path
1371
- # @parm fill [Integer] A flag indication whether resulting path is to be filled or not
1544
+ # @parm fill [Integer]
1545
+ # A flag indication whether resulting path is to be filled or not
1546
+ #
1372
1547
  def drawpath(points, codes, fill)
1373
1548
  len = codes.length
1374
1549
  super(len, points, uint8(codes), fill)
1375
1550
  end
1376
1551
 
1377
1552
  # Set the arrow style to be used for subsequent arrow commands.
1553
+ #
1378
1554
  # @param style [Integer] The arrow style to be used
1379
1555
  # The default arrow style is 1.
1380
1556
  # * 1 : simple, single-ended
@@ -1396,29 +1572,30 @@ module GR
1396
1572
  # * 17 : double line, single-ended
1397
1573
  # * 18 : double line, double-ended
1398
1574
  # `setarrowstyle` defines the arrow style for subsequent arrow primitives.
1399
- def setarrowstyle(*)
1400
- super
1401
- end
1575
+ #
1576
+ # @!method setarrowstyle
1402
1577
 
1403
1578
  # Set the arrow size to be used for subsequent arrow commands.
1404
- # @param size [Numeric] The arrow size to be used
1579
+ #
1405
1580
  # `setarrowsize` defines the arrow size for subsequent arrow primitives.
1406
1581
  # The default arrow size is 1.
1407
- def setarrowsize(*)
1408
- super
1409
- end
1582
+ #
1583
+ # @param size [Numeric] The arrow size to be used
1584
+ #
1585
+ # @!method setarrowsize
1410
1586
 
1411
1587
  # Draw an arrow between two points.
1588
+ #
1589
+ # Different arrow styles (angles between arrow tail and wing, optionally
1590
+ # filled heads, double headed arrows) are available and can be set with the
1591
+ # `setarrowstyle` function.
1592
+ #
1412
1593
  # @param x1 [Numeric] Starting point of the arrow (tail)
1413
1594
  # @param y1 [Numeric] Starting point of the arrow (tail)
1414
1595
  # @param x2 [Numeric] Head of the arrow
1415
1596
  # @param y2 [Numeric] Head of the arrow
1416
- # Different arrow styles (angles between arrow tail and wing, optionally filled
1417
- # heads, double headed arrows) are available and can be set with the `setarrowstyle`
1418
- # function.
1419
- def drawarrow(*)
1420
- super
1421
- end
1597
+ #
1598
+ # @!method drawarrow
1422
1599
 
1423
1600
  # @return [Integer]
1424
1601
  def readimage(path)
@@ -1434,35 +1611,35 @@ module GR
1434
1611
  end
1435
1612
 
1436
1613
  # Draw an image into a given rectangular area.
1437
- # @param xmin [Numeric] First corner point of the rectangle
1438
- # @param ymin [Numeric] First corner point of the rectangle
1439
- # @param xmax [Numeric] Second corner point of the rectangle
1440
- # @param ymax [Numeric] Second corner point of the rectangle
1441
- # @param width [Integer] The width and the height of the image
1614
+ #
1615
+ # The points (`xmin`, `ymin`) and (`xmax`, `ymax`) are world coordinates
1616
+ # defining diagonally opposite corner points of a rectangle. This rectangle
1617
+ # is divided into `width` by `height` cells. The two-dimensional array `data`
1618
+ # specifies colors for each cell.
1619
+ #
1620
+ # @param xmin [Numeric] First corner point of the rectangle
1621
+ # @param ymin [Numeric] First corner point of the rectangle
1622
+ # @param xmax [Numeric] Second corner point of the rectangle
1623
+ # @param ymax [Numeric] Second corner point of the rectangle
1624
+ # @param width [Integer] The width and the height of the image
1442
1625
  # @param height [Integer] The width and the height of the image
1443
- # @param data [Array, NArray] An array of color values dimensioned `width` by `height`
1444
- # @param model [Integer] Color model ( default = 0 )
1626
+ # @param data [Array, NArray] An array of color values dimensioned `width` by `height`
1627
+ # @param model [Integer] Color model ( default = 0 )
1445
1628
  # The available color models are:
1446
- # * 0 : MODEL_RGB
1447
- # * AABBGGRR
1448
- # * 1 : MODEL_HSV
1449
- # * AAVVSSHH
1450
- # The points (`xmin`, `ymin`) and (`xmax`, `ymax`) are world coordinates defining
1451
- # diagonally opposite corner points of a rectangle. This rectangle is divided into
1452
- # `width` by `height` cells. The two-dimensional array `data` specifies colors
1453
- # for each cell.
1629
+ # * 0 : MODEL_RGB - AABBGGRR
1630
+ # * 1 : MODEL_HSV - AAVVSSHH
1631
+ #
1454
1632
  def drawimage(xmin, xmax, ymin, ymax, width, height, data, model = 0)
1455
1633
  super(xmin, xmax, ymin, ymax, width, height, uint(data), model)
1456
1634
  end
1457
1635
 
1458
1636
  # @return [Integer]
1459
- def importgraphics(*)
1460
- super
1461
- end
1637
+ # @!method importgraphics
1462
1638
 
1463
- # `setshadow` allows drawing of shadows, realized by images painted underneath,
1464
- # and offset from, graphics objects such that the shadow mimics the effect of a light
1465
- # source cast on the graphics objects.
1639
+ # `setshadow` allows drawing of shadows, realized by images painted
1640
+ # underneath, and offset from, graphics objects such that the shadow mimics
1641
+ # the effect of a light source cast on the graphics objects.
1642
+ #
1466
1643
  # @param offsetx [Numeric]
1467
1644
  # An x-offset, which specifies how far in the horizontal direction the
1468
1645
  # shadow is offset from the object
@@ -1471,18 +1648,19 @@ module GR
1471
1648
  # is offset from the object
1472
1649
  # @param blur [Numeric]
1473
1650
  # A blur value, which specifies whether the object has a hard or a diffuse edge
1474
- def setshadow(*)
1475
- super
1476
- end
1651
+ #
1652
+ # @!method setshadow
1477
1653
 
1478
1654
  # Set the value of the alpha component associated with GR colors.
1655
+ #
1479
1656
  # @param alpha [Numeric] An alpha value (0.0 - 1.0)
1480
- def settransparency(*)
1481
- super
1482
- end
1657
+ #
1658
+ # @!method settransparency
1483
1659
 
1484
1660
  # Change the coordinate transformation according to the given matrix.
1661
+ #
1485
1662
  # @param mat [Array, NArray] 2D transformation matrix
1663
+ #
1486
1664
  def setcoordxform(mat)
1487
1665
  raise if mat.size != 6
1488
1666
 
@@ -1490,17 +1668,15 @@ module GR
1490
1668
  end
1491
1669
 
1492
1670
  # Open a file for graphics output.
1671
+ #
1493
1672
  # @param path [String] Filename for the graphics file.
1494
- # `begingraphics` allows to write all graphics output into a XML-formatted file until
1495
- # the `endgraphics` functions is called. The resulting file may later be imported with
1496
- # the `importgraphics` function.
1497
- def begingraphics(*)
1498
- super
1499
- end
1673
+ # `begingraphics` allows to write all graphics output into a XML-formatted
1674
+ # file until the `endgraphics` functions is called. The resulting file may
1675
+ # later be imported with the `importgraphics` function.
1676
+ #
1677
+ # @!method begingraphics
1500
1678
 
1501
- def endgraphics(*)
1502
- super
1503
- end
1679
+ # @!method endgraphics
1504
1680
 
1505
1681
  # @return [String]
1506
1682
  def getgraphics(*)
@@ -1508,18 +1684,16 @@ module GR
1508
1684
  end
1509
1685
 
1510
1686
  # @return [Integer]
1511
- def drawgraphics(*)
1512
- super
1513
- end
1687
+ # @!method drawgraphics
1514
1688
 
1515
- # Generate a character string starting at the given location. Strings can be defined
1516
- # to create mathematical symbols and Greek letters using LaTeX syntax.
1517
- # @param x [Numeric] Position of the text string specified in world coordinates
1518
- # @param y [Numeric] Position of the text string specified in world coordinates
1689
+ # Generate a character string starting at the given location. Strings can be
1690
+ # defined to create mathematical symbols and Greek letters using LaTeX syntax.
1691
+ #
1692
+ # @param x [Numeric] X coordinate of the starting position of the text string
1693
+ # @param y [Numeric] Y coordinate of the starting position of the text string
1519
1694
  # @param string [String] The text string to be drawn
1520
- def mathtex(*)
1521
- super
1522
- end
1695
+ #
1696
+ # @!method mathtex
1523
1697
 
1524
1698
  # inqmathtex
1525
1699
  def inqmathtex(x, y, string)
@@ -1528,21 +1702,13 @@ module GR
1528
1702
  end
1529
1703
  end
1530
1704
 
1531
- def beginselection(*)
1532
- super
1533
- end
1705
+ # @!method beginselection
1534
1706
 
1535
- def endselection(*)
1536
- super
1537
- end
1707
+ # @!method endselection
1538
1708
 
1539
- def moveselection(*)
1540
- super
1541
- end
1709
+ # @!method moveselection
1542
1710
 
1543
- def resizeselection(*)
1544
- super
1545
- end
1711
+ # @!method resizeselection
1546
1712
 
1547
1713
  def inqbbox
1548
1714
  inquiry %i[double double double double] do |*pts|
@@ -1551,39 +1717,23 @@ module GR
1551
1717
  end
1552
1718
 
1553
1719
  # @return [Numeric]
1554
- def precision(*)
1555
- super
1556
- end
1720
+ # @!method precision
1557
1721
 
1558
- def setregenflags(*)
1559
- super
1560
- end
1722
+ # @!method setregenflags
1561
1723
 
1562
1724
  # @return [Integer]
1563
- def inqregenflags(*)
1564
- super
1565
- end
1725
+ # @!method inqregenflags
1566
1726
 
1567
- def savestate(*)
1568
- super
1569
- end
1727
+ # @!method savestate
1570
1728
 
1571
- def restorestate(*)
1572
- super
1573
- end
1729
+ # @!method restorestate
1574
1730
 
1575
- def selectcontext(*)
1576
- super
1577
- end
1731
+ # @!method selectcontext
1578
1732
 
1579
- def destroycontext(*)
1580
- super
1581
- end
1733
+ # @!method destroycontext
1582
1734
 
1583
1735
  # @return [Integer]
1584
- def uselinespec(*)
1585
- super
1586
- end
1736
+ # @!method uselinespec
1587
1737
 
1588
1738
  def delaunay(x, y)
1589
1739
  # Feel free to make a pull request if you catch a mistake
@@ -1606,6 +1756,11 @@ module GR
1606
1756
  end
1607
1757
 
1608
1758
  # Reduces the number of points of the x and y array.
1759
+ #
1760
+ # @param n [Integer] The requested number of points
1761
+ # @param x [Array, NArray] The x value array
1762
+ # @param y [Array, NArray] The y value array
1763
+ #
1609
1764
  def reducepoints(xd, yd, n)
1610
1765
  nd = equal_length(xd, yd)
1611
1766
  inquiry [{ double: n }, { double: n }] do |x, y|
@@ -1615,9 +1770,11 @@ module GR
1615
1770
  end
1616
1771
 
1617
1772
  # Draw a triangular surface plot for the given data points.
1773
+ #
1618
1774
  # @param x [Array, NArray] A list containing the X coordinates
1619
1775
  # @param y [Array, NArray] A list containing the Y coordinates
1620
1776
  # @param z [Array, NArray] A list containing the Z coordinates
1777
+ #
1621
1778
  def trisurface(x, y, z)
1622
1779
  n = [x, y, z].map(&:length).min
1623
1780
  super(n, x, y, z)
@@ -1634,6 +1791,7 @@ module GR
1634
1791
  end
1635
1792
 
1636
1793
  # Draw a quiver plot on a grid of nx*ny points.
1794
+ #
1637
1795
  # @param nx [Integer] The number of points along the x-axis of the grid
1638
1796
  # @param ny [Integer] The number of points along the y-axis of the grid
1639
1797
  # @param x [Array, NArray] A list containing the X coordinates
@@ -1643,7 +1801,9 @@ module GR
1643
1801
  # @param color [Integer]
1644
1802
  # A bool to indicate whether or not the arrows should be colored using
1645
1803
  # the current colormap
1804
+ #
1646
1805
  # The values for `x` and `y` are in world coordinates.
1806
+ #
1647
1807
  def quiver(x, y, u, v, color)
1648
1808
  # TODO: check: Arrays have incorrect length or dimension.
1649
1809
  nx = x.length
@@ -1655,22 +1815,20 @@ module GR
1655
1815
  # input points are located on a grid, described by `x`, `y` and `z`.
1656
1816
  # The target grid ist described by `xq` and `yq`.
1657
1817
  # Returns an array containing the resulting z-values.
1658
- # @param x [Array, NArray] Array containing the input grid's x-values
1659
- # @param y [Array, NArray] Array containing the input grid's y-values
1660
- # @param z [Array, NArray] Array containing the input grid's z-values (number of values: nx * ny)
1818
+ #
1819
+ # @param x [Array, NArray] Array containing the input grid's x-values
1820
+ # @param y [Array, NArray] Array containing the input grid's y-values
1821
+ # @param z [Array, NArray] Array containing the input grid's z-values (number of values: nx * ny)
1661
1822
  # @param xq [Array, NArray] Array containing the target grid's x-values
1662
1823
  # @param yq [Array, NArray] Array containing the target grid's y-values
1663
1824
  # @param method [Integer] Used method for interpolation
1664
1825
  # The available methods for interpolation are the following:
1665
- # * 0 : INTERP2_NEAREST
1666
- # * Nearest neighbour interpolation
1667
- # * 1 : INTERP2_LINEAR
1668
- # * Linear interpolation
1669
- # * 2 : INTERP_2_SPLINE
1670
- # * Interpolation using natural cubic splines
1671
- # * 3 : INTERP2_CUBIC
1672
- # * Cubic interpolation
1826
+ # * 0 : INTERP2_NEAREST - Nearest neighbour interpolation
1827
+ # * 1 : INTERP2_LINEAR - Linear interpolation
1828
+ # * 2 : INTERP_2_SPLINE - Interpolation using natural cubic splines
1829
+ # * 3 : INTERP2_CUBIC - Cubic interpolation
1673
1830
  # @param extrapval [Numeric] The extrapolation value
1831
+ #
1674
1832
  def interp2(x, y, z, xq, yq, method, extrapval) # flatten
1675
1833
  nx = x.length
1676
1834
  ny = y.length
@@ -1683,34 +1841,34 @@ module GR
1683
1841
  end
1684
1842
 
1685
1843
  # Returns the combined version strings of the GR runtime.
1844
+ #
1686
1845
  # @return [String]
1687
1846
  def version
1688
1847
  super.to_s
1689
1848
  end
1690
1849
 
1691
- def shade(*)
1692
- super
1693
- end
1850
+ # @note `hexbin` is overwritten by `require gr/plot`.
1851
+ # The original method is moved to the underscored name.
1852
+ # The yard document will show the method name after evacuation.
1853
+ #
1854
+ # @!method shade
1694
1855
 
1695
1856
  # Display a point set as a aggregated and rasterized image.
1696
- # @param x [Array, NArray] A pointer to the X coordinates
1697
- # @param y [Array, NArray] A pointer to the Y coordinates
1698
- # @param dims [Array, NArray] The size of the grid used for rasterization
1699
- # @param xform [Integer] The transformation type used for color mapping
1700
- # The available transformation types are:
1701
- # * 0 : XFORM_BOOLEAN
1702
- # * boolean
1703
- # * 1 : XFORM_LINEAR
1704
- # * linear
1705
- # * 2 : XFORM_LOG
1706
- # * logarithmic
1707
- # * 3 : XFORM_LOGLOG
1708
- # * double logarithmic
1709
- # * 4 : XFORM_CUBIC
1710
- # * cubic
1711
- # * 5 : XFORM_EQUALIZED
1712
- # * histogram equalized
1857
+ #
1713
1858
  # The values for `x` and `y` are in world coordinates.
1859
+ #
1860
+ # @param x [Array, NArray] A pointer to the X coordinates
1861
+ # @param y [Array, NArray] A pointer to the Y coordinates
1862
+ # @param dims [Array, NArray] The size of the grid used for rasterization
1863
+ # @param xform [Integer] The transformation type used for color mapping
1864
+ # The available transformation types are:
1865
+ # * 0 : XFORM_BOOLEAN - boolean
1866
+ # * 1 : XFORM_LINEAR - linear
1867
+ # * 2 : XFORM_LOG - logarithmic
1868
+ # * 3 : XFORM_LOGLOG - double logarithmic
1869
+ # * 4 : XFORM_CUBIC - cubic
1870
+ # * 5 : XFORM_EQUALIZED - histogram equalized
1871
+ #
1714
1872
  def shadepoints(x, y, dims: [1200, 1200], xform: 1)
1715
1873
  n = x.length
1716
1874
  w, h = dims
@@ -1718,31 +1876,34 @@ module GR
1718
1876
  end
1719
1877
 
1720
1878
  # Display a line set as an aggregated and rasterized image.
1721
- # @param x [Array, NArray] A pointer to the X coordinates
1722
- # @param y [Array, NArray] A pointer to the Y coordinates
1723
- # @param dims [Array, NArray] The size of the grid used for rasterization
1724
- # @param xform [Integer] The transformation type used for color mapping
1725
- # The available transformation types are:
1726
- # * 0 : XFORM_BOOLEAN
1727
- # * boolean
1728
- # * 1 : XFORM_LINEAR
1729
- # * linear
1730
- # * 2 : XFORM_LOG
1731
- # * logarithmic
1732
- # * 3 : XFORM_LOGLOG
1733
- # * double logarithmic
1734
- # * 4 : XFORM_CUBIC
1735
- # * cubic
1736
- # * 5 : XFORM_EQUALIZED
1737
- # * histogram equalized
1879
+ #
1738
1880
  # The values for `x` and `y` are in world coordinates.
1739
1881
  # NaN values can be used to separate the point set into line segments.
1882
+ #
1883
+ # @param x [Array, NArray] A pointer to the X coordinates
1884
+ # @param y [Array, NArray] A pointer to the Y coordinates
1885
+ # @param dims [Array, NArray] The size of the grid used for rasterization
1886
+ # @param xform [Integer] The transformation type used for color mapping
1887
+ # The available transformation types are:
1888
+ # * 0 : XFORM_BOOLEAN - boolean
1889
+ # * 1 : XFORM_LINEAR - linear
1890
+ # * 2 : XFORM_LOG - logarithmic
1891
+ # * 3 : XFORM_LOGLOG - double logarithmic
1892
+ # * 4 : XFORM_CUBIC - cubic
1893
+ # * 5 : XFORM_EQUALIZED - histogram equalized
1894
+ #
1740
1895
  def shadelines(x, y, dims: [1200, 1200], xform: 1)
1741
1896
  n = x.length
1742
1897
  w, h = dims
1743
1898
  super(n, x, y, xform, w, h)
1744
1899
  end
1745
1900
 
1901
+ # @note This method uses GRCommons::Fiddley::Function as a callback function.
1902
+ # Please read the source code If you have to use it.
1903
+ # This method is not sure if it works properly.
1904
+ #
1905
+ # @!method findboundary
1906
+
1746
1907
  # panzoom
1747
1908
  def panzoom(x, y, zoom)
1748
1909
  inquiry %i[double double double double] do |xmin, xmax, ymin, ymax|
@@ -1750,7 +1911,8 @@ module GR
1750
1911
  end
1751
1912
  end
1752
1913
 
1753
- # Set the resample method used for gr.drawimage().
1914
+ # Set the resample method used for `drawimage`.
1915
+ #
1754
1916
  # @param resample_method [Integer] the new resample method.
1755
1917
  # The available options are:
1756
1918
  # * 0x00000000 : RESAMPLE_DEFAULT
@@ -1761,7 +1923,8 @@ module GR
1761
1923
  # * linear
1762
1924
  # * 0x03030303 : RESAMPLE_LANCZOS
1763
1925
  # * Lanczos
1764
- # Alternatively, combinations of these methods can be selected for horizontal or vertical upsampling or downsampling:
1926
+ # Alternatively, combinations of these methods can be selected for
1927
+ # horizontal or vertical upsampling or downsampling:
1765
1928
  # * 0x00000000 : UPSAMPLE_VERTICAL_DEFAULT
1766
1929
  # * default for vertical upsampling
1767
1930
  # * 0x00000000 : UPSAMPLE_HORIZONTAL_DEFAULT
@@ -1794,11 +1957,12 @@ module GR
1794
1957
  # * lanczos for vertical downsampling
1795
1958
  # * 0x03000000 : DOWNSAMPLE_HORIZONTAL_LANCZOS
1796
1959
  # * lanczos for horizontal downsampling
1797
- def setresamplemethod(*)
1798
- super
1799
- end
1960
+ #
1961
+ # @!method setresamplemethod
1800
1962
 
1801
- # Inquire the resample method used for gr.drawimage().
1963
+ # Inquire the resample method used for `drawimage`
1964
+ #
1965
+ # @return [Integer] Resample flag
1802
1966
  def inqresamplemethod
1803
1967
  inquiry_uint do |resample_method|
1804
1968
  super(resample_method)
@@ -1806,6 +1970,7 @@ module GR
1806
1970
  end
1807
1971
 
1808
1972
  # Draw paths using the given vertices and path codes.
1973
+ #
1809
1974
  # @param x [Array, NArray] A list containing the X coordinates
1810
1975
  # @param y [Array, NArray] A list containing the Y coordinates
1811
1976
  # @param codes [String] A list containing the path codes
@@ -1830,128 +1995,133 @@ module GR
1830
1995
  # * close path and fill -
1831
1996
  # * F
1832
1997
  # * close path, fill and stroke -
1998
+ #
1833
1999
  # See https://gr-framework.org/python-gr.html#gr.path for more details.
2000
+ #
1834
2001
  def path(x, y, codes)
1835
2002
  n = equal_length(x, y)
1836
2003
  super(n, x, y, codes)
1837
2004
  end
1838
2005
 
1839
2006
  # Define the border width of subsequent path output primitives.
2007
+ #
1840
2008
  # @param width [Numeric] The border width scale factor
1841
- def setborderwidth(*)
1842
- super
1843
- end
2009
+ #
2010
+ # @!method setborderwidth
1844
2011
 
1845
2012
  def inqborderwidth
1846
2013
  inquiry_double { |pt| super(pt) }
1847
2014
  end
1848
2015
 
1849
2016
  # Define the color of subsequent path output primitives.
2017
+ #
1850
2018
  # @param color [Integer] The border color index (COLOR < 1256)
1851
- def setbordercolorind(*)
1852
- super
1853
- end
2019
+ #
2020
+ # @!method setbordercolorind
1854
2021
 
1855
2022
  def inqbordercolorind
1856
2023
  inquiry_int { |pt| super(pt) }
1857
2024
  end
1858
2025
 
1859
2026
  # Set the projection type with this flag.
2027
+ #
1860
2028
  # @param flag [Integer] projection type
1861
2029
  # The available options are:
1862
- # * 0 : GR_PROJECTION_DEFAULT
1863
- # * default
1864
- # * 1 : GR_PROJECTION_ORTHOGRAPHIC
1865
- # * orthographic
1866
- # * 2 : GR_PROJECTION_PERSPECTIVE
1867
- # * perspective
1868
- def setprojectiontype(*)
1869
- super
1870
- end
2030
+ # * 0 : GR_PROJECTION_DEFAULT - default
2031
+ # * 1 : GR_PROJECTION_ORTHOGRAPHIC - orthographic
2032
+ # * 2 : GR_PROJECTION_PERSPECTIVE - perspective
2033
+ #
2034
+ # @!method setprojectiontype
1871
2035
 
1872
2036
  # Return the projection type.
1873
2037
  def inqprojectiontype
1874
2038
  inquiry_int { |pt| super(pt) }
1875
2039
  end
1876
2040
 
2041
+ # Set the far and near clipping plane for perspective projection and the
2042
+ # vertical field ov view.
2043
+ # Switches projection type to perspective.
2044
+ #
2045
+ # @param near_plane [Numeric] distance to near clipping plane
2046
+ # @param far_plane [Numeric] distance to far clipping plane
2047
+ # @param fov [Numeric] vertical field of view,
2048
+ # input must be between 0 and 180 degrees
2049
+ #
2050
+ # @!method setperspectiveprojection
2051
+
2052
+ # Return the parameters for the perspective projection.
2053
+ def inqperspectiveprojection
2054
+ inquiry %i[double double double] do |*pts|
2055
+ super(*pts)
2056
+ end
2057
+ end
2058
+
1877
2059
  # Method to set the camera position, the upward facing direction and the
1878
2060
  # focus point of the shown volume.
1879
- # @param camera_pos_x [Numeric] x component of the cameraposition in world coordinates
1880
- # @param camera_pos_y [Numeric] y component of the cameraposition in world coordinates
1881
- # @param camera_pos_z [Numeric] z component of the cameraposition in world coordinates
1882
- # @param up_x [Numeric] x component of the up vector
1883
- # @param up_y [Numeric] y component of the up vector
1884
- # @param up_z [Numeric] z component of the up vector
2061
+ #
2062
+ # @param camera_pos_x [Numeric] x component of the cameraposition in world coordinates
2063
+ # @param camera_pos_y [Numeric] y component of the cameraposition in world coordinates
2064
+ # @param camera_pos_z [Numeric] z component of the cameraposition in world coordinates
2065
+ # @param up_x [Numeric] x component of the up vector
2066
+ # @param up_y [Numeric] y component of the up vector
2067
+ # @param up_z [Numeric] z component of the up vector
1885
2068
  # @param focus_point_x [Numeric] x component of focus-point inside volume
1886
2069
  # @param focus_point_y [Numeric] y component of focus-point inside volume
1887
2070
  # @param focus_point_z [Numeric] z component of focus-point inside volume
1888
- def settransformationparameters(*)
1889
- super
1890
- end
2071
+ #
2072
+ # @!method settransformationparameters
1891
2073
 
1892
2074
  # Return the camera position, up vector and focus point.
2075
+ #
1893
2076
  def inqtransformationparameters
1894
2077
  inquiry([:double] * 9) do |*pts|
1895
2078
  super(*pts)
1896
2079
  end
1897
2080
  end
1898
2081
 
1899
- # Set the far and near clipping plane for perspective projection and the
1900
- # vertical field ov view.
1901
- # Switches projection type to perspective.
1902
- # @param near_plane [Numeric] distance to near clipping plane
1903
- # @param far_plane [Numeric] distance to far clipping plane
1904
- # @param fov [Numeric] vertical field of view, input must be between 0 and 180 degrees
1905
- def setperspectiveprojection(*)
1906
- super
1907
- end
1908
-
1909
- # Return the parameters for the perspective projection.
1910
- def inqperspectiveprojection
1911
- inquiry %i[double double double] do |*pts|
1912
- super(*pts)
1913
- end
1914
- end
1915
-
1916
2082
  # Set parameters for orthographic transformation.
1917
2083
  # Switches projection type to orthographic.
1918
- # @param left [Numeric] xmin of the volume in worldcoordinates
1919
- # @param right [Numeric] xmax of volume in worldcoordinates
1920
- # @param bottom [Numeric] ymin of volume in worldcoordinates
1921
- # @param top [Numeric] ymax of volume in worldcoordinates
2084
+ #
2085
+ # @param left [Numeric] xmin of the volume in worldcoordinates
2086
+ # @param right [Numeric] xmax of volume in worldcoordinates
2087
+ # @param bottom [Numeric] ymin of volume in worldcoordinates
2088
+ # @param top [Numeric] ymax of volume in worldcoordinates
1922
2089
  # @param near_plane [Numeric] distance to near clipping plane
1923
- # @param far_plane [Numeric] distance to far clipping plane
1924
- def setorthographicprojection(*)
1925
- super
1926
- end
2090
+ # @param far_plane [Numeric] distance to far clipping plane
2091
+ #
2092
+ # @!method setorthographicprojection
1927
2093
 
1928
2094
  # Return the camera position, up vector and focus point.
2095
+ #
1929
2096
  def inqorthographicprojection
1930
2097
  inquiry([:double] * 6) do |*pts|
1931
2098
  super(*pts)
1932
2099
  end
1933
2100
  end
1934
2101
 
1935
- # Interface for interaction with the rotation of the model.
1936
- # For this a virtual Arcball is used.
2102
+ # Rotate the current scene according to a virtual arcball.
2103
+ #
2104
+ # This function requires values between 0 (left side or bottom of the drawing
2105
+ # area) and 1 (right side or top of the drawing area).
2106
+ #
1937
2107
  # @param start_mouse_pos_x [Numeric] x component of the start mouse position
1938
2108
  # @param start_mouse_pos_y [Numeric] y component of the start mouse position
1939
- # @param end_mouse_pos_x [Numeric] x component of the end mouse position
1940
- # @param end_mouse_pos_y [Numeric] y component of the end mouse position
1941
- def camerainteraction(*)
1942
- super
1943
- end
2109
+ # @param end_mouse_pos_x [Numeric] x component of the end mouse position
2110
+ # @param end_mouse_pos_y [Numeric] y component of the end mouse position
2111
+ #
2112
+ # @!method camerainteraction
1944
2113
 
1945
- # Set the three dimensional window. Only used for perspective and orthographic projection.
2114
+ # Set the three dimensional window.
2115
+ # Only used for perspective and orthographic projection.
2116
+ #
1946
2117
  # @param xmin [Numeric] min x-value
1947
2118
  # @param xmax [Numeric] max x-value
1948
2119
  # @param ymin [Numeric] min y-value
1949
2120
  # @param ymax [Numeric] max y-value
1950
2121
  # @param zmin [Numeric] min z-value
1951
2122
  # @param zmax [Numeric] max z-value
1952
- def setwindow3d(*)
1953
- super
1954
- end
2123
+ #
2124
+ # @!method setwindow3d
1955
2125
 
1956
2126
  # Return the three dimensional window.
1957
2127
  def inqwindow3d
@@ -1961,15 +2131,16 @@ module GR
1961
2131
  end
1962
2132
 
1963
2133
  # Set the scale factor for each axis. A one means no scale.
1964
- # All factor have to be != 0.
2134
+ # The scaling factors must not be zero. .
2135
+ #
1965
2136
  # @param x_axis_scale [Numeric] factor for scaling the x-axis
1966
2137
  # @param y_axis_scale [Numeric] factor for scaling the y-axis
1967
2138
  # @param z_axis_scale [Numeric] factor for scaling the z-axis
1968
- def setscalefactors3d(*)
1969
- super
1970
- end
2139
+ #
2140
+ # @!method setscalefactors3d
1971
2141
 
1972
2142
  # Returns the scale factors for each axis.
2143
+ #
1973
2144
  def inqscalefactors3d
1974
2145
  inquiry %i[double double double] do |*opts|
1975
2146
  super(*opts)
@@ -1977,24 +2148,23 @@ module GR
1977
2148
  end
1978
2149
 
1979
2150
  # Set the camera for orthographic or perspective projection.
2151
+ #
1980
2152
  # The center of the 3d window is used as the focus point and the camera is
1981
2153
  # positioned relative to it, using camera distance, rotation and tilt similar
1982
- # to gr_setspace. This function can be used if the user prefers spherical
2154
+ # to `setspace`. This function can be used if the user prefers spherical
1983
2155
  # coordinates to setting the camera position directly, but has reduced
1984
2156
  # functionality in comparison to GR.settransformationparameters,
1985
2157
  # GR.setperspectiveprojection and GR.setorthographicprojection.
2158
+ #
1986
2159
  # @param phi [Numeric] azimuthal angle of the spherical coordinates
1987
2160
  # @param theta [Numeric] polar angle of the spherical coordinates
1988
2161
  # @param fov [Numeric] vertical field of view (0 or NaN for orthographic projection)
1989
2162
  # @param camera_distance [Numeric] distance between the camera and the focus point
1990
2163
  # (0 or NaN for the radius of the object's smallest bounding sphere)
1991
- def setspace3d(*)
1992
- super
1993
- end
2164
+ #
2165
+ # @!method setspace3d
1994
2166
 
1995
- def text3d(*)
1996
- super
1997
- end
2167
+ # @!method text3d
1998
2168
 
1999
2169
  def inqtext3d(x, y, z, string, axis)
2000
2170
  inquiry [{ double: 16 }, { double: 16 }] do |tbx, tby|
@@ -2002,9 +2172,7 @@ module GR
2002
2172
  end
2003
2173
  end
2004
2174
 
2005
- def settextencoding(*)
2006
- super
2007
- end
2175
+ # @!method settextencoding
2008
2176
 
2009
2177
  def inqtextencoding
2010
2178
  inquiry_int do |encoding|