Applies custom width and height to a Plotly figure, ensuring the plot displays at the specified dimensions. The function also sets the plot to autosize for responsive layouts.
Arguments
- fig
A Plotly figure object created by
plotly::plot_ly()or similar.- width
Desired plot width in pixels. Default is 776.
- height
Desired plot height in pixels. Default is 400.
See also
Other plotly:
ro_ply_add_theme(),
ro_ply_cursor(),
ro_ply_disable_toolbar(),
ro_ply_focus_linechart(),
ro_ply_keyboard_nav_barchart(),
ro_ply_keyboard_nav_bargraph(),
ro_ply_keyboard_nav_legend(),
ro_ply_keyboard_nav_linechart(),
ro_ply_keyboard_nav_trendline(),
ro_ply_legend_theme(),
ro_ply_theme(),
ro_ply_title()
Examples
if (FALSE) { # \dontrun{
fig <- plotly::plot_ly(data = mtcars, x = ~mpg, y = ~hp, type = 'scatter', mode = 'markers')
fig_dimmed <- ro_ply_dim(fig, width = 800, height = 500)
fig_dimmed
} # }
