-
-
Notifications
You must be signed in to change notification settings - Fork 7
API Overview
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.
require 'gr/plot'
GR.plot(x, y)
List of available 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. Keep in mind that these changes is not available in the yard document at the moment.
2-D Plots and common 3-D Plots.
require 'gr'
# For example
GR.setviewport(0.1, 0.9, 0.1, 0.9)
GR.setwindow(0.0, 20.0, 0.0, 20.0)
Note: The GR module does not depend on numo-narray. So even if you cannot compile native extensions for some reason, you can still use GR module. In that case, edit the gemspec and remove the numo-narray from the dependency.
Complex 3D scenes.
require 'gr3'
# For example
GR3.cameralookat(-3, 2, -2, 0, 0, 0, 0, 0, -1)
under development.
User's Guide
Simple, matlab-style API
- Plotting functions
- Plot attributes
- Multiple plots
- Multiple subplots
- Save Plot to a file
- Jupyter Notebook
GR Native functions
For developers