-
Notifications
You must be signed in to change notification settings - Fork 10
plot: Add predefined tick formatters #18
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
Conversation
6b276e8 to
2f32249
Compare
| } | ||
|
|
||
| // Pre-computed table of fractions | ||
| #let _common-denoms = range(2, 11 + 1).map(d => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idk. about this. It is the simplest solution I came up with and I think if you really want other fractions, it is fine requiring specifying a fixed denominator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for 11 + 1 instead of 12?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To highlight that, we generate fractions up to n/11, not 12 (because range being zero-based).
jamesrswift
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5839968 to
7ec1298
Compare
7ec1298 to
33fb6f7
Compare

This PR adds a new file
formats.typthat defines some tick formatters.fraction: Formatting tick labels as fractionsmultiple-of: Formatting tick labels as a multiple of a constant (e.g. pi)sci: Scientific number formatterI've changed the "lines" gallery entry to some better looking one that show approximations of sin x and uses the new functions.