View source: R/plot_points_3d.R
plot_points_3d | R Documentation |
Function plots the 3d points in the current device window. A data frame provides the x, y, and z location of the points. Options for point color and size along with labeling and axis options are provided.
plot_points_3d( df, x_col, y_col, z_col, group_col = NULL, win_width = 1000, win_height = 800, pt_colors = "black", pt_size = 6, pt_alpha = 1, bkg_color = "white", draw_axis = TRUE, main_title = NULL, x_lab = "X", y_lab = "Y", z_lab = "Z", axis_color = "black", xlim = c(0, 10), ylim = c(0, 10), zlim = c(0, 10), x_ticks = 11, y_ticks = 11, z_ticks = 11, html_file = NULL )
df |
A data frame with columns for the x, y, and z locations and optionally a column for grouping the points. |
x_col, y_col, z_col |
Strings that set the columns names from |
group_col |
An optional string that sets the column name from |
win_width, win_height |
An integer defining the dimensions of the plot window. |
pt_colors |
Can be single string that sets the color for all the points. The default is "black". If |
pt_size |
A numeric defining the size of all the points in pixels. The default is 6.0. |
pt_alpha |
A numeric between 0.0 and 1.0 that sets the alpha value for all the points. The default is 1.0. |
bkg_color |
A character string defining the window background color. The default is "white". |
draw_axis |
A logical which if TRUE draws the axes. |
main_title |
A character string defining the plot's main title. |
x_lab, y_lab, z_lab |
A character string defining the axis labels. |
axis_color |
A character string defining the axis color. The default is "black". |
xlim, ylim, zlim |
An integer vector defining the min/max of an axis. |
x_ticks, y_ticks, z_ticks |
An integer defining the number of ticks for an axis. |
html_file |
A character string that defines the file path for creating a WebGL version of the plot. File names should have an html extension. |
The device window id (an integer).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.