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

Add symlog and compound scales #134

Closed
wants to merge 2 commits into from
Closed

Conversation

danielnaab
Copy link

The motivation for this work is to produce Matplotlib-style "symlog" scaling, as described in #105.

The PR adds the notion of a "compound scale", a scale that delegates to any number of other scales. Its range and domains are inclusive to each provided scale. The symlog scale is responsible for instantiating the compound scale given a range or domain, with:

Log scale: [-Infinity, -1]
Linear scale: [-1, 1]
Log scale: [1, Infinity]

@curran
Copy link
Contributor

curran commented Aug 15, 2018

This PR is missing documentation updates.

@danielnaab
Copy link
Author

@curran Thanks, just pushed a commit with doc updates.

@Tillsten
Copy link

I am a regular user of symlog scales in matplotlib I think this PR is missing that the linear threshold and the scale factor of the scale is changeable. The former limits the linear domain and the latter determines the relative scaling of the log and the linear parts.

@danielnaab
Copy link
Author

@Tillsten Right this isn't exactly what Matplotlib supports, it's a more basic implementation. If you have ideas how to integrate more flexibility, I can add to the PR.

@mbostock
Copy link
Member

mbostock commented Jan 6, 2019

I’ve finally gotten around to implementing arbitrary transforms for scales in #156, to which I’ve added a (non-configurable) symlog transform. It would be pretty easy to make the symlog transform configurable if desired, and you can easily pass in a custom transform to a scale. There’s still some work to do over there, but I’d love feedback if you’re still interested in this feature. Thank you!

@mbostock mbostock closed this Jan 6, 2019
@ghost
Copy link

ghost commented Mar 24, 2020

@mbostock Can you show me an example for configure a custom range (x) for symlog? I.e.

Log scale: [-Infinity, -x]
Linear scale: [-x, x]
Log scale: [x, Infinity]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants