Skip to content

plotly parcoords (parallel coordinates) cannot plot a single line #2385

Open
@MLopez-Ibanez

Description

@MLopez-Ibanez

The following generates no plot, no warnings and no errors:

# Example from https://plotly.com/r/parallel-coordinates-plot/
library(plotly)
df <- read.csv("https://raw.githubusercontent.com/bcdunbar/datasets/master/iris.csv")
df <- df[1L, , drop=FALSE] # plot one line only
fig <- df %>% plot_ly(type = 'parcoords',
          line = list(color = ~species_id,
                      colorscale = list(c(0,'red'),c(0.5,'green'),c(1,'blue'))),
          dimensions = list(
            list(range = c(2,4.5),
                 label = 'Sepal Width', values = ~sepal_width),
            list(range = c(4,8),
                 constraintrange = c(5,6),
                 label = 'Sepal Length', values = ~sepal_length),
            list(range = c(0,2.5),
                 label = 'Petal Width', values = ~petal_width),
            list(range = c(1,7),
                 label = 'Petal Length', values = ~petal_length)
            )
          )
fig

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions