Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile control - Added zMaxChars option that defines the maximum num… #749

Merged
merged 1 commit into from
Mar 11, 2022

Conversation

sebbelese
Copy link
Contributor

@sebbelese sebbelese commented Mar 7, 2022

When the z label is too large, it is partly written under the axis label or even outside of the canvas, see issue #748.

The proposed change considers adding a zMaxChars option that defines the maximum number of chars to be used for z graduation label before switching to scientific notation.

When the width of the largest label is larger than the zMaxChars limit, then, the whole axis switches to scientific notation with a single exponent deduced from the largest absolute value to be labelled.

The base numbers are then is displayed at a precision using maximum available characters defined by zMaxChars, including the decimal point and sign.

The proposed changes do not affect the default behaviour (i.e. no change if zMaxChars option is not provided), except a small increase of left margin that you may choose to ignore.

See a few examples for different orders of magnitude and zMaxChars=5:
image
image
image
image
image
image
image

…ber of chars to be used for z graduation before switching to scientific notation
@sebbelese
Copy link
Contributor Author

sebbelese commented Mar 10, 2022

Sorry, the latest commit should not have been included in the merge request, it was a change for my personal use, I removed it.

@Viglino Viglino merged commit 87d36f5 into Viglino:master Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants