plot_BioGeoBEARS_results(results_object, analysis_titletxt = NULL, addl_params = list(), plotwhat = "text", label.offset = NULL, tipcex = 0.8, statecex = 0.7, splitcex = 0.6, titlecex = 0.8, plotsplits = TRUE, plotlegend = FALSE, legend_ncol = NULL, legend_cex = 1, cornercoords_loc = "manual", include_null_range = TRUE, tr = NULL, tipranges = NULL)
bears_optim_run
(with ancestral states
on).results_object$inputs$description
is
checked.NULL
, program chooses 0.05 x tree height.cex
value for the tiplabels (scaling
factor, i.e. 0.5 is half size)cex
value for the states (scaling
factor, i.e. 0.5 is half size). Used on piecharts if
plotwhat="pie".cex
value for the splits (scaling
factor, i.e. 0.5 is half size). Used on piecharts if
plotwhat="pie".cex
value for the title (scaling
factor, i.e. 0.5 is half size).TRUE
, plot states on the
corners -- text or pie charts, depending on
plotwhat
.TRUE
, make a (separate) plot
with a legend giving the colors for each state/range,
using colors_legend
.NULL
(default), the function calculates
floor(sqrt(length(possible_ranges_list_txt) / 2))
when the number of states is <=64, and="" sqrt(ceiling(length(possible_ranges_list_txt)))
when > 64. Note that when you have hundreds of states,
there is probably no good way to have a readable legend,
and it is easier to just rely upon printing the character
codes for the ML states in the plots, with the colors,
and users can then see and trace the common colors/states
by eye.=64,>
legend
function determines the
size. The value 2.5 works well for 15 or 16
states/ranges.plot_phylo3_nodecoords.R
. This
function, modified from the APE function
plot.phylo
, cannot be included
directly in the R package as it contains C code that does
not pass CRAN's R CMD check. The default,
cornercoords_loc="manual", will not allow split states to
be plot. The R script plot_phylo3_nodecoords.R
is
located in the BioGeoBEARS extension data directory,
extdata/a_scripts
. You should be able to get the
full path with
list.files(system.file("extdata/a_scripts",
package="BioGeoBEARS"), full.names=TRUE)
.TRUE
(default), the
null range is included in calculation of colors. (Safest
for now.)NULL
, which
means the tree will be read from the file at
results_object$inputs$trfn
.NULL
,
which means the tree will be read from the file at
results_object$inputs$geogfn
.plot_BioGeoBEARS_results
plots
the colors and state/range names directly onto the plot.
Any legend will get unwieldy above perhaps 32 states,
which is just 5 areas with no constraints (see
numstates_from_numareas
, or type
numstates_from_numareas(numareas5, maxareas5,
include_null_range=TRUE)
. Note that this assumes that the ancestral states were
calculated under the global optimum model (rather than
the local optimum, with the model re-optimized for each
possible state at each possible node, as done in e.g.
LAGRANGE
), and that these are marginal
probabilities, i.e. this is not a joint reconstruction,
instead it gives the probabilities of states at each
node. This will not always be readable as a joint
reconstruction (it could depict split scenarios that are
not possible, for instance.)
Matzke_2012_IBS
ReeSmith2008
get_leftright_nodes_matrix_from_results
,
corner_coords
,
plot.phylo
,
plot.phylo
,
tiplabels
,
legend
,
floor
, ceiling
,
floor
,
numstates_from_numareas
,
system.file
,
list.files