module NumRu::GGraph and others in ggraph.rb

Index

class NumRu::GPhys (methods added)

The following methods are added to GPhys.

Instance Methods

first1D

Returns a 1D subset selecting the first elements of 2nd, 3rd, .. dimensions, i.e., self[true, 0, 0, ...].

ARGUMENTS

RETURN VALUE

first2D

Returns a 2D subset selecting the first elements of 3rd, 4th, .. dimensions, i.e., self[true, true, 0, 0, ...].

ARGUMENTS

RETURN VALUE

module NumRu::GGraph

A graphic library for GPhys using RubyDCL.

This module uses GPhys but is not a part of it. More specifically, even though this module is included in the GPhys distribution, the class NumRu::GPhys knows nothing about it, and GGraph accesses GPhys only though public methods. So GGraph is not an insider, and you can make another graphic library if you like.

Module Functions

title(string)

Shows title by DCL.uxmttl('t',string,0.0). Graphic methods such as contour calls this by default.

RETURN VALUE

annotate(str_ary)

Show texts on the right margin of the viewport. Graphic methods such as contour calls this by default.

ARGUMENTS

RETURN VALUE

fig(xax, yax, options=nil)

Define a figure by setting viewport, window, and coordinate transform id (itr) from two 1D VArrays xax and yax.

DCL.grfrm or DCL.grfig is called depending options provided.

ARGUMENTS

RETURN VALUE

POSSIBLE EXCEPTIONS

set_fig(options)

Change the default option values for fig.

ARGUMENTS

RETURN VALUE

POSSIBLE EXCEPTIONS

next_fig(options)

Set the option values effective only in the next call of fig (cleared then).

These value are overwritten if specified explicitly in the next call of fig.

ARGUMENTS

RETURN VALUE

POSSIBLE EXCEPTIONS

axes(xax=nil, yax=nil, options=nil)

Draw axes using (by default) info in xax and yax if non-nil.

ARGUMENTS

RETURN VALUE

POSSIBLE EXCEPTIONS

set_axes(options)

Change the default option values for axes.

ARGUMENTS

RETURN VALUE

POSSIBLE EXCEPTIONS

next_axes(options)

Set the option values effective only in the next call of axes (cleared then).

These value are overwritten if specified explicitly in the next call of axes.

ARGUMENTS

RETURN VALUE

POSSIBLE EXCEPTIONS

line(gphys, newframe=true, options=nil)

Plot a poly-line by selecting the first dimension (with first1D) if gphys is more than 2D.

ARGUMENTS

RETURN VALUE

mark(gphys, newframe=true, options=nil)

Similar to line but plots marks instead of drawing a poly-line.

ARGUMENTS

RETURN VALUE

contour(gphys, newframe=true, options=nil)

Contour plot by selecting the first 2 dimensions (with first2D) if gphys is more than 3D.

Contour levels are determined as follows:

ARGUMENTS

RETURN VALUE

set_contour_levels(options)

Set contour levels for contour explicitly by values with the option levels.

ARGUMENTS

clear_contour_levels

Clear contour levels set by set_contour_levels.

set_linear_contour_options(options)

Change the default option values regarding linear contour level setting in contour.

ARGUMENTS

RETURN VALUE

next_linear_contour_options(options)

Similar to set_linear_contour_options but the setting is effective only for the next call of contour.

tone(gphys, newframe=true, options=nil)

Color tone or shading by selecting the first 2 dimensions (with first2D) if gphys is more than 3D.

Tone levels are determined as follows:

ARGUMENTS

RETURN VALUE

set_tone_levels(options)

Set tone levels for tone explicitly by values.

ARGUMENTS

clear_tone_levels

Clear tone levels set by set_tone_levels.

set_linear_tone_options(options)

Change the default option values regarding linear tone level setting in tone.

ARGUMENTS

RETURN VALUE

next_linear_tone_options(options)

Similar to set_linear_tone_options but the setting is effective only for the next call of tone.

module NumRu::DCLExt

Collection of various compound DCL functions for convenience. This module is to be separated but temporarily included in ggraph.rb while it is premature.

Index

MATH1

GRPH1

GRPH2

Module Functions

glpack

gl_set_params(hash)

Calls DCL.glpset multiple times (for each key and val of hash).

ARGUMENTS

RETURN VALUE

EXAMPLES

sgpack

sg_set_params(hash)

Calls DCL.sgpset multiple times (for each key and val of hash).

See gl_set_params for usage.

slpack

sl_set_params(hash)

Calls DCL.slpset multiple times (for each key and val of hash).

See gl_set_params for usage.

swpack

sw_set_params(hash)

Calls DCL.swpset multiple times (for each key and val of hash).

See gl_set_params for usage.

uzpack

uz_set_params(hash)

Calls DCL.uzpset multiple times (for each key and val of hash).

See gl_set_params for usage.

ulpack

ul_set_params(hash)

Calls DCL.ulpset multiple times (for each key and val of hash).

See gl_set_params for usage.

ucpack

uc_set_params(hash)

Calls DCL.ucpset multiple times (for each key and val of hash).

See gl_set_params for usage.

uupack

uu_set_params(hash)

Calls DCL.uupset multiple times (for each key and val of hash).

See gl_set_params for usage.

uspack

us_set_params(hash)

Calls DCL.uspset multiple times (for each key and val of hash).

See gl_set_params for usage.

udpack

ud_set_params(hash)

Calls DCL.udpset multiple times (for each key and val of hash).

ARGUMENTS

RETURN VALUE

EXAMPLES

ud_set_linear_levs(v, options)

Set contour levels with a constant interval

ARGUMENTS

ud_set_contour(levels,index=nil,line_type=nil,label=nil,label_height=nil)

Set contours of at specified levels.

Normally you do not have to specify label and label_height.

It calls DCL.udsclv for each level. So the arguments are basically the same as DCL.udsclv, but only levels are mandatory here.

ARGUMENTS

If nil, the value of 'indxmn' is used.

RETURN VALUE

ud_add_contour(levels,index=nil,line_type=nil,label=nil,label_height=nil)

Same as ud_set_contour, but does not clear the contour levels that have been set.

uepack

ue_set_params(hash)

Calls DCL.uepset multiple times (for each key and val of hash).

See gl_set_params for usage.

ue_set_linear_levs(v, options)

Set tone levels with a constant interval

ARGUMENTS

ue_set_tone(levels, patterns)

Set tone levels and patterns.

patterns are set between levels as follows:

when (levels.length == patterns.length+1)

  levels[0]  |  levels[1]  |  levels[2]  ...  |  levels[-2]  |  levels[-1]
         patterns[0]   patterns[1]   ...  patterns[-2]   patterns[-1]

when (levels.length == patterns.length)

  levels[0]  |  levels[1]  |  levels[2]  ...  |  levels[-1]  |  +infty
         patterns[0]   patterns[1]   ...  patterns[-2]   patterns[-1]

when (levels.length == patterns.length-1)

  -infty  |  levels[0]  |  levels[1]  ...  |  levels[-1]  |  +infty
      patterns[0]   patterns[1]   ...  patterns[-2]   patterns[-1]

else
  error (exception raised)

ARGUMENTS

RETURN VALUE

ue_add_tone(levels, patterns)

Same as ue_set_tone, but does not clear the tone levels that have been set.

ugpack

ug_set_params(hash)

Calls DCL.ugpset multiple times (for each key and val of hash). See gl_set_params for usage.

umpack

um_set_params(hash)

Calls DCL.umpset multiple times (for each key and val of hash).

See gl_set_params for usage.