Open krisowski opened 4 years ago
Seconded. To add a bit of variation to the example above, I would expect to select tickvals
using the same nested list structure that's initially passed to the x
argument of go.Bar()
. For example, creating a figure with a multicategory xaxis:
fig = go.FigureWidget()
fig.add_trace(
go.Scatter(
x = [['a', 'a', 'a', 'a', 'b', 'b', 'b','b'], [1,2,3,4,5,6,7,8]],
y = [50, 55, 56, 57, 35, 12, 45, 40]
)
)
Then, I'd like to use tickvals
in this way to select the specific x
values:
fig.update_layout(
xaxis = dict(
tickvals = [['a', 'a', 'b', 'b'], [1, 3, 5, 7]],
ticktext = ['A', 'B', 'C', 'D']
)
)
I also have this issue. I found that updating tickvals
and ticktext
with a subcategory axis always resulted in no tick values or labels in the resulting figure.
A similar (or possibly the same) issue exists when trying to set tickvals
and ticktext
while setting type="category"
. This results in an empty Figure. Setting only one of tickvals
or ticktext
results in a figure but without any consequence. Imho, it should be possible to set the ticktext of a categorical axis.
If a plot has multi-category axes there is no way to hide a subcategory labels only and the plot doesn't render at all if
tickvals
andticktext
are used.Look at the code without multi-categories:
This works fine and all x-axes labels are hidden. I could achieve the same thing with this:
fig.update_layout(xaxis=dict(showticklabels=False))
However, if this is a multi-category plot it doesn't work at all:
Setting
showticklabels=False
hides everything and I didn't find a way to hide just a single category labels.What is really surprising this doesn't work either even if this doesn't change anything:
I believe it should work like this:
tickvals
andticktext
work fine with a multi-category plotsshowticklabels
should accept a list of booleans, .e.g.[True, False]
to be able to hide a given subcategory if this is a multi-category plot