Skip to content

Y-axis labels incorrectly truncate to last 5 digits, losing sign and leading digits #370

@Mary-Gu

Description

@Mary-Gu

Bug Report

When using Plot on the web platform built from Docker, the Y-axis labels truncate numeric values to only the last 5 digits, discarding leading digits and even the minus sign.

Example Code

Plot[10*Cos[x]*x^4, {x, -10, 10}]
Plot[20*Cos[x]*x^4, {x, -10, 10}]

this is not limited to these functions — any Plot[f(x), {x, a, b}] with sufficiently large values (both positive and negative) will reproduce the problem. These two are just examples.

Screenshots

Image
Image

Observed Behavior

The Y-axis values only show the last 5 digits.

For example:
-30,000 appears as 30,000 (sign and 3 lost)
-1200,000 appears as 00,000 (only the 5 digits from the right remained)

The negative sign is entirely missing in the label, which can lead to misinterpretation of the graph.
This seems to be due to a digit-limiting logic that incorrectly applies a "last 5 digits" filter.

Expected Behavior

The entire number should be displayed, including the negative sign and leading digits.
If truncation is desired for formatting, it should be applied carefully, e.g., with scientific notation or by preserving sign and significant figures.

Possible Cause

This might be caused by a formatting function that tries to "preserve 5 digits" but incorrectly slices from the right end of the number string, instead of formatting it meaningfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions