Skip to content

lines don't respect colorbar limits in 3D scatter #1236

Closed
@mschilli87

Description

@mschilli87

If one creates a 3D scatter with markers and lines, both can be colored by one
dimension. However, when manually overwriting the colorbar limits only the
markers respond. This leads to completely wrong values indicated by the lines:

library(plotly)

test.plot <- mtcars %>%
  plot_ly(x = ~hp, y = ~cyl, z = ~mpg, color = ~mpg,
  type = "scatter3d", mode = "lines+markers")

# Note how the line changes color with the markers it passes through:
test.plot

# Note how the marker color matches the data and colorbar while the line
# ignores the limits and uses the original colors:
test.plot %>%
  colorbar(limits = c(0, 100))

default limits
adjusted limits

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions