void configure() { ::configure(); set_creator("chaos"); set_command_type(Command_Type_Administrative); set_command_privilege_required(STANDARD); set_command_name("graph"); set_command_ooc(True); set_command_help_usage("graph [-c <columns>] [-r <rows>] <f(x)> [over <n>..<m>] [on <a>..<b>]"); set_command_help( "Constructs and displays a simple graph of a given mathematical " "function, specified as a function of the variable x. This command " "was developed for the convenience of lib designers working with " "interesting formulae (see the last two examples below).\n" "\fThe domain (input values) over which the function will be " "evaluated may be specified with the [over <n>..<m>] clause. The " "default is to evaluate over 0..1.\n" "\fThe range (output values) which the graph will cover may be " "specified with the [on <a>..<b>] clause. The default is to " "adaptively construct the range of the graph according to the " "range of values found for the function over the domain.\n" "\fThe -c option can be used to specify the number of columns in " "the graph (which determines the number and exact values of the " "points used within the domain). The default is to use your " "terminal columns - 10 (leaving room for labels and so on).\n" "\fThe -r option can be used to specify the number of rows in the " "graph. The default is to use your terminal rows - 10.\n" ); set_command_help_examples(({ "graph pow(x, 2)", " {{layout: deemphasis}Graph the square of X}", "graph sin(x) over 0..6.3", " {{layout: deemphasis}Graph a lovely sine curve}", "graph 1 / pow(x, 2) over 1..10 on 0..1", " {{layout: deemphasis}Graph 1 over X squared from 1 to 10, scaled from 0 to 1}", "graph standard_scale(x, 20, True) over 0..300", " {{layout: deemphasis}Graph the character speed values obtained for speed}", " {{layout: deemphasis}modification levels from 0 to 300}", "graph standard_scale(x, 20, True) over -300..0", " {{layout: deemphasis}Graph the character speed values obtained for speed}", " {{layout: deemphasis}modification levels from -300 to 0}", })); set_command_help_see_also(({ "eval", "man log", "man exp", "man pow", "man standard_scale" }));}

Constructs and displays a simple graph of a given mathematical function, specified as a function of the variable x. Thiscommand was developed for the convenience of lib designers working with interesting formulae (see the last two examples below).

The domain (input values) over which the function will be evaluated may be specified with the [over <n>..<m>] clause. Thedefault is to evaluate over 0..1.

The range (output values) which the graph will cover may be specified with the [on <a>..<b>] clause. The default is toadaptively construct the range of the graph according to the range of values found for the function over the domain.

The -c option can be used to specify the number of columns in the graph (which determines the number and exact values of thepoints used within the domain). The default is to use your terminal columns - 10 (leaving room for labels and so on).

The -r option can be used to specify the number of rows in the graph. The default is to use your terminal rows - 10.