Navigation:  Programmer's Reference > Sending data to DPlot from another application >

FillBetween macro command

Print this Topic Previous pageReturn to chapter overviewNext page

Macro commands may be used either in macros or by sending the commands to DPlot via dynamic data exchange (DDE). Some commands are valid only in macros (noted by Macros Only). Commands sent to DPlot via DDE must be enclosed by square brackets [     ]. Macro commands should not include the brackets.

Command parameters shown in the descriptions below are placeholders for the actual values. Command parameters are either numeric values, equations that evaluate to numbers, or character strings. Character string parameters are always bound by double quotation marks. Equations must be preceded by an equals sign (=).

The pipe symbol (|) in the command syntax indicates that a parameter is optional, and should not be included in your macro unless otherwise noted.

All indices into arrays are 1-based, e.g. Curve1=1 refers to the first curve in a plot.

A 0x prefix for numbers in the descriptions below indicates hexadecimal notation; e.g. 0x0010 = 16.

JR/Viewer indicates that the command is supported by DPlot Jr or DPlot Viewer.
JR/Viewer indicates that the command is NOT supported by DPlot Jr or DPlot Viewer.


 

[FillBetween(Curve1,Curve2,Style,R,G,B
|,yref,R2,G2,B2||,mask||,"Legend"|,"LegendBelow"||]

JR   Viewer

Fills the area between Curve1 and Curve2 with a hatch pattern of Style and color R,G,B.

Curve2

If Curve2=0 or is equal to Curve1, then the region formed by closing Curve1 (connecting the first and last points) is filled.

If Curve2=-1, then the area between Curve1 and bottom edge of the graph is filled.

If Curve2=-3, then the area between Curve1 and top edge of the graph is filled.

If Curve2=-4, then the area between Curve1 and left edge of the graph is filled.

If Curve2=-5, then the area between Curve1 and right edge of the graph is filled.

If Curve2=-6, then the area below Curve1 will be filled to the bottom edge of the graph, but only for points in Curve1 less than or equal to the yref value.

If Curve2=-2, then yref specifies the constant Y value for a reference line that serves as a boundary for the fill pattern. In this case R2, G2, B2 specify the color components to use for areas below Y=yref.

Optional parameters "Legend" and "LegendBelow" are the legend entries for the fill areas. "LegendBelow" is only meaningful for Curve2=-2. You cannot include "LegendBelow" without "Legend", though you may specify a blank "Legend" with two successive quotation marks. Fill area legend entries will always follow the legend entries for curves, if present. Valid values for Style are:

-1

 

Solid

0

 

Horizontal lines

1

 

Vertical lines

2

 

45 degree downward

3

 

45 degree upward

4

 

Horizontal-vertical crosshatch

5

 

45 degree crosshatch

The mask setting is optional and is equivalent to the Copy/Mask selections on the Fill Between Curves dialog. 0=Copy, 1=Mask. If mask is included, then yref, R2, G2, B2 must also be included, though they may be blank entries (represented by adjacent commas.


Numeric curve indices may be replaced by substituting LegendHas("substring1"|,"substring2"|,"substring3"||). When this feature is used, DPlot will search for a curve whose legend entry contains substring1 and optionally substring2 and substring3. The index of the first curve whose legend matches that criteria will be substituted for LegendHas(...). If no match is found, no substitution is performed. Searches are case-specific.

For example, [SelectCurve(LegendHas("ABC","GHI"))] will search for a curve whose legend contains both ABC and GHI.

"ABCDEFGHI" is a positive match; "ABCDEFGH" is not. Neither is "abcdefghi".

LegendHas(...) may be used in any command in place of a curve or data set index.

 


Please note:

Character string arguments require a bit of care, depending on your development environment. Character string arguments in all DPlot commands are always enclosed by double quotation marks. In some environments (Visual Basic and all flavors of C, for example), double quotation marks are also used to delineate all character strings (including the command itself). The following example will always cause a syntax error in Visual Basic:

ret = DPlot_Command(docnum,"[FileOpen("myfile.grf")]")

Instead, use:

ret = DPlot_Command(docnum,"[FileOpen(""myfile.grf"")]")

in C, C++, C# you'd accomplish the same thing with:

ret = DPlot_Command(docnum,"[FileOpen(\"myfile.grf\")]");

If a character string argument is a variable, as in (VB):

Dim arg as string
arg = "myfile.grf"

... then you can build the command in VB as:

ret = DPlot_Command(docnum,"[FileOpen(" & chr$(34) & arg & chr$(34) & ")]")

In all flavors of C, the same can be accomplished with

char arg[256];
char cmd[512];
strcpy(arg,"myfile.grf");
sprintf(cmd,"[FileOpen(\"%s\")]",arg);
ret = DPlot_Command(docnum,cmd);

This does not apply to the DPlot macro editor, in which each line is by definition a character string and does not require delineators, nor to FORTRAN and possibly other languages, in which the delineator for character strings is a single quote, e.g. '[FileOpen("...")]'

To embed a double quotation mark within a character string which is itself delineated by double quotation marks, use the Symbol font equivalent instead. For example, "Radius=6{\s²}" inches will be processed as

Radius=6"

 


 

____________________________

See also

Fill Between Curves menu command

 

 


Page url: https://www.dplot.com/help/index.htm?fillbetweencommand.htm