You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tickmode="array" with custom tickvals ticktext doesn't work at all #2478
@nicolaskruchten Sorry , lost a line when editing , add fig.update_layout(layout) now .
You could try my code to verify the problem .
Only feed integer values to x and tickvals can get right xticks . I didn't tried this becasue similar code worked in matplotlib. So it looks like plotly has some problems when handling dtype { 'x' : date, tickvals: int } and dtype { 'x' : date, tickvals: date } .
Similar, on my example . x is date type , tickvals is int and ticktext is string , working in matplotlib . I also tried
1 . x date , tickvals date ticktext string
2. x string, tickvals string , ticktext string
I'm really sorry but I'm having a lot of trouble understanding the issue you're describing when you say "neither work"... In the example I've posted above, x, tickvals and ticktext are all strings, so it's case 2 you describe above and the output is as I would expect it. The behaviour is the same if x and tickvals are dates.
If you could tell me what "doesn't work" about the display above I would gladly help you, but I'm not familiar enough with what matplotlib does to be able to infer this from what you've written :)
Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson
Activity
nicolaskruchten commentedon May 19, 2020
Your
layout = dict( ...line should start withfig.layout = dict( ...:)eromoe commentedon May 20, 2020
@nicolaskruchten Sorry , lost a line when editing , add
fig.update_layout(layout)now .You could try my code to verify the problem .
Only feed integer values to x and tickvals can get right xticks . I didn't tried this becasue similar code worked in matplotlib. So it looks like plotly has some problems when handling dtype { 'x' : date, tickvals: int } and dtype { 'x' : date, tickvals: date } .
nicolaskruchten commentedon May 20, 2020
OK, so I'm not sure what the problem is here... what are you expecting to see that you're not seeing?
nicolaskruchten commentedon May 20, 2020
Let's look at a simpler example with fewer moving parts which seems to work well enough... Is this as you're expecting?
eromoe commentedon May 20, 2020
Similar, on my example . x is date type , tickvals is int and ticktext is string , working in matplotlib . I also tried
1 . x date , tickvals date ticktext string
2. x string, tickvals string , ticktext string
Neither work, so I post this issue .
nicolaskruchten commentedon May 20, 2020
I'm really sorry but I'm having a lot of trouble understanding the issue you're describing when you say "neither work"... In the example I've posted above,
x,tickvalsandticktextare all strings, so it's case 2 you describe above and the output is as I would expect it. The behaviour is the same ifxandtickvalsare dates.If you could tell me what "doesn't work" about the display above I would gladly help you, but I'm not familiar enough with what matplotlib does to be able to infer this from what you've written :)
eromoe commentedon May 20, 2020
OK, I put full example here :
I like to see
tickmode="auto" and nticks=50 is fine for me .
I am here just want to report this problem , because plotly is very handy now, I hope it would be bettter
results with wrong xticks :

2 . x date , tickvals date ticktext string
still wrong result

nicolaskruchten commentedon May 20, 2020
Ah, OK, the problem is that you're not seeing as many tick labels as you would expect, got it.
There does seem to be a bug here, which I'll investigate, because while I get the expected output with:
If I then manually set
tickmode="array"I see the default ticks, even though settingtickvalsinternally is meant to settickmode="array"!gvwilson commentedon Jun 17, 2024
Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson