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] LineSeries and draw_series go out of the image scope if stroke_width > 1 #549

Open
fitz35 opened this issue Feb 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@fitz35
Copy link

fitz35 commented Feb 15, 2024

Describe the bug
Describe what is expected, what you actually get.
It would be nice to have screenshot or result image uploaded
When using draw_series and LineSeries with BitMapBackend on highly variable data, augmenting the stroke width made the line to go out of the image. The following graph is plotted with a stroke width of 2 :

line_performance_comparaison_language_without_outliers

The same graphic with a stroke width of 1 :
line_performance_comparaison_language_without_outliers

NOTE : The change of color is because I use a HashMap to plot the serie.
To Reproduce
Some minimal reproduce code is highly recommended

I can export data which are "highly variable", but I'm not sure how to give access to it. Here is the code I use :

// stroke width 1
chart
                .draw_series(
                    LineSeries::new(
                        data_for_legend.iter().map(|(x, y)| (*x, *y)),
                        color.filled().stroke_width(1)
                    )
                )?;

// stroke width 2
chart
                .draw_series(
                    LineSeries::new(
                        data_for_legend.iter().map(|(x, y)| (*x, *y)),
                        color.filled().stroke_width(2)
                    )
                )?;

Version Information
Please give us what version you are using. If you are pulling Plotters directly from git repo, please mention this as well
The version I use is the 0.3.3.

@fitz35 fitz35 added the bug Something isn't working label Feb 15, 2024
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