Adding a unit to y axis labels in plotly.js
Asked Answered
V

1

5

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.

Vitale answered 21/5, 2018 at 22:38 Comment(3)
Have you checked the tickmode of the yaxis ? the ticktext property should exist according to: plot.ly/python/reference/#layout-yaxis-ticktextUrsi
Got it! Just needed ticksuffixVitale
@Vitale Answer your own question with the solution and close the question!Tiphanie
C
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"
    }
};
Charleen answered 29/7, 2018 at 16:13 Comment(1)
(This post does not seem to provide a quality answer to the question. Please either edit your answer, or just post it as a comment to the question).Annapolis

© 2022 - 2024 — McMap. All rights reserved.