Skip to content
kojix2 edited this page Jun 17, 2020 · 14 revisions

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. We are planning to prepare a more object-oriented interface based on GRUtils.jl in the future.

GR::Plot - A simple, matlab-style API.

require 'gr/plot'
GR.plot(x, y)

List of vailable functions.

plot step plot3 polar scatter scatter3 stem barplot histogram polarhistogram hexbin contour contourf tricont surface trisurf wireframe volume heatmap polarheatmap shade imshow isosurface

Note: When you do require 'gr/plot', Matlab-style methods are added to the GR module. And some native functions of GR modules will be overwritten by these methods.

GR - A module for calling native GR functions.

require 'gr'

# For example
GR.setviewport(0.1, 0.9, 0.1, 0.9)
GR.setwindow(0.0, 20.0, 0.0, 20.0)

GR3 - A module for calling native GR3 functions.

require 'gr3'

# For example
GR3.cameralookat(-3, 2, -2, 0, 0, 0, 0, 0, -1)

GRM

under development.

Clone this wiki locally