mirror of
https://github.com/johrpan/geposan.git
synced 2025-10-25 19:37:23 +02: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() |>
|
||||
plotly::layout(
|
||||
xaxis = list(
|
||||
xaxis = list(title = "Distance to telomeres [Bp]"),
|
||||
yaxis = list(
|
||||
title = "Species",
|
||||
tickvals = species$id,
|
||||
ticktext = species$name
|
||||
),
|
||||
yaxis = list(title = "Distance to telomeres [Bp]"),
|
||||
bargap = 0.9
|
||||
) |>
|
||||
plotly::add_bars(
|
||||
data = species_max_distance,
|
||||
x = ~species,
|
||||
y = ~max_distance,
|
||||
x = ~max_distance,
|
||||
y = ~species,
|
||||
name = "All genes",
|
||||
marker = list(color = base_color())
|
||||
)
|
||||
|
|
@ -71,8 +71,8 @@ plot_positions <- function(species_ids, gene_sets) {
|
|||
|
||||
plot <- plot |> plotly::add_markers(
|
||||
data = gene_set_data[gene %chin% gene_set],
|
||||
x = ~species,
|
||||
y = ~distance,
|
||||
x = ~distance,
|
||||
y = ~species,
|
||||
name = gene_set_name,
|
||||
text = ~ glue::glue(
|
||||
"<b>{name}</b><br>",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue