mirror of
https://github.com/johrpan/geposan.git
synced 2025-10-26 18:57:25 +01:00
plots: Switch axes of input data plot
This commit is contained in:
parent
49981300fb
commit
d144f490a0
1 changed files with 6 additions and 6 deletions
12
R/plots.R
12
R/plots.R
|
|
@ -39,18 +39,18 @@ plot_positions <- function(species_ids, gene_sets) {
|
||||||
|
|
||||||
plot <- plotly::plot_ly() |>
|
plot <- plotly::plot_ly() |>
|
||||||
plotly::layout(
|
plotly::layout(
|
||||||
xaxis = list(
|
xaxis = list(title = "Distance to telomeres [Bp]"),
|
||||||
|
yaxis = list(
|
||||||
title = "Species",
|
title = "Species",
|
||||||
tickvals = species$id,
|
tickvals = species$id,
|
||||||
ticktext = species$name
|
ticktext = species$name
|
||||||
),
|
),
|
||||||
yaxis = list(title = "Distance to telomeres [Bp]"),
|
|
||||||
bargap = 0.9
|
bargap = 0.9
|
||||||
) |>
|
) |>
|
||||||
plotly::add_bars(
|
plotly::add_bars(
|
||||||
data = species_max_distance,
|
data = species_max_distance,
|
||||||
x = ~species,
|
x = ~max_distance,
|
||||||
y = ~max_distance,
|
y = ~species,
|
||||||
name = "All genes",
|
name = "All genes",
|
||||||
marker = list(color = base_color())
|
marker = list(color = base_color())
|
||||||
)
|
)
|
||||||
|
|
@ -71,8 +71,8 @@ plot_positions <- function(species_ids, gene_sets) {
|
||||||
|
|
||||||
plot <- plot |> plotly::add_markers(
|
plot <- plot |> plotly::add_markers(
|
||||||
data = gene_set_data[gene %chin% gene_set],
|
data = gene_set_data[gene %chin% gene_set],
|
||||||
x = ~species,
|
x = ~distance,
|
||||||
y = ~distance,
|
y = ~species,
|
||||||
name = gene_set_name,
|
name = gene_set_name,
|
||||||
text = ~ glue::glue(
|
text = ~ glue::glue(
|
||||||
"<b>{name}</b><br>",
|
"<b>{name}</b><br>",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue