Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plotly axis label format with Plotly.js

Tags:

plotly

I have numerical axis labels in the form 12345. Plotly is formatting these numbers in the form 12.3k.

I'd like to be able to show the unaltered numbers, but so far have been unable to fix the formatting.

like image 928
Sion Griffiths Avatar asked Mar 12 '23 15:03

Sion Griffiths


1 Answers

Found that each axis can take a tickformat value which defines the appearance of the ticks.

var layout = {
    xaxis: {
        tickformat : ":04,2f"
    },
    yaxis: {
        tickformat : ":04,2f"
    }
};
like image 101
Sion Griffiths Avatar answered May 13 '23 00:05

Sion Griffiths