File: pgline.rd

package info (click to toggle)
ruby-pgplot 0.1.3-6
  • links: PTS, VCS
  • area: contrib
  • in suites: wheezy
  • size: 480 kB
  • sloc: ruby: 1,382; ansic: 73; makefile: 37
file content (26 lines) | stat: -rw-r--r-- 511 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
=begin
= Ruby/PGPLOT example: pgline

=== code

  require 'narray'
  require 'pgplot'
  include Pgplot
  
  n = 100
  x = NArray.sfloat(n).indgen!/10
  y = NMath.sin(x)
  
  pgopen                 # open PGPLOT session
  pgenv 0, n/10, -1, 1   # set "Plotter Environment" and draw box.
  pglab "x", "y", "PGPLOT Example: y = sin(x)" 
  pgsci 2                # set Color Index = Red.
  pgslw 5                # set Line Width.
  pgline x, y            # plot Line.

=== output

<<< pgline.png

<<< trailer
=end