🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

mathgl

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mathgl

0.1.1
Rubygems
Version published
Maintainers
1
Created
Source

Ruby/MathGL

Ruby wrapper of MathGL, made using SWIG.

MathGL is a library for scientific data visualization developed by Alexey Balakin.

(This package is under construction.)

Installation

  • Install MathGL2 library: http://mathgl.sourceforge.net/

  • Install Ruby/MathGL from source:

     ruby setup.rb config -- --with-mathgl-dir=/usr/local
     ruby setup.rb setup
     ruby setup.rb install
    

    Or install with gem:

     gem install mathgl -- --with-mathgl-dir=/usr/local
    

Usage

Write a plot to PNG file:

require 'mathgl'

prc = proc{
  x = (0..100).map{|i| i*0.1}
  y = x.map{|i| Math.sin(i)}
  set_ranges(0,10,-1,1)
  box
  axis
  plot(x,y)
}

gr = MathGL::MglGraph.new
gr.instance_eval(&prc)
gr.write_png("test.png","",false)

Display a plot on Qt window:

require 'mathgl'

prc = proc{
  x = (0..100).map{|i| i*0.1}
  y = x.map{|i| Math.sin(i)}
  set_ranges(0,10,-1,1)
  box
  axis
  plot(x,y)
}

qt = MathGL::MglQT.new(&prc)
qt.run

Version

  • MathGL 2.3.3
  • Ruby 2.3.0
  • CentOS 7.2

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

FAQs

Package last updated on 20 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts