Skip to content

Exponentformat SI and type log with ticksuffix results in wrong minor tick markings #3689

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

Closed
dries007 opened this issue Mar 28, 2019 · 3 comments

Comments

@dries007
Copy link

I'm plotting a benchmark frequency graph, where the Y axis is (normally) a log scale in the 100M to 1G range.
I'm doing this by using the following options:

{
  "yaxis": {
    "exponentformat": "SI",
    "ticksuffix": "Hz",
    "type": "log",
  },
}

Example: https://jsfiddle.net/sk5v0gx6/

This results when there is at least 1 "major" tick:
image

If there is only "minor" ticks, this is the results: (What I'd consider the correct behaviour.)
image

As you can see the first example omits the 'exponent format', but it does put in the suffix. I think this results in a confusing graph.

I think there are a number of possible fixes for this:

  1. Put the SI prefix in the minor tick, along with actual number (not just the 1-9) (My personal preference.)
  2. Allow an option to only specify suffixes on major ticks. Maybe via showticksuffix. This would still make the graph less readable IMO, but it would at least make it clear the graph doesn't jump from 1GHz to 9Hz.

If this is something that would get accepted as a PR, I'm willing to try and implement it.

@etpinard
Copy link
Contributor

Hi @dries007 - thanks for writing in and sorry for the belated reply.

A lot of users have been noticing less-than-ideal behavior in our minor ticks on log axes, for example: #3679, As we don't currently support minor tick settings (cc #903), it's still not obvious to me how we can make everyone happy and stay consistent with our other tick settings at the moment.

I think both your "possible fixes" items could be solved issue up-coming (tracked in #903) minor ticks settings:

  • For 1., I'm thinking minortick.mode with values 'step' (like log axes currently) and 'actual' (which would correspond to what you're suggesting)

  • For 2., adding something like showminorticksuffix (similar to showticksuffix) should be sufficient.

@etpinard
Copy link
Contributor

But I have to say, you're making a good point that on your https://jsfiddle.net/sk5v0gx6/, we probably shouldn't be showing the Hz ticksuffix on those minor ticks.

I found #3250 which appears equivalent to your item 1. and called it a bug (when ticksuffix is set, assuming ticksuffix corresponds to a unit, I guess 🤔 ).

@archmoj
Copy link
Contributor

archmoj commented Jul 22, 2019

Closing via #4064.

@archmoj archmoj closed this as completed Jul 22, 2019
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

No branches or pull requests

3 participants