Skip to content

logscale axis support in egui plot? #4553

Answered by YgorSouza
hyumo asked this question in Q&A
Discussion options

You must be logged in to vote

There isn't anything out of the box. Issue #2784 is about that but it never got implemented. It might be possible to do that manually by leveraging the x_grid_spacer and y_grid_spacer methods and calling log10 and powi(10) on the data and bounds as needed, but there isn't any example currently. The closest we have is the Custom Axes demo from the demo app.

Note that there is the log_grid_spacer, but all it does is divide the grid recursively as you zoom in (which is already the default behavior). It might serve as a starting point for the log scale grid, though. I'll see if I can give it a go and come up with an example.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@hyumo
Comment options

@YgorSouza
Comment options

@hyumo
Comment options

Answer selected by hyumo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants