module NumRu::GGraph and others in ggraph.rb

Index

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

margin_info(program=nil, data_source=nil, char_height=nil, date=nil, xl=0.0, xr=0.0, yb=nil, yt=0.0)

Sets the strings to appear in the bottom margin.

This method sets margin widths as DCL.slmgn(xl, xr, yb, yt), and sets the 1st and 2nd margin strings as program and data.

ARGUMENTS

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=nil, yax=nil, options=nil)

Define a figure by setting viewport, window, and coordinate transform id (itr) from two 1D VArrays xax and yax (which are not needed if a map projection is specified with the optional parameter 'itr').

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

sim_trn?

Returns whether the current coordinate transformation is a rectangular curvelinear coordinate. A coordinate transformation must have been established with fig or DCL::grstrf. Mainly for internal usage, but a user can use it too.

RETURN VALUE

polar_coordinate_boundaries(xax=nil,yax=nil)

Draw boundaries in a polar coordinate.

ARGUMENTS

RETURN VALUE

map_trn?

Returns whether the current coordinate transformation is a map projection.

A coordinate transformation must have been established with fig or DCL::grstrf. Mainly for internal usage, but a user can use it too.

RETURN VALUE

map(options=nil)

(For map projection) Draws map grid and/or lim and/or coast lines etc.

ARGUMENTS

RETURN VALUE

POSSIBLE EXCEPTIONS

set_map(options)

Change the default option values for map.

ARGUMENTS

RETURN VALUE

POSSIBLE EXCEPTIONS

next_map(options)

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

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

ARGUMENTS

RETURN VALUE

POSSIBLE EXCEPTIONS

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

Plot a poly-line by selecting the first dimension (with GPhys#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

scatter(fx, fy, newframe=true, options=nil)

Scatter diagram (using uumrkz, as in mark).

ARGUMENTS

color_scatter(fx, fy, fz, newframe=true, options=nil)

Scatter diagram colored by values.

Coloring is made with respoect to fz just like in (<<tone>>). You can draw a color bar by calling (<<color_bar>>) after calling this method.

ARGUMENTS

add_mode_vectors(mean, modes, options)

This method overlays mode vectors on scatter plots. Call this method after scatter / color_scatter.

ARGUMENTS

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

Calls tone and contour successively. You can specify the options for any of these.

NOTE:

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

Contour plot by selecting the first 2 dimensions (with GPhys#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 GPhys#first2D) if gphys is more than 3D.

Tone levels are determined as follows:

ARGUMENTS

RETURN VALUE

color_bar (options=nil)

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.

set_unit_vect_options(options)

next_unit_vect_options(options)

vector(fx, fy, newframe=true, options=nil)

2-D vector plot using DCL_Ext::flow_vect, which scales vectors in physical ("U") coordinates.

ARGUMENTS

RETURN VALUE

set_regression_line(options)

Change the default option values for regression_line.

ARGUMENTS

RETURN VALUE

next_regression_line(options)

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

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

ARGUMENTS

RETURN VALUE

regression_line(x,y, options=nil)

Draw a linear regression line in the current viewport.

A figure must have been drawn. Good to call after scatter or color_scatter. You can also use this method after any scatter plot (passively under non-GPhys environment), since the argument x,y can be NArray etc unlike other draw methods in GGraph.

ARGUMENTS