I want to create a parcoords-plot with custom axis with tickvals
. This is doable, but then the constraintrange does work and only allows to constraint for the tickvals.
From time to time this might be intended behaviour, but in my case it is not. As far as I can see there is no way around, but maybe there is? It is not possible to use an empty label because otherwise the axis is completely destroyed. Here you have an example:
library(plotly)
ticktext <- ifelse(
((0:100)) %% 10==0,
as.character((0:100)/100),
"emptyLabel"
)
plot_ly(
type = "parcoords",
dimensions = list(
list(
label = "a",
values = runif(100),
range = c(0,1),
tickvals = (0:5)/5,
constraintrange = c(.1, .4),
ticktext = as.character((0:5)/5)
),
list(
label = "b",
values = runif(100),
range = c(0,1),
tickvals = (0:100)/100
#ticktext = as.character((0:5)/5)
),
list(
values = runif(100),
range = c(0,1),
tickvals = (0:100)/100,
ticktext = ticktext,
label = "c"
)
)
)
As you can see the constrainrange is not not [.1, .4].
This issue has already been mentioned here, but there is no answer: https://community.plotly.com/t/parallel-coordinates-plot-constraint-range-snapping-behavior/39024
I absolutely need to use tickvals, because in my usecase there are NA in the parameter and I solve this issue by assigning a special value to all NA-entries and then have show a modified axis: