How can I set a range for an axis if the ticks are only strings?
Like x = [“a”, “b”, “c”] and I want to set the range to only initially show “b” and “c”.
Thanks.
How can I set a range for an axis if the ticks are only strings?
Like x = [“a”, “b”, “c”] and I want to set the range to only initially show “b” and “c”.
Thanks.
Categorical axes use integers starting from 0
as their range.
So in your case, simply set layout.xaxis.range = [1, 2]
.