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

Allow X-Axis Logarithmic Scale #4947

Open
kanemcnamara opened this issue Feb 14, 2025 · 2 comments
Open

Allow X-Axis Logarithmic Scale #4947

kanemcnamara opened this issue Feb 14, 2025 · 2 comments
Labels
feature-request New feature or request

Comments

@kanemcnamara
Copy link

Summary

Allow X-Axis to be a logarithmic scale

API Changes

Introduce additional options to the xaxis configuration:

  • logBase (default: 10)
  • logarithmic (default: false)

This should mirror the current y-axis implementation

Sample Use

xaxis: { categories: frequency, logarithmic: true, logBase: 10 }

Intended Use Case

Plotting a frequency response it is common to provide the frequency on the x-axis and the gain on the y-axis. A frequency response should be logarithmic as it mimics the way that humans perceive frequency.

@kanemcnamara kanemcnamara added the feature-request New feature or request label Feb 14, 2025
@beldogueto
Copy link

A log(value+1) would also be nice.

I am using something like:

xaxis: {
labels: {
formatter: function(value) { return Math.log2(value) }
}
}

You can also try Math.log10(value)

@TashaStenner
Copy link

+1 This feature request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants