Skip to content

Tick display precision should be configurable #336

@DavidGamba

Description

@DavidGamba

Commit 2651c0e added a displayPrecision variable in line 18 (2651c0e#diff-d7f174bedb1bfb5e7a82248d40e9b46fR18).
This variable is used to format float64 ticks. The default value of 4 causes a small-ish number like 20000 to be rendered as 2e+04.
The value should be configurable to allow the user to define if he ever wants scientific notation or not.

I can submit a PR that exposes DefaultDisplayPrecision as a global variable to plot, by changing the const to an exported var but you might have something else in mind. Please let me know how you would like to expose access to that precision without forcing the user to implement his own ticks logic just for the precision.
The approach from the wiki example on the comma separated ticks marks based on the default ticks doesn't work because at that point the tick string has already been generated using the displayPrecision.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions