numeric_scatter_chart: Factor scatter chart

Description Usage Arguments Value Author(s) Examples

View source: R/numeric_scatter_chart.R

Description

Use this function to create scatter plot with both x-axis and y-axis containing numeric variables and with an optional color variable which is a factor variable

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
numeric_scatter_chart(
  plot_data,
  x_name,
  y_name,
  color_name = NULL,
  static_color = "#4dbd5b",
  hover_name = NULL,
  plot_height = NULL,
  plot_width = NULL,
  show_legend = TRUE,
  show_x_axis_grid = FALSE,
  show_y_axis_grid = FALSE,
  marker_size = marker_default_size,
  plot_title = NULL,
  x_axis_title = NULL,
  y_axis_title = NULL
)

Arguments

plot_data

This is the data.frame which will be used for the plot

x_name

The column name of the variable in the x-axis, It has to be a numeric variable

y_name

The column name of the variable in the y-axis, It has to be a numeric variable

color_name

The column name of the variable in the color axis, It has to be a factor variable

static_color

string. If the colour_name is not specified, this color will be filled for the plot

hover_name

The column name of the variable that will be present in the hovers, can also be a normal vector.

plot_height

num. The height of the plot, If not provided the plot will take the whole area available in the UI

plot_width

num. The height of the plot, If not provided the plot will take the whole area available in the UI

show_legend

boolean. This will let you display or hide the grids in the x-axis, default shown

show_x_axis_grid

boolean. This will let you display or hide the grids in the x-axis, default hidden

show_y_axis_grid

boolean. This will let you display or hide the grids in the y-axis, default hidden

marker_size

num. This is the size of the markers in the scatter plot, defaults to marker_default_size from constants.R

plot_title

string. This is the title of the plot, defauts to NULL

x_axis_title

string. This is the x-axis title of the plot, defaults to NULL

y_axis_title

string. This is the y-axis title of the plot, defaults to NULL

Value

Returns a plotly plot object which can be rendered as HTML

Author(s)

Vedha Viyash

Examples

1
2
3
4
5
6
7
8
## You can plot by just using a data.frame, x-axis and y-axis.
numeric_scatter_chart(iris, Sepal.Length, Petal.Length)

## You can also change the color of the plot by specifying `static_color`
numeric_scatter_chart(iris, Sepal.Length, Petal.Length, static_color = "#f55b96")

## You can pass a third variable to get a plot with the color axis
numeric_scatter_chart(iris, Sepal.Length, Petal.Length, color_name = Species)

vedhav/tidycharts documentation built on Nov. 15, 2020, 3:26 p.m.