Draws two-dimensional graphs with marginal distribution plots alongside the y- and x-axes (D.A. Murray).

### Options

`YMETHOD` = string token |
Distribution plot to display in the margin of the y-axis (`histogram` , `rugplot` , `boxplot` ); default `hist` |
---|---|

`XMETHOD` = string token |
Distribution plot to display in the margin of the x-axis (`histogram` , `rugplot` , `boxplot` ); default `hist` |

`YNGROUPS` = scalar |
Defines the number of groups in a margin plot of a histogram of the `Y` variate; default is then 10, or the integer value nearest the square root of the number of values in the `Y` variate if that is smaller |

`XNGROUPS` = scalar |
Defines the number of groups in a margin plot of a histogram of the `X` variate; default is then 10, or the integer value nearest the square root of the number of values in the `X` variate if that is smaller |

`YCOLOUR` = scalar or text |
Colour to use for the `Y` margin plot |

`XCOLOUR` = scalar or text |
Colour to use for the `X` margin plot |

### Parameters

`Y` = variates or factors |
Vertical coordinates |
---|---|

`X` = variates or factors |
Horizontal coordinates |

`TITLE` = texts |
General title for the plot; default `*` |

`WINDOW` = scalars |
Window number for the graphs; default 1 |

`KEYWINDOW` = scalars |
Window number for the key (zero for no key); default 2 |

`PEN` = scalars, variates or factors |
Pen number for each graph; default * uses pens 1, 2, and so on for the successive graphs |

`SCREEN` = string token |
Whether to clear the screen before plotting or to continue plotting on the old screen (`clear` , `keep` ); default `clea` |

### Description

The `DXYGRAPH`

procedure draws high-resolution two-way plots with a distribution plot alongside the y- and the x-axis. The main part of the graph is an ordinary two-dimensional graph (e.g. a point or line plot), which is plotted by the `DGRAPH`

directive in the usual way. The `Y`

and `X`

parameters supply the y- and x-coordinates of the items to be plotted, exactly as in `DGRAPH`

, and the `PEN`

parameter can specify graphics pens to define how the plotting is done. See `DGRAPH`

for full details.

The `YMETHOD`

option specifies the type of distribution plot to be displayed alongside the y-axis. By default this is a histogram. Alternatively, you can set `YMETHOD=rugplot`

to produce a rug plot, or `YMETHOD=boxplot`

to display a schematic boxplot. Similarly, the `XMETHOD`

option controls the distribution plot displayed below the x-axis. By default the number of groups used to draw a marginal plot of a histogram is either 10, or the integer value nearest the square root of the number of values in the associated variate if that is smaller. Alternatively, you can specify the number of groups using the `YNGROUPS`

and `XNGROUPS`

for the `Y`

and `X`

marginal plots respectively. The `YCOLOUR`

and `XCOLOUR`

options can be used to specify the colours to be used for the margin plots.

The `WINDOW`

parameter defines the window in which the graph is drawn (default 1), and the `KEYWINDOW`

parameter specifies the window in which the key appears (default 2). You can set `KEYWINDOW=0`

to suppress the key. The `TITLE`

parameter can be used to provide a title for the graph, and the `SCREEN`

parameter controls whether the graphical display is cleared before the graph is plotted.

Options: `YMETHOD`

, `XMETHOD`

, `YNGROUPS`

, `XNGROUPS`

, `YCOLOUR`

, `XCOLOUR`

.

Parameters: `Y`

, `X`

, `TITLE`

, `WINDOW`

, `KEYWINDOW`

, `PEN`

, `SCREEN`

.

### Action with `RESTRICT`

You can arrange to plot only a subset of the points specified by a particular pair of `Y`

and `X`

vectors and associated `PEN`

vector, by restricting any one of them. If more than one of these is restricted, then they must all be restricted in exactly the same way.

### See also

Directive: `DGRAPH`

, `DHISTOGRAM`

.

Commands for: Graphics.

### Example

CAPTION 'DXYGRAPH example','Sulphur polution data'; STYLE=meta,plain SPLOAD '%GENDIR%/data/sulphur.gsh' DXYGRAPH Windsp; Sulphur DXYGRAPH [XMETHOD=rugplot; YMETHOD=rugplot] Windsp; Sulphur;\ PEN=Rain; WINDOW=5; KEY=8 DXYGRAPH [XMETHOD=histogram; YMETHOD=rugplot] Windsp; Sulphur;\ PEN=Rain; WINDOW=6; KEY=0; SCREEN=keep DXYGRAPH [XMETHOD=boxplot; YMETHOD=rugplot] Windsp; Sulphur;\ PEN=Rain; WINDOW=7; KEY=0; SCREEN=keep