Description Usage Arguments Examples
View source: R/MarkdownReportsDev.R
A scatterplot with color gradient and color legend. Modified from: http://stackoverflow.com/questions/20127282/r-color-scatterplot-points-by-col-value-with-legend
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | wscatter.fill(
df2col = cbind(A = rnorm(100), B = rnorm(100)),
...,
color,
xlim = range(df2col[, 1]),
ylim = range(df2col[, 2]),
zlim = range(color),
nlevels = 20,
pch = 21,
cex = 1,
plotname = substitute(df2col),
plot.title = plotname,
plot.axes,
key.title,
key.axes,
asp = NA,
xaxs = "i",
yaxs = "i",
las = 1,
axes = TRUE,
frame.plot = axes,
xlab,
ylab,
savefile = unless.specified("b.save.wplots"),
w = unless.specified("b.defSize", 7),
h = w,
incrBottMarginBy = 0,
mdlink = ww.set.mdlink(),
PNG = unless.specified("b.usepng", F)
)
|
df2col |
Input data, a 2 column dataframe |
... |
Pass any other parameter of the corresponding plotting function(most of them should work). |
color |
Filling color of the symbols |
xlim |
Manually set the range of canvas in X dimension |
ylim |
Defines the Y axis range. Replacement for the standard "ylim" argument. |
zlim |
Manually set the range of colors numbers (Z dimension) |
nlevels |
Number of steps in the color gradient |
pch |
Define the symbol for each data point. A number 0-25 or any string between ""-s. |
cex |
Size of the symbols |
plotname |
The name of the file saved. |
plot.title |
The title of the plot. |
plot.axes |
Draw axis ticks |
key.title |
... |
key.axes |
... |
asp |
numeric, giving the aspect ratio y/x. See help('plot.window'). |
xaxs |
The style of axis interval calculation to be used for the X-axis. See help('par'). |
yaxs |
The style of axis interval calculation to be used for the X-axis. See help('par'). |
las |
numeric in 0, 1, 2, 3; the style of axis labels. See help('par'). |
axes |
Draw axes and box |
frame.plot |
No description. |
xlab |
X axis label |
ylab |
Y axis label |
savefile |
Save plot as pdf in OutDir, TRUE by default. |
w |
Width of the saved pdf image, in inches. |
h |
Height of the saved pdf image, in inches. |
incrBottMarginBy |
Increase the blank space at the bottom of the plot. Use if labels do not fit on the plot. |
mdlink |
Insert a .pdf and a .png image link in the markdown report, set by "path_of_report". |
PNG |
Set to true if you want to save the plot as PNG instead of the default PDF. |
1 2 3 | try.dev.off(); mydf = cbind("A" = rnorm(100), "B" = rnorm(100))
wscatter.fill( df2col = mydf, color = rnorm(100), nlevels = 15, pch = 21,
xlab = "The X Dimension. Wooaaahh")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.