figure {rbokeh} | R Documentation

## Instantiate an rbokeh figure.

### Description

Instantiate an rbokeh figure.

### Usage

    figure(data = NULL, width = 600, height = 600, title = NULL,
      title_location = NULL, xlab = NULL, ylab = NULL, xlim = NULL,
      ylim = NULL, range_padding = 0.07, xgrid = TRUE, ygrid = TRUE,
      xaxes = "below", yaxes = "left", legend_location = "top_right",
      logo = NULL, theme = getOption("bokeh_theme"), tools = c("pan",
      "wheel_zoom", "box_zoom", "reset", "save", "help"),
      toolbar_location = "above", toolbar_sticky = NULL, h_symmetry = TRUE,
      v_symmetry = FALSE, lod_factor = 10, lod_interval = 300,
      lod_threshold = NULL, lod_timeout = 500, output_backend = "canvas",
      min_border = NULL, min_border_left = NULL, min_border_bottom = NULL,
      min_border_right = NULL, min_border_top = NULL, hidpi = NULL)

### Arguments

`data` | A default data frame to be used by the layers added to the figure.
`width` | Figure width in pixels.
`height` | Figure width in pixels.
`title` | A title to display on the plot.
`title_location` | Where the title will be located. Titles on the left or right side will be rotated. One of 'above', 'below', 'left', 'right'.
`xlab` | Label for x axis. Also specifiable in `x_axis`.
`ylab` | Label for y axis. Also specifiable in `y_axis`.
`xlim` | The extent of the plotting area in the x-dimension (will be computed automatically if not specified). Also specifiable in `x_range`.
`ylim` | The extent of the plotting area in the y-dimension (will be computed automatically if not specified). Also specifiable in `y_range`.
`range_padding` | If limits are not explicitly specified, by what factor should the computed extents of the data be padded? This is a number used as a multiplier of the computed range.
`xgrid` | Logical indicating whether to draw x axis grid lines.
`ygrid` | Logical indicating whether to draw y axis grid lines.
`xaxes` | Where to put x axis, or FALSE if no x axis ticks / labels.
`yaxes` | Where to put y axis, or FALSE if no y axis ticks / labels.
`legend_location` | The location where the legend should draw itself, or `NULL` to omit the legend. One of 'top_right', 'top_left', 'bottom_left', 'bottom_right'.
`logo` | What version of the Bokeh logo to display on the toolbar. If set to `NULL`, no logo will be displayed. One of 'normal', 'grey', or `NULL`.
`theme` | An rbokeh theme to use. See, for example, `bk_default_theme`.

`tools`

character vector of interactivity tools options (acceptable values are: "box_select", "lasso_select", "poly_select", "crosshair", "box_zoom", "wheel_zoom", "zoom_in", "zoom_out", "pan", "wheel_pan", "reset", "undo", "redo", "save", "help"). Additionally, tool functions can be called on a figure to specify more control - see `tool_box_select`, for example, where links to the rest of the family of tool functions can also be found. If `NULL`, the toolbar will not be drawn. If `""` the toolbar will be drawn but no tools will be added by default.

`toolbar_location` | Where the toolbar will be located. If set to None, no toolbar will be attached to the plot. One of 'above', 'below', 'left', 'right'.
`toolbar_sticky` | Stick the toolbar to the edge of the plot. Default: TRUE If FALSE, the toolbar will be outside of the axes, titles etc.
`h_symmetry` | Whether the total horizontal padding on both sides of the plot will be made equal (the left or right padding amount, whichever is larger).
`v_symmetry` | Whether the total vertical padding on both sides of the plot will be made equal (the top or bottom padding amount, whichever is larger).
`lod_factor` | Decimation factor to use when applying level-of-detail decimation.
`lod_interval` | Interval (in ms) during which an interactive tool event will enable level-of-detail downsampling.
`lod_threshold` | A number of data points, above which level-of-detail downsampling may be performed by glyph renderers. Set to “None“ to disable any level-of-detail downsampling.
`lod_timeout` | Timeout (in ms) for checking whether interactive tool events are still occurring. Once level-of-detail mode is enabled, a check is made every “lod_timeout“ ms. If no interactive tool events have happened, level-of-detail mode is disabled.
`output_backend` | Specify the output backend for the plot area. Default is "canvas", HTML5 Canvas. Note: When set to "webgl", glyphs without a WebGL rendering implementation will fall back to rendering onto 2D canvas. Must be one of 'canvas', 'svg', 'webgl'.
`min_border` | A convenience property to set all all the “min_border_X“ properties to the same value. If an individual border property is explicitly set, it will override “min_border“.
`min_border_left` | Minimum size in pixels of the padding region to the left of the central plot region. Note: This is a *minimum*. The padding region may expand as needed to accommodate titles or axes, etc.
`min_border_bottom` | Minimum size in pixels of the padding region below the bottom of the central plot region. Note: This is a *minimum*. The padding region may expand as needed to accommodate titles or axes, etc.
`min_border_right` | Minimum size in pixels of the padding region to the right of the central plot region. Note: This is a *minimum*. The padding region may expand as needed to accommodate titles or axes, etc.
`min_border_top` | Minimum size in pixels of the padding region above the top of the central plot region. Note: This is a *minimum*. The padding region may expand as needed to accommodate titles or axes, etc.
`hidpi` | Whether to use HiDPI mode when available.

### Examples

    # empty figure
    figure()

    # figure with single point
    figure() %>%
      ly_points(1, 1)

    # simple figure
    figure() %>%
      ly_points(1:10, 1:10)

    # use svg to render the plot
    figure(output_backend = "svg") %>%
      ly_points(1:10, 1:10)

    # remove axes and grid
    figure(xaxes = FALSE, yaxes = FALSE, xgrid = FALSE, ygrid = FALSE) %>%
      ly_points(1:10, 1:10)

    # axis above and right
    figure(xaxes = "above", yaxes = "right", xgrid = FALSE, ygrid = FALSE,
      toolbar_location = "left") %>%
      ly_points(1:10, 1:10)

    # custom limits
    figure(xlim = c(-10, 20)) %>%
      ly_points(1:10, 1:10)

    # specifying tools
    figure(tools = "crosshair") %>%
      ly_points(1:10, 1:10)

    # specifying tools
    figure(tools = c("lasso_select", "poly_select")) %>%
      ly_points(1:10, 1:10)

    # gray logo
    figure(logo = "grey") %>%
      ly_points(1:10, 1:10)

    # no toolbar
    figure(tools = NULL) %>%
      ly_points(1:10, 1:10)

[Package rbokeh version 0.6.3 Index]