I'd like to add a unit to the y-axis tick labels in plotly.js. How might I do this? Adding a ticktext and tickval property for yaxis layout doesn't seem to have the effect I thought, as it does with an xaxis.
Asked
Active
Viewed 5,886 times
5
-
Have you checked the `tickmode` of the yaxis ? the ticktext property should exist according to: https://plot.ly/python/reference/#layout-yaxis-ticktext – merqurio May 21 '18 at 22:56
-
1Got it! Just needed `ticksuffix` – Amy May 22 '18 at 17:20
-
@Amy Answer your own question with the solution and close the question! – Naren Murali May 30 '18 at 18:23
1 Answers
11
As per your own comment, and per here
ticksuffix(string)
You can add this as part of the x or y axis option as part of the layout text for your plot.
e.g.
var layout = {
yaxis:
{
ticksuffix: "suffix"
}
};

JosephWR
- 211
- 3
- 4
-
(This post does not seem to provide a [quality answer](https://stackoverflow.com/help/how-to-answer) to the question. Please either edit your answer, or just post it as a comment to the question). – sɐunıɔןɐqɐp Jul 29 '18 at 16:30