(
obj,
showlegend = ,
traceorder = ,
bgcolor = ,
bordercolor = ,
borderwidth = ,
fontcolor = ,
fontfamily = ,
fontsize = ,
x = ,
y = ,
yanchor = ,
xanchor = ,
tracegroupgap = ,
orientation = ,
rm_rep_text = ,
rm_nonfirst_gr = ,
unique.legend = ,
,
rm_repText = rm_rep_text
a plotly object (created with function plot_ly
,
ggplotly
, subplot
or similar).
showlegend
logical, which determins if will be shown.
If NULL
(default) value of this option will not be changed.
traceorder
Any combination of "reversed", "grouped" joined with a "+" OR "normal".
examples: "reversed", "grouped", "reversed+grouped", "normal"
Determines the order at which the legend items are displayed. If "normal",
the items are displayed top-to-bottom in the same order as the input data.
If "reversed", the items are displayed in the opposite order as "normal".
If "grouped", the items are displayed in groups (when a trace 'legendgroup'
is provided). if "grouped+reversed", the items are displayed in the
opposite order as "grouped". Described in
R plotly reference.
bgcolor
Legend's background color. If NULL
(default) value of this option will not be changed.
bordercolor
Legend's border color. If NULL
(default) value of this option will not be changed.
borderwidth
Legend's border width. If NULL
(default) value of this option will not be changed.
fontcolor
Legend's font color. If NULL
(default) value of this option will not be changed.
fontfamily
Legend's font family. If NULL
(default) value of this option will not be changed.
fontsize
Legend's font size. If NULL
(default) value of this option will not be changed.
Legend's x position. If NULL
(default) value of this option will not be changed.
Legend's y position. If NULL
(default) value of this option will not be changed.
yanchor
Described in R plotly reference.
xanchor
Described in R plotly reference.
tracegroupgap
Described in R plotly reference.
orientation
"v","h". If NULL
(default) value of this option will not be changed.
Described in R plotly reference.
rm_rep_text, rm_repText
(logical) If TRUE
(default), repeated text in
legend's label is removed.
rm_nonfirst_gr
(logical) If TRUE
(default), non-first groups in
legend's label is removed,
e.g., "(ratio = 1.8,1,NA)" is converted to "ratio = 1.8".
unique.legend
logical. If TRUE
(default), only one legend per
legend group is shown. Result is visible if function
subplot
was applied.
Further parameters to methods.
If option rm_repText
is TRUE
(default), function corrects text
in legend of object created with function ggplotly
so
that only relevant information is displayed.
For example, if the text in a label is "(matrix,matrix,matrix)"
, it is
converted to shorter string "matrix"
.
An updated plotly object (class plotly
).
Vilmantas Gegzna
Online reference https://plot.ly/r/reference/#layout-legend;
Functions layout(), plot_ly(),
Other spPlot functions for plotly:
label_expr2text()
,
plotly_annotation_rm()
,
plotly_modify_hover()
,
plotly_tidy()
19
()
(spHelper)
(hyperSpec)
(plotly)
# Create `plotly` object:
obj <- qplot_spStat(chondro, "clusters", ) %>%
() %>%
ggplotly()
# Then compare this plot:
(obj)
# With the original one:
(obj)
# More options
(obj, traceorder = "reversed")
(obj, showlegend = )