View source: R/ziggurat_graph.R
ziggurat_graph | R Documentation |
This function plots the ziggurat graph of a bipartite network. Configuration parameters and results are stored in a global environment called zgg. This environment is not destroyed after the function is executed, so the developer can store it in a configuration file, retrieve network analysis variables and so on. If a new ziggurat_graph is called, zgg is destroyed and created again for the new plot. Plotting options are explained in the user manual.
ziggurat_graph(datadir, filename, paintlinks = TRUE,
displaylabelszig = TRUE, print_to_file = FALSE,
plotsdir = "plot_results/ziggurat/", flip_results = FALSE,
aspect_ratio = 1, alpha_level = 0.2, color_guild_a = c("#4169E1",
"#00008B"), color_guild_b = c("#F08080", "#FF0000"),
color_link = "slategray3", alpha_link = 0.5, size_link = 0.5,
displace_y_b = rep(0, 20), displace_y_a = rep(0, 20), labels_size = 3.5,
lsize_kcoremax = 3.5, lsize_zig = 3, lsize_kcore1 = 2.5,
lsize_legend = 4, lsize_core_box = 2.5, labels_color = c(),
height_box_y_expand = 1, kcore2tail_vertical_separation = 1,
kcore1tail_disttocore = c(1, 1), innertail_vertical_separation = 1,
horiz_kcoremax_tails_expand = 1, factor_hop_x = 1,
displace_legend = c(0, 0), fattailjumphoriz = c(1, 1),
fattailjumpvert = c(1, 1), coremax_triangle_height_factor = 1,
coremax_triangle_width_factor = 1, paint_outsiders = TRUE,
displace_outside_component = c(1, 1), outsiders_separation_expand = 1,
outsiders_legend_expand = 1,
weirdskcore2_horizontal_dist_rootleaf_expand = 1,
weirdskcore2_vertical_dist_rootleaf_expand = 0,
weirds_boxes_separation_count = 1, root_weird_expand = c(1, 1),
hide_plot_border = TRUE, rescale_plot_area = c(1, 1),
kcore1weirds_leafs_vertical_separation = 1, corebox_border_size = 0.2,
kcore_species_name_display = c(), kcore_species_name_break = c(),
shorten_species_name = 0, label_strguilda = "", label_strguildb = "",
landscape_plot = TRUE, backg_color = "white", show_title = TRUE,
use_spline = TRUE, spline_points = 100, file_name_append = "",
svg_scale_factor = 10, progress = NULL)
datadir |
the name of the file of the interaction matrix |
filename |
the file with the interaction matrix |
print_to_file |
if set to FALSE the plot is displayed in the R session window |
plotsdir |
the directory where the plot is stored |
flip_results |
displays the graph in portrait configuration |
aspect_ratio |
ziggurat plot default aspect ratio |
alpha_level |
transparency for ziggurats' filling |
color_guild_a |
default filling for nodes of guild_a |
color_guild_b |
default filling for nodes of guild_b |
color_link |
default links color |
alpha_link |
link transparency |
size_link |
width of the links |
displace_y_b |
relative vertical displacement of guild_b inner ziggurats |
displace_y_a |
relative vertical displacement of guild_a inner ziggurats |
labels_size |
default nodes labels size |
lsize_kcoremax |
nodes in kshell max label size |
lsize_zig |
nodes in inner ziggurats label size |
lsize_kcore1 |
labels of nodes in kshell 1 |
lsize_legend |
legend label size |
labels_color |
default label colors |
height_box_y_expand |
expand inner ziggurat rectangles default height by this factor |
kcore2tail_vertical_separation |
expand vertical of kshell 1 species linked to kshell 2 by this factor |
kcore1tail_disttocore |
expand vertical separation of kshell 1 species from kshell max (guild_a, guild,b) |
innertail_vertical_separation |
expand vertical separation of kshell species connected to khsell > 2 & < kshell max |
horiz_kcoremax_tails_expand |
expand horizontal separation of weird tails connected to kshell max |
factor_hop_x |
expand inner ziggurats horizontal distance |
displace_legend |
modify legend position by these fractions |
fattailjumphoriz |
displace kshell 1 species linked to leftmost kshell max species |
fattailjumpvert |
idem for vertical position |
coremax_triangle_height_factor |
expand khsell max rectangles height by this factor |
coremax_triangle_width_factor |
expand khsell max rectangles width by this factor |
paint_outsiders |
paint species not connected to giant component |
displace_outside_component |
displace outsider species (horizontal, vertical) |
outsiders_separation_expand |
multiply by this factor outsiders' separation |
outsiders_legend_expand |
displace outsiders legend |
weirdskcore2_horizontal_dist_rootleaf_expand |
expand horizontal distance of weird tail root node connected to kshell 2 |
weirdskcore2_vertical_dist_rootleaf_expand |
expand vertical distance of weird tails connected to kshell 2 |
weirds_boxes_separation_count |
weird species boxes separation count |
root_weird_expand |
expand root weird distances of tails connected to kshell <> 2 |
hide_plot_border |
hide border around the plot |
rescale_plot_area |
full plot area rescaling (horizontal, vertical) |
kcore1weirds_leafs_vertical_separation |
expand vertical separation of weird tails connected to kshell 1 species |
corebox_border_size |
width of kshell boxes |
kcore_species_name_display |
display species names of shells listed in this vector |
kcore_species_name_break |
allow new lines in species names of shells listed in this vector |
shorten_species_name |
number of characters of species name to display |
label_strguilda |
string labels of guild a |
label_strguildb |
string labels of guild b |
landscape_plot |
paper landscape configuration |
backg_color |
plot background color |
show_title |
show plot title |
use_spline |
use splines to draw links |
spline_points |
number of points for each spline |
file_name_append |
a label that the user may append to the plot file name for convenience |
svg_scale_factor |
only for interactive apps, do not modify |
progress |
only for interactive apps, do not modifiy |
lsize_kcorebox |
default kshell boxes label size |
ziggurat_graph("data/","M_PL_001.csv",plotsdir="grafresults/",print_to_file = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.