|
| 1 | +# biplot |
| 2 | + |
| 3 | +```julia |
| 4 | +biplot(name::String | D::GMTDataset; arrow::Tuple=(0.3, 0.5, 0.75, "#0072BD"), cmap=:categorical, |
| 5 | + colorbar::Bool=true, marker=:point,ms="auto", obsnumbers::Bool=false, PC=(1,2), |
| 6 | + varlabels=:yes, xlabel="", ylabel="", kw...) |
| 7 | +``` |
| 8 | + |
| 9 | +Create a 2D biplot of the Principal Component Analysis (PCA) of a two-dimensional chart that |
| 10 | +represents the relationship between the rows and columns of a table. |
| 11 | + |
| 12 | +- `cmd0`: The name of a 2D data table file readable with ``gmtread()``, or a ``GMTdataset`` with the data. |
| 13 | + |
| 14 | +- `arrow`: a tuple with the following values: (len, shape, width, color). If this default is used we scale them by fig size. |
| 15 | + - `len`: the length of the arrowhead in cm. Default is 0.3. |
| 16 | + - `shape`: the shape of the arrow. Default is 0.5. |
| 17 | + - `width`: the width of the arrow stem in points. Default is 0.75. |
| 18 | + - `color`: the color of the arrow. Default is "#0072BD". |
| 19 | + |
| 20 | +- `cmap`: a String or Symbol with the name of a GMT colormap. |
| 21 | + - Or a string with "matlab" or "distinct" |
| 22 | + - Or "alphabet" for colormaps with distinct colors. |
| 23 | + - Or a comma separated string with color names; either normal names ("red,green") or hex color codes ("#ff0000,#00ff00"). |
| 24 | + - Or "none" for plotting all points in black color. A single color in hexadecimal format plots all points in that color. |
| 25 | + Default is "categorical". |
| 26 | + |
| 27 | +- `colorbar`: whether to plot a colorbar. Default is true. |
| 28 | + |
| 29 | +- `marker`: a String or Symbol with the name of a GMT marker symbol. Default is "point". |
| 30 | + |
| 31 | +- `ms`: a String or Symbol with the name of a GMT marker size. Default is "auto" (also scales sizes with the size of the plot). |
| 32 | + |
| 33 | +- `obsnumbers`: whether to plot observation numbers on the plot. Default is false. Note that in this case we are not able |
| 34 | + to plot colored numbers by category, so we plot the symbols as well (use `cmap="none"` if you don't want this). |
| 35 | + |
| 36 | +- `PC`: a tuple with the principal components to plot. Default is (1, 2). For example, PC=(2,3) plots |
| 37 | + the 2nd and 3rd principal components. |
| 38 | + |
| 39 | +- `varlabels`: whether to plot variable labels. The default is :yes and it prints as labels the column names |
| 40 | + if the input GMTdataset. Is it hasn't column names, then it prints "A,B,C,...". Give a string vector to plot custom labels. |
| 41 | + |
| 42 | +- `xlabel`: a String with the x-axis label. Default is "", which prints "PC[PC[1]]". |
| 43 | + |
| 44 | +- `ylabel`: a String with the y-axis label. Default is "", which prints "PC[PC[2]]". |
| 45 | + |
| 46 | +- `kw...`: Any additional keyword argument to be passed to the ``plot()`` function. |
| 47 | + |
| 48 | + |
| 49 | +Examples |
| 50 | +-------- |
| 51 | + |
| 52 | +See the classic analysis of the _Iris_ dataset. |
| 53 | + |
| 54 | +\begin{examplefig}{} |
| 55 | +```julia |
| 56 | +using GMT |
| 57 | +biplot(TESTSDIR * "iris.dat", show=true) |
| 58 | +``` |
| 59 | +\end{examplefig} |
| 60 | + |
| 61 | +Plot a 6 cm fig with the observarion numbers. |
| 62 | + |
| 63 | +\begin{examplefig}{} |
| 64 | +```julia |
| 65 | +using GMT |
| 66 | +biplot(TESTSDIR * "iris.dat", figsize=6, obsnumbers=true, show=true) |
| 67 | +``` |
| 68 | +\end{examplefig} |
0 commit comments