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

[BUG] Rounding issue with log scale labels #671

Open
qoheniac opened this issue Jan 9, 2025 · 1 comment
Open

[BUG] Rounding issue with log scale labels #671

qoheniac opened this issue Jan 9, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@qoheniac
Copy link

qoheniac commented Jan 9, 2025

In Plotters 0.3.7 building a chart with .build_cartesian_2d(0..100, (1e-15..1e1).log_scale()) gives me:

logscale

@qoheniac qoheniac added the bug Something isn't working label Jan 9, 2025
@qoheniac
Copy link
Author

qoheniac commented Jan 9, 2025

Here is a minimal example:

use plotters::prelude::*;
fn main() {
    let drawing_area = SVGBackend::new("example.svg", (500, 500)).into_drawing_area();
    drawing_area.fill(&WHITE).unwrap();
    let mut chart_context = ChartBuilder::on(&drawing_area)
        .set_left_and_bottom_label_area_size(30)
        .margin(10)
        .build_cartesian_2d(0..100, (1e-15..1e1).log_scale())
        .unwrap();
    chart_context.configure_mesh().draw().unwrap();
}

example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant